Comments (7)
By the way, I will be pushing quite a few changes soon, including better highlight support so that you won't need to use winhl
. And thank you very much for the kind words!
from incline.nvim.
This is very interesting. It seems to be a Neovim bug. I can reproduce it with no plugins, like so:
nvim --clean
:lua vim.api.nvim_win_set_option(vim.api.nvim_open_win(vim.api.nvim_create_buf(false, true), false, { relative = "editor", width = 1, height = 1, row = 1, col = 1 }), "winhighlight", "Normal:Search")
:copen
I've opened a neovim issue: neovim/neovim#18283
from incline.nvim.
@b0o thanks for looking into this and raising the issue in neovim core 👍🏿 , just tried out the new API, and it works great, doesn't leak into the quickfix any more 💯. Will close this out now then.
from incline.nvim.
@b0o like you've figured out, the problem is caused by the fact that both
nvim_win_set_option
and nvim_buf_set_option
do not behave like
:setlocal
, even though that's how they're intended to work. I was fighting
with this bug for a while in my plugin diffview. Essentially, contrary to
when using :setlocal
, setting options in a window A
with nvim_win_set_option
and then creating a new window B
from that window, B
will inherit all window
options from A
including those set with nvim_win_set_option
.
I found that the simplest way to get around this is to just create a wrapper
around :setlocal
. I've been using this wrapper in both my plugins, and I've
had no problems with this bug ever since (this code uses some ugly polymorphic
parameters, but I just really enjoy the convenience of overload signatures).
from incline.nvim.
Hey @sindrets, thank you for sharing! I just wrote a wrapper inspired by yours, it seems to have fixed the issue for me.
Before I merge those changes into main, I am curious to know what the purpose of no_win_event_call
is, and if it is necessary in this case? I just tested the following to see if nvim_win_call
triggers those events, but when I run these two commands I don't see any "event"
messages:
:au WinEnter,WinLeave,WinNew,WinClosed,BufEnter,BufLeave * echom "event"
:lua vim.api.nvim_win_call(1002, function() vim.cmd [[setlocal winhighlight=Normal:Search]] end)
from incline.nvim.
@b0o Ah, it seems you're right: setlocal
doesn't seem to trigger any of
these events, and it's probably only there due to an oversight. Thank you for
pointing that out!
Finding out what does and doesn't trigger these events can
be a bit surprising sometimes, so I've probably used this function a bit too
liberally. It has notably improved performance for me in instances where I'm
changing buffers multiple times in multiple windows over a short time span.
from incline.nvim.
@sindrets Cool, just wanted to make sure!
@akinsho I've merged the fix into main, would you mind giving it a try for me?
from incline.nvim.
Related Issues (20)
- Rotating windows with `CTRL-W_R` doesn't trigger update
- Change indicator support? HOT 2
- Add Option `hide > inactive_window` HOT 11
- Powerline symbols on ends HOT 2
- Incompatible with zen-mode.nvim HOT 4
- Supress overlaping if statement HOT 3
- How to Add rounded Edges ? HOT 1
- Bug: Incline disable doesn't consistently work with tabs HOT 2
- How to trigger a rerender? HOT 2
- feature request: multiple instances of incline.nvim HOT 1
- Unresponsiveness on events HOT 3
- Make updating event configurable HOT 1
- No module called incline.helpers HOT 6
- Hide label if cursor is directly within the label area HOT 2
- Dynamically add separators HOT 4
- Scrolling performance impact when incline is enabled HOT 6
- Compatibility with competitest.nvim
- Winbar isn't displayed after the session loading (persistance.nvim)
- Is there any way to have winblend with ``incline.nvim``? HOT 1
- Window pickers adding extra options for incline windows HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from incline.nvim.