mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 00:08:19 +00:00
vim-patch:9.0.0198: ml_get error when switching buffer in Visual mode (#19756)
Problem: ml_get error when switching buffer in Visual mode.
Solution: End Visual mode when switching buffer. (closes vim/vim#10902)
cfeb8a584b
This commit is contained in:
@@ -1533,6 +1533,15 @@ void set_curbuf(buf_T *buf, int action)
|
||||
/// be pointing to freed memory.
|
||||
void enter_buffer(buf_T *buf)
|
||||
{
|
||||
// when closing the current buffer stop Visual mode
|
||||
if (VIsual_active
|
||||
#if defined(EXITFREE)
|
||||
&& !entered_free_all_mem
|
||||
#endif
|
||||
) {
|
||||
end_visual_mode();
|
||||
}
|
||||
|
||||
// Get the buffer in the current window.
|
||||
curwin->w_buffer = buf;
|
||||
curbuf = buf;
|
||||
|
Reference in New Issue
Block a user