mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 01:46:29 +00:00
refactor(extmarks): remove unused new pos from ExtmarkSavePos
This commit is contained in:
@@ -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
|
// Push mark to undo header
|
||||||
if (only_copy || (uvp != NULL && op == kExtmarkUndo && !mt_no_undo(mark))) {
|
if (only_copy || (uvp != NULL && op == kExtmarkUndo && !mt_no_undo(mark))) {
|
||||||
ExtmarkSavePos pos;
|
ExtmarkSavePos pos = {
|
||||||
pos.mark = mt_lookup_key(mark);
|
.mark = mt_lookup_key(mark),
|
||||||
pos.invalidated = invalidated;
|
.invalidated = invalidated,
|
||||||
pos.old_row = mark.pos.row;
|
.old_row = mark.pos.row,
|
||||||
pos.old_col = mark.pos.col;
|
.old_col = mark.pos.col
|
||||||
pos.row = -1;
|
};
|
||||||
pos.col = -1;
|
|
||||||
|
|
||||||
undo.data.savepos = pos;
|
undo.data.savepos = pos;
|
||||||
undo.type = kExtmarkSavePos;
|
undo.type = kExtmarkSavePos;
|
||||||
kv_push(*uvp, undo);
|
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);
|
MTPos end = marktree_get_altpos(curbuf->b_marktree, mark, itr);
|
||||||
buf_put_decor(curbuf, mt_decor(mark), mark.pos.row, end.row);
|
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) {
|
} else if (undo_info.type == kExtmarkMove) {
|
||||||
ExtmarkMove move = undo_info.data.move;
|
ExtmarkMove move = undo_info.data.move;
|
||||||
if (undo) {
|
if (undo) {
|
||||||
|
@@ -45,8 +45,6 @@ typedef struct {
|
|||||||
uint64_t mark; // raw mark id of the marktree
|
uint64_t mark; // raw mark id of the marktree
|
||||||
int old_row;
|
int old_row;
|
||||||
colnr_T old_col;
|
colnr_T old_col;
|
||||||
int row;
|
|
||||||
colnr_T col;
|
|
||||||
bool invalidated;
|
bool invalidated;
|
||||||
} ExtmarkSavePos;
|
} ExtmarkSavePos;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user