From 30e7fb2e32a636ba9713abc6545fab6f0ea6183c Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 26 Mar 2018 00:45:38 +0300 Subject: shada: Also filter out invalid cursor position when writing '0' mark Based on https://github.com/neovim/neovim/pull/5908#issuecomment-375909903, but with adjusted condition as line number or column less then zero should not appear at all based on what I know. --- src/nvim/shada.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/shada.c b/src/nvim/shada.c index fbee9beacc..f726f09fad 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)) { + if (!ignore_buf(curbuf, &removable_bufs) && curwin->w_cursor.lnum != 0) { replace_numbered_mark(wms, 0, (PossiblyFreedShadaEntry) { .can_free_entry = false, .data = { -- cgit