vim-patch:8.2.0861: cannot easily get all the current marks (#13676)

Problem:    Cannot easily get all the current marks.
Solution:   Add getmarklist(). (Yegappan Lakshmanan, closes #6032)
cfb4b47de0

Cherry-pick the column number fix from patch v8.2.0871
because patch v8.2.0871 cannot be fully ported
without the method patches.

Co-authored-by: Peter Wolf <pwolf2310@gmail.com>
This commit is contained in:
Jan Edmund Lazo
2021-01-03 15:33:21 -05:00
committed by GitHub
parent fff4facdc4
commit a1ed941a78
6 changed files with 149 additions and 0 deletions

View File

@@ -3483,6 +3483,25 @@ static void f_getloclist(typval_T *argvars, typval_T *rettv, FunPtr fptr)
get_qf_loc_list(false, wp, &argvars[1], rettv);
}
/// "getmarklist()" function
static void f_getmarklist(typval_T *argvars, typval_T *rettv, FunPtr fptr)
{
tv_list_alloc_ret(rettv, kListLenMayKnow);
if (argvars[0].v_type == VAR_UNKNOWN) {
get_global_marks(rettv->vval.v_list);
return;
}
buf_T *buf = tv_get_buf(&argvars[0], false);
if (buf == NULL) {
return;
}
get_buf_local_marks(buf, rettv->vval.v_list);
}
/*
* "getmatches()" function
*/