refactor: always setlocal on window options#2263
Conversation
phanen
commented
Aug 19, 2025
- refactor: always setlocal on window options
- chore: remove useless autocmd
- refactor: move logic to win:resized, win:save_size
- refactor: simplify utils.eventignore
- fix(previewer): prefer winopts.winhl (useful with non-float window as previewer)
chore: remove useless autocmd refactor: move logic to win:resized, win:save_size refactor: simplify utils.eventignore
| if will_replace_curbuf | ||
| and vim.fn.exists("&winfixbuf") == 1 | ||
| and vim.wo.winfixbuf | ||
| if will_replace_curbuf and utils.wo.winfixbuf |
There was a problem hiding this comment.
Since this was added in 0.10 and we still support 0.9 don’t we still need vim.fn.exists("&winfixbuf") == 1?
There was a problem hiding this comment.
i change the semantic of utils.wo
see in tests/utils_spec
There was a problem hiding this comment.
i write something wrong right vim.wo in eq should be utils.wo
There was a problem hiding this comment.
i write something wrong right vim.wo in eq should be utils.wo
But it is utils.wo
| if fn.exists("+eventignorewin") == 1 and vim.wo[win][0].eventignorewin == "" then | ||
| vim.wo[win][0].eventignorewin = "WinResized" | ||
| end | ||
| utils.wo[win].eventignorewin = "WinResized" |
There was a problem hiding this comment.
Same as other comment, wasn’t eventignorewin only added with 0.10?
|
After commit 05a4af9, preview windows have different background until the window is resized. |
|
Resume this line seems work? idk why diff --git a/lua/fzf-lua/win.lua b/lua/fzf-lua/win.lua
index c6957ce..5462533 100644
--- a/lua/fzf-lua/win.lua
+++ b/lua/fzf-lua/win.lua
@@ -531,7 +531,8 @@ function FzfWin:reset_win_highlights(win)
end
end
end
- utils.wo[win].winhl = hl
+ -- utils.wo[win].winhl = hl
+ if vim.wo[win].winhighlight ~= hl then vim.wo[win].winhighlight = hl end
end
---@param exit_code integer |
I'm confused too, but isn't |
|
isn't vim.wo[winid] equals to nvim_set_option_value with scope=local? no it‘s scope=nil |
I see, we can leave it like this until we figure out what’s wrong, as long as there’s no downside |
|
til |