mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:7.4.2225
Problem: Crash when placing a sign in a deleted buffer.
Solution: Check for missing buffer name. (Dominique Pelle). Add a test.
bfd096d020
This commit is contained in:
parent
4453aa0d29
commit
486e968bb6
@ -5675,6 +5675,10 @@ void ex_sign(exarg_T *eap)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // ... not currently in a window
|
{ // ... not currently in a window
|
||||||
|
if (buf->b_fname == NULL) {
|
||||||
|
EMSG(_("E934: Cannot jump to a buffer that does not have a name"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
char *cmd = xmalloc(STRLEN(buf->b_fname) + 25);
|
char *cmd = xmalloc(STRLEN(buf->b_fname) + 25);
|
||||||
sprintf(cmd, "e +%" PRId64 " %s",
|
sprintf(cmd, "e +%" PRId64 " %s",
|
||||||
(int64_t)lnum, buf->b_fname);
|
(int64_t)lnum, buf->b_fname);
|
||||||
|
@ -181,3 +181,15 @@ func Test_sign_invalid_commands()
|
|||||||
call assert_fails('sign place 1 buffer=', 'E158:')
|
call assert_fails('sign place 1 buffer=', 'E158:')
|
||||||
call assert_fails('sign define Sign2 text=', 'E239:')
|
call assert_fails('sign define Sign2 text=', 'E239:')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_sign_delete_buffer()
|
||||||
|
new
|
||||||
|
sign define Sign text=x
|
||||||
|
let bufnr = bufnr('%')
|
||||||
|
new
|
||||||
|
exe 'bd ' . bufnr
|
||||||
|
exe 'sign place 61 line=3 name=Sign buffer=' . bufnr
|
||||||
|
call assert_fails('sign jump 61 buffer=' . bufnr, 'E934:')
|
||||||
|
sign unplace 61
|
||||||
|
sign undefine Sign
|
||||||
|
endfunc
|
||||||
|
@ -215,7 +215,7 @@ static int included_patches[] = {
|
|||||||
// 2228,
|
// 2228,
|
||||||
2227,
|
2227,
|
||||||
// 2226,
|
// 2226,
|
||||||
// 2225,
|
2225,
|
||||||
// 2224,
|
// 2224,
|
||||||
// 2223,
|
// 2223,
|
||||||
// 2222,
|
// 2222,
|
||||||
|
Loading…
Reference in New Issue
Block a user