fix(mark): fix unexpected cursor movements (#19253)

This commit is contained in:
zeertzjq
2022-07-06 19:01:44 +08:00
committed by GitHub
parent c68f1d7263
commit 9ced054134
3 changed files with 32 additions and 18 deletions

View File

@@ -4345,13 +4345,12 @@ static linenr_T get_address(exarg_T *eap, char **ptr, cmd_addr_T addr_type, int
// used by itself: ":'M".
MarkGet flag = to_other_file && cmd[1] == NUL ? kMarkAll : kMarkBufLocal;
fmark_T *fm = mark_get(curbuf, curwin, NULL, flag, *cmd);
MarkMoveRes move_res = mark_move_to(fm, kMarkBeginLine);
cmd++;
// Switched buffer
if (move_res & kMarkSwitchedBuf) {
if (fm != NULL && fm->fnum != curbuf->handle) {
// Jumped to another file.
lnum = curwin->w_cursor.lnum;
} else {
if (fm == NULL) {
if (!mark_check(fm)) {
cmd = NULL;
goto error;
}