mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 05:58:33 +00:00
vim-patch:8.2.1902: default option values changed with :badd for existing buffer
Problem: Default option values are changed when using :badd for an existing
buffer.
Solution: When calling buflist_new() pass a zero line number. (closes vim/vim#7195)
e974fa7b2b
This commit is contained in:
@@ -2324,7 +2324,9 @@ int do_ecmd(
|
|||||||
buf = buflist_findnr(fnum);
|
buf = buflist_findnr(fnum);
|
||||||
} else {
|
} else {
|
||||||
if (flags & (ECMD_ADDBUF | ECMD_ALTBUF)) {
|
if (flags & (ECMD_ADDBUF | ECMD_ALTBUF)) {
|
||||||
linenr_T tlnum = 1L;
|
// Default the line number to zero to avoid that a wininfo item
|
||||||
|
// is added for the current window.
|
||||||
|
linenr_T tlnum = 0;
|
||||||
|
|
||||||
if (command != NULL) {
|
if (command != NULL) {
|
||||||
tlnum = atol((char *)command);
|
tlnum = atol((char *)command);
|
||||||
|
@@ -1,5 +1,17 @@
|
|||||||
" Tests for Vim buffer
|
" Tests for Vim buffer
|
||||||
|
|
||||||
|
func Test_badd_options()
|
||||||
|
new SomeNewBuffer
|
||||||
|
setlocal cole=3
|
||||||
|
wincmd p
|
||||||
|
badd SomeNewBuffer
|
||||||
|
new SomeNewBuffer
|
||||||
|
call assert_equal(3, &cole)
|
||||||
|
close
|
||||||
|
close
|
||||||
|
bwipe! SomeNewBuffer
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_balt()
|
func Test_balt()
|
||||||
new SomeNewBuffer
|
new SomeNewBuffer
|
||||||
balt +3 OtherBuffer
|
balt +3 OtherBuffer
|
||||||
|
Reference in New Issue
Block a user