mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 10:49:08 +00:00
fix(statusline): fix status line cache key (#656)
## Description
<!-- Describe the big picture of your changes to communicate to the
maintainers
why we should accept this pull request. -->
-
d972bc0a47
breaks cache key for virtual lines since `0 and 1 or 0` also evaluates
to 1 in lua.
## Related Issue(s)
<!--
If this PR fixes any issues, please link to the issue here.
- Fixes #<issue_number>
-->
- Fixes #510
## Screenshots
<!-- Add screenshots of the changes if applicable. -->
This commit is contained in:
parent
384b9a7a36
commit
af559349e5
1 changed files with 1 additions and 1 deletions
|
@ -237,7 +237,7 @@ end
|
|||
function M.get()
|
||||
local win = vim.g.statusline_winid
|
||||
local buf = vim.api.nvim_win_get_buf(win)
|
||||
local key = ("%d:%d:%d:%d"):format(win, buf, vim.v.lnum, vim.v.virtnum and 1 or 0)
|
||||
local key = ("%d:%d:%d:%d"):format(win, buf, vim.v.lnum, vim.v.virtnum ~= 0 and 1 or 0)
|
||||
if cache[key] then
|
||||
return cache[key]
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue