Skip to content

Commit

Permalink
fix(nut): wordcount in visual mode
Browse files Browse the repository at this point in the history
  • Loading branch information
MunifTanjim committed Nov 15, 2023
1 parent 45cc6e6 commit 5818222
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lua/nougat/item/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ This is used to get the value from cache store for the current context.

If cache store is created by `NougatItem`, this will be used as initial value for the cache.

If `initial_value` is given, `NougatItem` will not automatically cache the item content.

#### `cache.scope`

**Type:** `'buf'|'win'|'tab'`
Expand Down
2 changes: 1 addition & 1 deletion lua/nougat/item/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ local function init(class, config)
end
assert(type(self.cache) == "function", "one of cache.get or cache.scope is required")

self._cache_type = cache.store and "manual" or "auto"
self._cache_type = (cache.store or cache.initial_value) and "manual" or "auto"
if self._cache_type == "auto" and type(self.content) == "function" then
self._get_content = self.content
self.content = ic.auto_cached_content
Expand Down

0 comments on commit 5818222

Please sign in to comment.