-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The popup functions in Vim lack a function to change the buffer in popup #15006
Comments
I don't understand that comment. If the file is large and hasn't been loaded as a buffer yet, it will be exactly as costly because you need to load this as a buffer. It may even be more costly, since we have to create a buffer for that file. Using If the buffer has been already loaded, you may be right, but the same overhead has happened eventually, but might have happened a bit earlier, when the file was read into a buffer. So I don't think this benefits us anything here. |
I meant the buffer has already been loaded. |
do you use |
You don't have to use Here's a script that I've written a few years ago (and eventually rewritten in vim9script). Hit CTRL-P to preview the next buffer in your buffer list in a popup window. Once the popup is displayed, you can scroll the popup window with
But I agree, not being able to preview another buffer in an already displayed popup window is annoying. It would certainly be helpful. |
No, the search is not slow, to preview a large buffer is slow. |
I knew this method and tried it. It's slower than using |
related: vim#15006 Problem: cannot change buffer in a popup Solution: add popup_setbuf() function
related: vim#15006 Problem: cannot change buffer in a popup Solution: add popup_setbuf() function
related: vim#15006 Problem: cannot change buffer in a popup Solution: add popup_setbuf() function
related: vim#15006 Problem: cannot change buffer in a popup Solution: add popup_setbuf() function
related: vim#15006 Problem: cannot change buffer in a popup Solution: add popup_setbuf() function
related: vim#15006 Problem: cannot change buffer in a popup Solution: add popup_setbuf() function
I noticed the describtion of popup_settext() explicitly limit the second arg not the buffer number, while popup_create() allowed the first arg. Would it be more unified to remove this limitation instead of creating a new interface? |
related: vim#15006 Problem: cannot change buffer in a popup Solution: add popup_setbuf() function
related: vim#15006 Problem: cannot change buffer in a popup Solution: add popup_setbuf() function
Honestly, I don't understand that remark from
But at |
That sounds good to me. |
what exactly? |
|
👍 |
@Yggdroot so how's this new func, was it solving your perf problem now? |
I haven't tried yet. |
Is your feature request about something that is currently impossible or hard to do? Please describe the problem.
Neovim has a function
nvim_win_set_buf
, which can change the buffer in the specified window, but vim's popup functions donot have a function like it.
If I want to change the content in the popup, I have to use
popup_settext
, if a file is too large, reading from the file andpopup_settext
would be too costly. It would be better if vim's popup has a function likenvim_win_set_buf
.Describe the solution you'd like
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: