refactor(extmarks): remove unused new pos from ExtmarkSavePos

This commit is contained in:
Luuk van Baal
2024-01-18 19:54:45 +01:00
parent 2645c9d576
commit 18334a4a0c
2 changed files with 7 additions and 15 deletions

View File

@@ -356,14 +356,12 @@ void extmark_splice_delete(buf_T *buf, int l_row, colnr_T l_col, int u_row, coln
// Push mark to undo header
if (only_copy || (uvp != NULL && op == kExtmarkUndo && !mt_no_undo(mark))) {
ExtmarkSavePos pos;
pos.mark = mt_lookup_key(mark);
pos.invalidated = invalidated;
pos.old_row = mark.pos.row;
pos.old_col = mark.pos.col;
pos.row = -1;
pos.col = -1;
ExtmarkSavePos pos = {
.mark = mt_lookup_key(mark),
.invalidated = invalidated,
.old_row = mark.pos.row,
.old_col = mark.pos.col
};
undo.data.savepos = pos;
undo.type = kExtmarkSavePos;
kv_push(*uvp, undo);
@@ -406,12 +404,8 @@ void extmark_apply_undo(ExtmarkUndoObject undo_info, bool undo)
MTPos end = marktree_get_altpos(curbuf->b_marktree, mark, itr);
buf_put_decor(curbuf, mt_decor(mark), mark.pos.row, end.row);
}
// Redo
} else {
if (pos.row >= 0) {
extmark_setraw(curbuf, pos.mark, pos.row, pos.col);
}
}
// No Redo since kExtmarkSplice will move marks back
} else if (undo_info.type == kExtmarkMove) {
ExtmarkMove move = undo_info.data.move;
if (undo) {