mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 7.4.2347
Problem: Crash when closing a buffer while Visual mode is active. (Dominique Pelle) Solution: Adjust the position before computing the number of lines. When closing the current buffer stop Visual mode.
This commit is contained in:
@@ -578,6 +578,11 @@ aucmd_abort:
|
||||
if (buf->b_ffname == NULL)
|
||||
del_buf = TRUE;
|
||||
|
||||
/* When closing the current buffer stop Visual mode before freeing
|
||||
* anything. */
|
||||
if (buf == curbuf)
|
||||
end_visual_mode();
|
||||
|
||||
/*
|
||||
* Free all things allocated for this buffer.
|
||||
* Also calls the "BufDelete" autocommands when del_buf is TRUE.
|
||||
@@ -1379,6 +1384,10 @@ do_buffer(
|
||||
}
|
||||
}
|
||||
|
||||
/* When closing the current buffer stop Visual mode. */
|
||||
if (buf == curbuf)
|
||||
end_visual_mode();
|
||||
|
||||
/*
|
||||
* If deleting the last (listed) buffer, make it empty.
|
||||
* The last (listed) buffer cannot be unloaded.
|
||||
|
Reference in New Issue
Block a user