Problem: Cannot use getmarklist() as a method.
Solution: Make getmarklist() work as a method. Add one to the column
number to match getpos(). (Yegappan Lakshmanan, closes #6176)
Refer to |getpos()| for getting information about a specific
mark.
+ Can also be used as a |method|: >
+ GetBufnr()->getmarklist()
getmatches([{win}]) *getmatches()*
Returns a |List| with all matches previously defined for the
{"getjumplist", 0, 2, FEARG_1, ret_list_any, f_getjumplist},
{"getline", 1, 2, FEARG_1, ret_f_getline, f_getline},
{"getloclist", 1, 2, 0, ret_list_dict_any, f_getloclist},
- {"getmarklist", 0, 1, 0, ret_list_dict_any, f_getmarklist},
+ {"getmarklist", 0, 1, FEARG_1, ret_list_dict_any, f_getmarklist},
{"getmatches", 0, 1, 0, ret_list_dict_any, f_getmatches},
{"getmousepos", 0, 0, 0, ret_dict_number, f_getmousepos},
{"getpid", 0, 0, 0, ret_number, f_getpid},
list_append_number(lpos, bufnr);
list_append_number(lpos, pos->lnum);
- list_append_number(lpos, pos->col);
+ list_append_number(lpos, pos->col + 1);
list_append_number(lpos, pos->coladd);
if (dict_add_string(d, "mark", mname) == FAIL
mark A
call cursor(3, 5)
normal mN
- call assert_equal([{'file' : '', 'mark' : "'A", 'pos' : [bufnr(), 1, 0, 0]},
- \ {'file' : '', 'mark' : "'N", 'pos' : [bufnr(), 3, 4, 0]}],
+ call assert_equal([{'file' : '', 'mark' : "'A", 'pos' : [bufnr(), 1, 1, 0]},
+ \ {'file' : '', 'mark' : "'N", 'pos' : [bufnr(), 3, 5, 0]}],
\ getmarklist())
" buffer local marks
delmarks!
- call assert_equal([{'mark' : "''", 'pos' : [bufnr(), 1, 0, 0]},
- \ {'mark' : "'\"", 'pos' : [bufnr(), 1, 0, 0]}], getmarklist(bufnr()))
+ call assert_equal([{'mark' : "''", 'pos' : [bufnr(), 1, 1, 0]},
+ \ {'mark' : "'\"", 'pos' : [bufnr(), 1, 1, 0]}], getmarklist(bufnr()))
call cursor(2, 2)
normal mr
- call assert_equal({'mark' : "'r", 'pos' : [bufnr(), 2, 1, 0]},
- \ getmarklist(bufnr())[0])
- call assert_equal([], getmarklist({}))
+ call assert_equal({'mark' : "'r", 'pos' : [bufnr(), 2, 2, 0]},
+ \ bufnr()->getmarklist()[0])
+ call assert_equal([], {}->getmarklist())
close!
endfunc
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 871,
/**/
870,
/**/