summaryrefslogtreecommitdiff
path: root/find.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-08-06 22:48:10 -0400
committerpommicket <pommicket@gmail.com>2023-08-06 22:48:10 -0400
commit81354f84a463ef782f53358a3a3f9b359ece9a64 (patch)
treef60ab47ac87d2f7195f19aefef1fa03d69e71e1d /find.c
parent419d5b17f27b8d3dda1e59c6193f1ad9c3d218f8 (diff)
rework edit notify
Diffstat (limited to 'find.c')
-rw-r--r--find.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/find.c b/find.c
index de5ec15..046cef1 100644
--- a/find.c
+++ b/find.c
@@ -25,6 +25,23 @@ TextBuffer *find_search_buffer(Ted *ted) {
return ted->prev_active_buffer;
}
+static void find_edit_notify(void *context, TextBuffer *buffer, const EditInfo *info) {
+ (void)context;
+ Ted *ted = buffer->ted;
+ if (!ted->find) {
+ return;
+ }
+ if (buffer != find_search_buffer(ted))
+ return;
+
+ // TODO: update find result locations
+// printf("%s %u\n",buffer_get_path(buffer),info->newlines_inserted);
+}
+
+void find_init(Ted *ted) {
+ ted_add_edit_notify(ted, find_edit_notify, NULL);
+}
+
static void ted_error_from_pcre2_error(Ted *ted, int err) {
char32_t buf[256] = {0};