in the current file (an indent is removed and a long line is truncated to fit
in the window).
+The marker ">" indicates the current position in the jumplist. It may not be
+shown when filtering the |:jump| command using |:filter|
+
You are currently in line 1167. If you then use the CTRL-O command, the
cursor is put in line 1154. This results in:
{
name = fm_getname(&curwin->w_jumplist[i].fmark, 16);
+ // Make sure to output the current indicator, even when on an wiped
+ // out buffer. ":filter" may still skip it.
+ if (name == NULL && i == curwin->w_jumplistidx)
+ name = vim_strsave((char_u *)"-invalid-");
// apply :filter /pat/ or file name not available
if (name == NULL || message_filtered(name))
{
call delete("Xtest")
endfunc
+func Test_jumplist_invalid()
+ new
+ clearjumps
+ " put some randome text
+ put ='a'
+ let prev = bufnr('%')
+ setl nomodified bufhidden=wipe
+ e XXJumpListBuffer
+ let bnr = bufnr('%')
+ " 1) empty jumplist
+ let expected = [[
+ \ {'lnum': 2, 'bufnr': prev, 'col': 0, 'coladd': 0}], 1]
+ call assert_equal(expected, getjumplist())
+ let jumps = execute(':jumps')
+ call assert_equal('>', jumps[-1:])
+ " now jump back
+ exe ":norm! \<c-o>"
+ let expected = [[
+ \ {'lnum': 2, 'bufnr': prev, 'col': 0, 'coladd': 0},
+ \ {'lnum': 1, 'bufnr': bnr, 'col': 0, 'coladd': 0}], 0]
+ call assert_equal(expected, getjumplist())
+ let jumps = execute(':jumps')
+ call assert_match('> 0 2 0 -invalid-', jumps)
+endfunc
+
+" Test for '' mark in an empty buffer
+
+func Test_empty_buffer()
+ new
+ insert
+a
+b
+c
+d
+.
+ call assert_equal(1, line("''"))
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
+++ /dev/null
-" Test for '' mark in an empty buffer
-
-func Test_empty_buffer()
- new
- insert
-a
-b
-c
-d
-.
- call assert_equal(1, line("''"))
- bwipe!
-endfunc
-
-" vim: shiftwidth=2 sts=2 expandtab