mirror of
https://github.com/neovim/neovim.git
synced 2025-09-17 08:48:16 +00:00
extmark: introduce extmark_splice_cols
to ease up notations.
This commit is contained in:
@@ -578,6 +578,15 @@ void extmark_splice(buf_T *buf,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void extmark_splice_cols(buf_T *buf,
|
||||||
|
int start_row, colnr_T start_col,
|
||||||
|
colnr_T old_col, colnr_T new_col,
|
||||||
|
ExtmarkOp undo)
|
||||||
|
{
|
||||||
|
extmark_splice(buf, start_row, start_col,
|
||||||
|
0, old_col,
|
||||||
|
0, new_col, undo);
|
||||||
|
}
|
||||||
|
|
||||||
void extmark_move_region(buf_T *buf,
|
void extmark_move_region(buf_T *buf,
|
||||||
int start_row, colnr_T start_col,
|
int start_row, colnr_T start_col,
|
||||||
|
@@ -1648,9 +1648,8 @@ static void foldAddMarker(
|
|||||||
}
|
}
|
||||||
ml_replace_buf(buf, lnum, newline, false);
|
ml_replace_buf(buf, lnum, newline, false);
|
||||||
if (added) {
|
if (added) {
|
||||||
extmark_splice(buf, (int)lnum-1, (int)line_len,
|
extmark_splice_cols(buf, (int)lnum-1, (int)line_len,
|
||||||
0, 0,
|
0, (int)added, kExtmarkUndo);
|
||||||
0, (int)added, kExtmarkUndo);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1720,9 +1719,9 @@ static void foldDelMarker(buf_T *buf, linenr_T lnum, char_u *marker, size_t mark
|
|||||||
memcpy(newline, line, (size_t)(p - line));
|
memcpy(newline, line, (size_t)(p - line));
|
||||||
STRCPY(newline + (p - line), p + len);
|
STRCPY(newline + (p - line), p + len);
|
||||||
ml_replace_buf(buf, lnum, newline, false);
|
ml_replace_buf(buf, lnum, newline, false);
|
||||||
extmark_splice(buf, (int)lnum-1, (int)(p - line),
|
extmark_splice_cols(buf, (int)lnum-1, (int)(p - line),
|
||||||
0, (int)len,
|
(int)len,
|
||||||
0, 0, kExtmarkUndo);
|
0, kExtmarkUndo);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user