mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +00:00
fix(popup): new preview_bufnr created when menu item is selected #32819
Problem: "use_float" in the if-condition causes a new buffer to be generated on every execution. Solution: - Remove the incorrect use_float check from the condition. - Use buf_clear to properly clear the existing buffer.
This commit is contained in:
@@ -1039,12 +1039,9 @@ static bool pum_set_selected(int n, int repeat)
|
||||
&& (curbuf->b_nwindows == 1)
|
||||
&& (curbuf->b_fname == NULL)
|
||||
&& bt_nofile(curbuf)
|
||||
&& (curbuf->b_p_bh[0] == 'w')
|
||||
&& !use_float) {
|
||||
&& (curbuf->b_p_bh[0] == 'w')) {
|
||||
// Already a "wipeout" buffer, make it empty.
|
||||
while (!buf_is_empty(curbuf)) {
|
||||
ml_delete(1, false);
|
||||
}
|
||||
buf_clear();
|
||||
} else {
|
||||
// Don't want to sync undo in the current buffer.
|
||||
no_u_sync++;
|
||||
|
Reference in New Issue
Block a user