aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2018-03-27 01:11:38 +0300
committerZyX <kp-pav@yandex.ru>2018-03-27 01:35:21 +0300
commitaa728798b4bd89b59cee86103885c15d386f73ba (patch)
tree6a152f116703bfa28959c21e3d33f364ec28da63
parent30e7fb2e32a636ba9713abc6545fab6f0ea6183c (diff)
downloadrneovim-aa728798b4bd89b59cee86103885c15d386f73ba.tar.gz
rneovim-aa728798b4bd89b59cee86103885c15d386f73ba.tar.bz2
rneovim-aa728798b4bd89b59cee86103885c15d386f73ba.zip
shada: In place of ignoring cursor position with lnum 0 save with 1
-rw-r--r--src/nvim/shada.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/shada.c b/src/nvim/shada.c
index f726f09fad..552dd2dcf4 100644
--- a/src/nvim/shada.c
+++ b/src/nvim/shada.c
@@ -2796,7 +2796,7 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer,
// Update numbered marks: '0' should be replaced with the current position,
// '9' should be removed and all other marks shifted.
- if (!ignore_buf(curbuf, &removable_bufs) && curwin->w_cursor.lnum != 0) {
+ if (!ignore_buf(curbuf, &removable_bufs)) {
replace_numbered_mark(wms, 0, (PossiblyFreedShadaEntry) {
.can_free_entry = false,
.data = {
@@ -2804,7 +2804,9 @@ static ShaDaWriteResult shada_write(ShaDaWriteDef *const sd_writer,
.timestamp = os_time(),
.data = {
.filemark = {
- .mark = curwin->w_cursor,
+ .mark = (curwin->w_cursor.lnum
+ ? curwin->w_cursor
+ : (pos_T) { 1, 0, 0 }),
.name = '0',
.additional_data = NULL,
.fname = (char *)curbuf->b_ffname,