set nowinfixbuf
call setqflist([])
-
- for l:window_info in getwininfo()
- call setloclist(l:window_info["winid"], [])
- endfor
+ call setloclist(0, [], 'f')
delmarks A-Z0-9
endfunc
call s:reset_all_buffers()
let l:file_path = tempname()
- call writefile(["Error - bad-thing-found"], l:file_path)
+ call writefile(["Error - bad-thing-found"], l:file_path, 'D')
execute "edit " . l:file_path
let l:file_buffer = bufnr()
let l:current = bufnr()
execute 'caddexpr expand("%") .. ":" .. line(".") .. ":" .. getline(".")'
call assert_equal(l:current, bufnr())
-
- call delete(l:file_path)
endfunc
" Fail :cbuffer but :cbuffer! is allowed
call s:reset_all_buffers()
let l:file_path = tempname()
- call writefile(["first.unittest:1:Error - bad-thing-found"], l:file_path)
+ call writefile(["first.unittest:1:Error - bad-thing-found"], l:file_path, 'D')
execute "edit " . l:file_path
let l:file_buffer = bufnr()
let l:current = bufnr()
execute "cbuffer! " . l:file_buffer
call assert_equal("first.unittest", expand("%:t"))
-
- call delete(l:file_path)
endfunc
" Allow :cc but the 'nowinfixbuf' window is selected, instead
let l:current = bufnr()
let l:file = tempname()
- call writefile([], l:file)
+ call writefile([], l:file, 'D')
let l:file = fnamemodify(l:file, ':p') " In case it's Windows 8.3-style.
let l:directory = fnamemodify(l:file, ":p:h")
let l:name = fnamemodify(l:file, ":p:t")
call assert_equal(l:file, expand("%:p"))
execute "set path=" . l:original_path
- call delete(l:file)
endfunc
" Fail :first but :first! is allowed
call writefile([
\ '#include "' . l:include_file . '"'
\ ],
- \ "main.c")
- call writefile(["#define min(X, Y) ((X) < (Y) ? (X) : (Y))"], l:include_file)
+ \ "main.c", 'D')
+ call writefile(["#define min(X, Y) ((X) < (Y) ? (X) : (Y))"], l:include_file, 'D')
edit main.c
set winfixbuf
set define&
set include&
set path&
- call delete("main.c")
- call delete(l:include_file)
endfunc
" Fail :lNext but :lNext! is allowed
call s:reset_all_buffers()
let l:file_path = tempname()
- call writefile(["Error - bad-thing-found"], l:file_path)
+ call writefile(["Error - bad-thing-found"], l:file_path, 'D')
execute "edit " . l:file_path
let l:file_buffer = bufnr()
let l:current = bufnr()
execute 'laddexpr expand("%") .. ":" .. line(".") .. ":" .. getline(".")'
call assert_equal(l:current, bufnr())
-
- call delete(l:file_path)
endfunc
" Fail :last but :last! is allowed
call s:reset_all_buffers()
let l:file_path = tempname()
- call writefile(["first.unittest:1:Error - bad-thing-found"], l:file_path)
+ call writefile(["first.unittest:1:Error - bad-thing-found"], l:file_path, 'D')
execute "edit " . l:file_path
let l:file_buffer = bufnr()
let l:current = bufnr()
execute "lbuffer! " . l:file_buffer
call assert_equal("first.unittest", expand("%:t"))
-
- call delete(l:file_path)
endfunc
" Fail :ldo but :ldo! is allowed
write
let l:file = tempname()
- call writefile(["first.unittest:1:Error - bad-thing-found was detected"], l:file)
+ call writefile(["first.unittest:1:Error - bad-thing-found was detected"], l:file, 'D')
let l:current = bufnr()
execute ":lfile! " . l:file
call assert_equal(l:first, bufnr())
- call delete(l:file)
call delete("first.unittest")
call delete("second.unittest")
endfunc
\ "one\tXfile\t1",
\ "three\tXfile\t3",
\ "two\tXfile\t2"],
- \ "Xtags")
- call writefile(["one", "two", "three"], "Xfile")
- call writefile(["one"], "Xother")
+ \ "Xtags", 'D')
+ call writefile(["one", "two", "three"], "Xfile", 'D')
+ call writefile(["one"], "Xother", 'D')
edit Xother
execute "normal \<C-]>"
ltag! one
set tags&
- call delete("Xtags")
- call delete("Xfile")
- call delete("Xother")
endfunc
" Fail vim.command if we try to change buffers while 'winfixbuf' is set
\ "one\tXfile\t1",
\ "three\tXfile\t3",
\ "two\tXfile\t2"],
- \ "Xtags")
- call writefile(["one", "two", "three"], "Xfile")
- call writefile(["one"], "Xother")
+ \ "Xtags", 'D')
+ call writefile(["one", "two", "three"], "Xfile", 'D')
+ call writefile(["one"], "Xother", 'D')
edit Xother
set winfixbuf
call assert_equal(l:current, bufnr())
set tags&
- call delete("Xtags")
- call delete("Xfile")
- call delete("Xother")
endfunc
" Fail to jump to a tag with g<RightMouse> if 'winfixbuf' is enabled
\ "one\tXfile\t1",
\ "three\tXfile\t3",
\ "two\tXfile\t2"],
- \ "Xtags")
- call writefile(["one", "two", "three"], "Xfile")
- call writefile(["one"], "Xother")
+ \ "Xtags", 'D')
+ call writefile(["one", "two", "three"], "Xfile", 'D')
+ call writefile(["one"], "Xother", 'D')
edit Xother
execute "normal \<C-]>"
set tags&
set mouse&
- call delete("Xtags")
- call delete("Xfile")
- call delete("Xother")
endfunc
" Fail to jump to a tag with g] if 'winfixbuf' is enabled
\ "one\tXfile\t1",
\ "three\tXfile\t3",
\ "two\tXfile\t2"],
- \ "Xtags")
- call writefile(["one", "two", "three"], "Xfile")
- call writefile(["one"], "Xother")
+ \ "Xtags", 'D')
+ call writefile(["one", "two", "three"], "Xfile", 'D')
+ call writefile(["one"], "Xother", 'D')
edit Xother
set winfixbuf
call assert_equal(l:current, bufnr())
set tags&
- call delete("Xtags")
- call delete("Xfile")
- call delete("Xother")
endfunc
" Fail to jump to a tag with <C-RightMouse> if 'winfixbuf' is enabled
\ "one\tXfile\t1",
\ "three\tXfile\t3",
\ "two\tXfile\t2"],
- \ "Xtags")
- call writefile(["one", "two", "three"], "Xfile")
- call writefile(["one"], "Xother")
+ \ "Xtags", 'D')
+ call writefile(["one", "two", "three"], "Xfile", 'D')
+ call writefile(["one"], "Xother", 'D')
edit Xother
execute "normal \<C-]>"
set tags&
set mouse&
- call delete("Xtags")
- call delete("Xfile")
- call delete("Xother")
endfunc
" Fail to jump to a tag with <C-t> if 'winfixbuf' is enabled
\ "one\tXfile\t1",
\ "three\tXfile\t3",
\ "two\tXfile\t2"],
- \ "Xtags")
- call writefile(["one", "two", "three"], "Xfile")
- call writefile(["one"], "Xother")
+ \ "Xtags", 'D')
+ call writefile(["one", "two", "three"], "Xfile", 'D')
+ call writefile(["one"], "Xother", 'D')
edit Xother
execute "normal \<C-]>"
call assert_equal(l:current, bufnr())
set tags&
- call delete("Xtags")
- call delete("Xfile")
- call delete("Xother")
endfunc
" Disallow <C-^> in 'winfixbuf' windows
\ "one\tXfile\t1",
\ "three\tXfile\t3",
\ "two\tXfile\t2"],
- \ "Xtags")
- call writefile(["one", "two", "three"], "Xfile")
- call writefile(["one"], "Xother")
+ \ "Xtags", 'D')
+ call writefile(["one", "two", "three"], "Xfile", 'D')
+ call writefile(["one"], "Xother", 'D')
edit Xother
set winfixbuf
call assert_equal(l:current, bufnr())
set tags&
- call delete("Xtags")
- call delete("Xfile")
- call delete("Xother")
endfunc
" Allow <C-w><C-]> with 'winfixbuf' enabled because it runs in a new, split window
\ "one\tXfile\t1",
\ "three\tXfile\t3",
\ "two\tXfile\t2"],
- \ "Xtags")
- call writefile(["one", "two", "three"], "Xfile")
- call writefile(["one"], "Xother")
+ \ "Xtags", 'D')
+ call writefile(["one", "two", "three"], "Xfile", 'D')
+ call writefile(["one"], "Xother", 'D')
edit Xother
set winfixbuf
call assert_equal(l:current_windows + 1, s:get_windows_count())
set tags&
- call delete("Xtags")
- call delete("Xfile")
- call delete("Xother")
endfunc
" Allow <C-w>g<C-]> with 'winfixbuf' enabled because it runs in a new, split window
\ "one\tXfile\t1",
\ "three\tXfile\t3",
\ "two\tXfile\t2"],
- \ "Xtags")
- call writefile(["one", "two", "three"], "Xfile")
- call writefile(["one"], "Xother")
+ \ "Xtags", 'D')
+ call writefile(["one", "two", "three"], "Xfile", 'D')
+ call writefile(["one"], "Xother", 'D')
edit Xother
set winfixbuf
call assert_equal(l:current_windows + 1, s:get_windows_count())
set tags&
- call delete("Xtags")
- call delete("Xfile")
- call delete("Xother")
endfunc
" Fail to jump to a tag with <C-]> if 'winfixbuf' is enabled
\ "one\tXfile\t1",
\ "three\tXfile\t3",
\ "two\tXfile\t2"],
- \ "Xtags")
- call writefile(["one", "two", "three"], "Xfile")
- call writefile(["one", "two", "three"], "Xother")
+ \ "Xtags", 'D')
+ call writefile(["one", "two", "three"], "Xfile", 'D')
+ call writefile(["one", "two", "three"], "Xother", 'D')
edit Xother
set winfixbuf
call assert_equal(l:current, bufnr())
set tags&
- call delete("Xtags")
- call delete("Xfile")
- call delete("Xother")
endfunc
" Prevent gF from switching a 'winfixbuf' window's buffer
let l:file = tempname()
call append(0, [l:file])
- call writefile([], l:file)
+ call writefile([], l:file, 'D')
" Place the cursor onto the line that has `l:file`
normal gg
" Prevent Vim from erroring with "No write since last change @ command
normal gF
call assert_notequal(l:buffer, bufnr())
- call delete(l:file)
+ set nohidden
endfunc
" Prevent gf from switching a 'winfixbuf' window's buffer
let l:file = tempname()
call append(0, [l:file])
- call writefile([], l:file)
+ call writefile([], l:file, 'D')
" Place the cursor onto the line that has `l:file`
normal gg
" Prevent Vim from erroring with "No write since last change @ command
normal gf
call assert_notequal(l:buffer, bufnr())
- call delete(l:file)
+ set nohidden
endfunc
" Fail "goto file under the cursor" (using [f, which is the same as `:normal gf`)
let l:file = tempname()
call append(0, [l:file])
- call writefile([], l:file)
+ call writefile([], l:file, 'D')
" Place the cursor onto the line that has `l:file`
normal gg
" Prevent Vim from erroring with "No write since last change @ command
normal [f
call assert_notequal(l:buffer, bufnr())
- call delete(l:file)
+ set nohidden
endfunc
" Fail to go to a C macro with [<C-d> if 'winfixbuf' is enabled
call writefile(["min(1, 12);",
\ '#include "' . l:include_file . '"'
\ ],
- \ "main.c")
- call writefile(["#define min(X, Y) ((X) < (Y) ? (X) : (Y))"], l:include_file)
+ \ "main.c", 'D')
+ call writefile(["#define min(X, Y) ((X) < (Y) ? (X) : (Y))"], l:include_file, 'D')
edit main.c
normal ]\<C-d>
execute "normal [\<C-d>"
call assert_notequal(l:current, bufnr())
-
- call delete("main.c")
- call delete(l:include_file)
endfunc
" Fail to go to a C macro with ]<C-d> if 'winfixbuf' is enabled
call writefile(["min(1, 12);",
\ '#include "' . l:include_file . '"'
\ ],
- \ "main.c")
- call writefile(["#define min(X, Y) ((X) < (Y) ? (X) : (Y))"], l:include_file)
+ \ "main.c", 'D')
+ call writefile(["#define min(X, Y) ((X) < (Y) ? (X) : (Y))"], l:include_file, 'D')
edit main.c
set winfixbuf
execute "normal ]\<C-d>"
call assert_notequal(l:current, bufnr())
-
- call delete("main.c")
- call delete(l:include_file)
endfunc
" Fail to go to a C macro with [<C-i> if 'winfixbuf' is enabled
call writefile(['#include "' . l:include_file . '"',
\ "min(1, 12);",
\ ],
- \ "main.c")
- call writefile(["#define min(X, Y) ((X) < (Y) ? (X) : (Y))"], l:include_file)
+ \ "main.c", 'D')
+ call writefile(["#define min(X, Y) ((X) < (Y) ? (X) : (Y))"], l:include_file, 'D')
edit main.c
" Move to the line with `min(1, 12);` on it"
normal j
set define&
set include&
set path&
- call delete("main.c")
- call delete(l:include_file)
endfunc
" Fail to go to a C macro with ]<C-i> if 'winfixbuf' is enabled
call writefile(["min(1, 12);",
\ '#include "' . l:include_file . '"'
\ ],
- \ "main.c")
- call writefile(["#define min(X, Y) ((X) < (Y) ? (X) : (Y))"], l:include_file)
+ \ "main.c", 'D')
+ call writefile(["#define min(X, Y) ((X) < (Y) ? (X) : (Y))"], l:include_file, 'D')
edit main.c
set winfixbuf
set define&
set include&
set path&
- call delete("main.c")
- call delete(l:include_file)
endfunc
" Fail "goto file under the cursor" (using ]f, which is the same as `:normal gf`)
let l:file = tempname()
call append(0, [l:file])
- call writefile([], l:file)
+ call writefile([], l:file, 'D')
" Place the cursor onto the line that has `l:file`
normal gg
" Prevent Vim from erroring with "No write since last change @ command
normal ]f
call assert_notequal(l:buffer, bufnr())
- call delete(l:file)
+ set nohidden
endfunc
" Fail to jump to a tag with v<C-]> if 'winfixbuf' is enabled
\ "one\tXfile\t1",
\ "three\tXfile\t3",
\ "two\tXfile\t2"],
- \ "Xtags")
- call writefile(["one", "two", "three"], "Xfile")
- call writefile(["one"], "Xother")
+ \ "Xtags", 'D')
+ call writefile(["one", "two", "three"], "Xfile", 'D')
+ call writefile(["one"], "Xother", 'D')
edit Xother
set winfixbuf
call assert_equal(l:current, bufnr())
set tags&
- call delete("Xtags")
- call delete("Xfile")
- call delete("Xother")
endfunc
" Fail to jump to a tag with vg<C-]> if 'winfixbuf' is enabled
\ "one\tXfile\t1",
\ "three\tXfile\t3",
\ "two\tXfile\t2"],
- \ "Xtags")
- call writefile(["one", "two", "three"], "Xfile")
- call writefile(["one"], "Xother")
+ \ "Xtags", 'D')
+ call writefile(["one", "two", "three"], "Xfile", 'D')
+ call writefile(["one"], "Xother", 'D')
edit Xother
set winfixbuf
call assert_equal(l:current, bufnr())
set tags&
- call delete("Xtags")
- call delete("Xfile")
- call delete("Xother")
endfunc
" Allow :pedit because, unlike :edit, it uses a separate window
\ "thesame\tXfile\t2;\"\td\tfile:",
\ "thesame\tXfile\t3;\"\td\tfile:",
\ ],
- \ "Xtags")
- call writefile(["thesame one", "thesame two", "thesame three"], "Xfile")
- call writefile(["thesame one"], "Xother")
+ \ "Xtags", 'D')
+ call writefile(["thesame one", "thesame two", "thesame three"], "Xfile", 'D')
+ call writefile(["thesame one"], "Xother", 'D')
edit Xother
tag thesame
call assert_notequal(l:current, bufnr())
set tags&
- call delete("Xtags")
- call delete("Xfile")
- call delete("Xother")
endfunc
" Fail :previous but :previous! is allowed
\ "buffer = vim.vars['_previous_buffer']",
\ "vim.current.buffer = vim.buffers[buffer]",
\ ],
- \ "file.py")
+ \ "file.py", 'D')
try
pyxfile file.py
call assert_equal(1, l:caught)
- call delete("file.py")
unlet g:_previous_buffer
endfunc
\ "thesame\tXfile\t2;\"\td\tfile:",
\ "thesame\tXfile\t3;\"\td\tfile:",
\ ],
- \ "Xtags")
- call writefile(["thesame one", "thesame two", "thesame three"], "Xfile")
- call writefile(["thesame one"], "Xother")
+ \ "Xtags", 'D')
+ call writefile(["thesame one", "thesame two", "thesame three"], "Xfile", 'D')
+ call writefile(["thesame one"], "Xother", 'D')
edit Xother
tag thesame
tNext!
set tags&
- call delete("Xtags")
- call delete("Xfile")
- call delete("Xother")
endfunc
" Call :tabdo and choose the next available 'nowinfixbuf' window.
\ "one\tXfile\t1",
\ "three\tXfile\t3",
\ "two\tXfile\t2"],
- \ "Xtags")
- call writefile(["one", "two", "three"], "Xfile")
- call writefile(["one"], "Xother")
+ \ "Xtags", 'D')
+ call writefile(["one", "two", "three"], "Xfile", 'D')
+ call writefile(["one"], "Xother", 'D')
edit Xother
set winfixbuf
call assert_notequal(l:current, bufnr())
set tags&
- call delete("Xtags")
- call delete("Xfile")
- call delete("Xother")
endfunc
\ "one\tXfile\t1",
\ "three\tXfile\t3",
\ "two\tXfile\t2"],
- \ "Xtags")
- call writefile(["one", "two", "three"], "Xfile")
- call writefile(["one"], "Xother")
+ \ "Xtags", 'D')
+ call writefile(["one", "two", "three"], "Xfile", 'D')
+ call writefile(["one"], "Xother", 'D')
edit Xother
set winfixbuf
call assert_notequal(l:current, bufnr())
set tags&
- call delete("Xtags")
- call delete("Xfile")
- call delete("Xother")
endfunc
" Fail :tjump but :tjump! is allowed
\ "one\tXfile\t1",
\ "three\tXfile\t3",
\ "two\tXfile\t2"],
- \ "Xtags")
- call writefile(["one", "two", "three"], "Xfile")
- call writefile(["one"], "Xother")
+ \ "Xtags", 'D')
+ call writefile(["one", "two", "three"], "Xfile", 'D')
+ call writefile(["one"], "Xother", 'D')
edit Xother
set winfixbuf
call assert_notequal(l:current, bufnr())
set tags&
- call delete("Xtags")
- call delete("Xfile")
- call delete("Xother")
endfunc
" Fail :tlast but :tlast! is allowed
\ "one\tXfile\t1",
\ "three\tXfile\t3",
\ "two\tXfile\t2"],
- \ "Xtags")
- call writefile(["one", "two", "three"], "Xfile")
+ \ "Xtags", 'D')
+ call writefile(["one", "two", "three"], "Xfile", 'D')
edit Xfile
tjump one
edit Xfile
call assert_equal(l:current, bufnr())
set tags&
- call delete("Xtags")
- call delete("Xfile")
endfunc
" Fail :tnext but :tnext! is allowed
\ "thesame\tXfile\t2;\"\td\tfile:",
\ "thesame\tXfile\t3;\"\td\tfile:",
\ ],
- \ "Xtags")
- call writefile(["thesame one", "thesame two", "thesame three"], "Xfile")
- call writefile(["thesame one"], "Xother")
+ \ "Xtags", 'D')
+ call writefile(["thesame one", "thesame two", "thesame three"], "Xfile", 'D')
+ call writefile(["thesame one"], "Xother", 'D')
edit Xother
tag thesame
call assert_notequal(l:current, bufnr())
set tags&
- call delete("Xtags")
- call delete("Xfile")
- call delete("Xother")
endfunc
" Fail :tprevious but :tprevious! is allowed
\ "thesame\tXfile\t2;\"\td\tfile:",
\ "thesame\tXfile\t3;\"\td\tfile:",
\ ],
- \ "Xtags")
- call writefile(["thesame one", "thesame two", "thesame three"], "Xfile")
- call writefile(["thesame one"], "Xother")
+ \ "Xtags", 'D')
+ call writefile(["thesame one", "thesame two", "thesame three"], "Xfile", 'D')
+ call writefile(["thesame one"], "Xother", 'D')
edit Xother
tag thesame
tprevious!
set tags&
- call delete("Xtags")
- call delete("Xfile")
- call delete("Xother")
endfunc
" Fail :view but :view! is allowed
END
call writefile(lines, 'Xwfb_exitfree', 'D')
call assert_notmatch('E1513:',
- \ system(GetVimCommandClean() .. ' -X -S Xwfb_exitfree'))
+ \ system(GetVimCommandClean() .. ' --not-a-term -X -S Xwfb_exitfree'))
endfunc
" vim: shiftwidth=2 sts=2 expandtab