mirror of
https://github.com/neovim/neovim.git
synced 2025-09-11 13:58:18 +00:00
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:
@@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user