mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 17:36:29 +00:00
fix(marks): handle switching buffer properly (#25763)
This commit is contained in:
@@ -3379,6 +3379,7 @@ static linenr_T get_address(exarg_T *eap, char **ptr, cmd_addr_T addr_type, int
|
||||
fmark_T *fm = mark_get(curbuf, curwin, NULL, flag, *cmd);
|
||||
cmd++;
|
||||
if (fm != NULL && fm->fnum != curbuf->handle) {
|
||||
(void)mark_move_to(fm, 0);
|
||||
// Jumped to another file.
|
||||
lnum = curwin->w_cursor.lnum;
|
||||
} else {
|
||||
|
@@ -520,7 +520,7 @@ static MarkMoveRes switch_to_mark_buf(fmark_T *fm, bool pcmark_on_switch)
|
||||
if (fm->fnum != curbuf->b_fnum) {
|
||||
// Switch to another file.
|
||||
int getfile_flag = pcmark_on_switch ? GETF_SETMARK : 0;
|
||||
bool res = buflist_getfile(fm->fnum, (linenr_T)1, getfile_flag, false) == OK;
|
||||
bool res = buflist_getfile(fm->fnum, fm->mark.lnum, getfile_flag, false) == OK;
|
||||
return res == true ? kMarkSwitchedBuf : kMarkMoveFailed;
|
||||
}
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user