fix(mark): properly init mark views (#22996)

This commit is contained in:
zeertzjq
2023-04-10 22:49:32 +08:00
committed by GitHub
parent bd98ef6ac6
commit 0451391ec5
4 changed files with 48 additions and 2 deletions

View File

@@ -84,7 +84,7 @@ void clear_fmark(fmark_T *fm)
FUNC_ATTR_NONNULL_ALL
{
free_fmark(*fm);
CLEAR_POINTER(fm);
*fm = (fmark_T)INIT_FMARK;
}
// Set named mark "c" to position "pos".

View File

@@ -36,7 +36,7 @@
/// Clear given fmark
#define CLEAR_FMARK(fmarkp_) \
RESET_FMARK(fmarkp_, ((pos_T) { 0, 0, 0 }), 0, ((fmarkv_T) { 0 }))
RESET_FMARK(fmarkp_, ((pos_T) { 0, 0, 0 }), 0, ((fmarkv_T)INIT_FMARKV))
/// Set given extended mark (regular mark + file name)
#define SET_XFMARK(xfmarkp_, mark_, fnum_, view_, fname_) \

View File

@@ -1307,6 +1307,7 @@ static void shada_read(ShaDaReadDef *const sd_reader, const int flags)
.mark = cur_entry.data.filemark.mark,
.fnum = (buf == NULL ? 0 : buf->b_fnum),
.timestamp = cur_entry.timestamp,
.view = INIT_FMARKV,
.additional_data = cur_entry.data.filemark.additional_data,
},
};
@@ -1388,6 +1389,7 @@ static void shada_read(ShaDaReadDef *const sd_reader, const int flags)
.mark = cur_entry.data.filemark.mark,
.fnum = 0,
.timestamp = cur_entry.timestamp,
.view = INIT_FMARKV,
.additional_data = cur_entry.data.filemark.additional_data,
};
if (cur_entry.type == kSDItemLocalMark) {