refactor(marktree): unpaired marktree_get_alt() returns itself

Avoids checking for invalid mark at callsite.
This commit is contained in:
Luuk van Baal
2024-01-13 17:09:59 +01:00
parent e6ddceda31
commit 4f544b3119
4 changed files with 5 additions and 15 deletions

View File

@@ -151,7 +151,7 @@ static Array extmark_to_array(MTPair extmark, bool id, bool add_dict, bool hl_na
PUT(dict, "right_gravity", BOOLEAN_OBJ(mt_right(start)));
if (extmark.end_pos.row >= 0) {
if (mt_paired(start)) {
PUT(dict, "end_row", INTEGER_OBJ(extmark.end_pos.row));
PUT(dict, "end_col", INTEGER_OBJ(extmark.end_pos.col));
PUT(dict, "end_right_gravity", BOOLEAN_OBJ(extmark.end_right_gravity));