change gravity to be a boolean flag, and add corresponding flag for end position of extmark

This commit is contained in:
chentau
2021-01-05 00:28:34 -08:00
parent 10b278bdae
commit 231f75e086
3 changed files with 34 additions and 16 deletions

View File

@@ -71,7 +71,8 @@ static ExtmarkNs *buf_ns_ref(buf_T *buf, uint64_t ns_id, bool put) {
/// @returns the mark id
uint64_t extmark_set(buf_T *buf, uint64_t ns_id, uint64_t id,
int row, colnr_T col, int end_row, colnr_T end_col,
Decoration *decor, bool right_gravity, ExtmarkOp op)
Decoration *decor, bool right_gravity,
bool end_right_gravity, ExtmarkOp op)
{
ExtmarkNs *ns = buf_ns_ref(buf, ns_id, true);
assert(ns != NULL);
@@ -110,7 +111,7 @@ uint64_t extmark_set(buf_T *buf, uint64_t ns_id, uint64_t id,
if (end_row > -1) {
mark = marktree_put_pair(buf->b_marktree,
row, col, right_gravity,
end_row, end_col, false);
end_row, end_col, end_right_gravity);
} else {
mark = marktree_put(buf->b_marktree, row, col, right_gravity);
}