aboutsummaryrefslogtreecommitdiff
path: root/terminal.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2024-06-25 08:26:07 +0000
committerDaniel Eklöf <daniel@ekloef.se>2024-06-26 16:39:24 +0000
commit45f4eb48fb6b4b651df6b466936dd425d9647400 (patch)
tree44d8a61b93cfbb81fd6dca2a5acf26bb17b233b0 /terminal.h
parentgrid: grid_row_{uri,curly}_range_put(): share code (diff)
grid: refactor: remove union range_data_for_insertion
This union is identical to row_range_data, except the URI char pointer is const. Let's ignore that, and re-use row_range_data, casting the URI pointer when necessary. Also remove uri_range_insert() and curly_range_insert(), and use the generic version of range_insert() everywhere.
Diffstat (limited to 'terminal.h')
-rw-r--r--terminal.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/terminal.h b/terminal.h
index 9fdd3dc0..21eb7cee 100644
--- a/terminal.h
+++ b/terminal.h
@@ -129,8 +129,14 @@ struct row_range {
int end;
union {
- struct uri_range_data uri;
- struct curly_range_data curly;
+ /* This is just an expanded union row_range_data, but
+ * anonymous, so that we don't have to write range->u.uri.id,
+ * but can instead do range->uri.id */
+ union {
+ struct uri_range_data uri;
+ struct curly_range_data curly;
+ };
+ union row_range_data data;
};
};