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.
This commit is contained in:
ZyX 2018-03-26 00:45:38 +03:00
parent 7941aaa3bf
commit 30e7fb2e32

View File

@ -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 = {