aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/help.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/help.c')
-rw-r--r--src/help.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/help.c b/src/help.c
index 0f88646..07acb86 100644
--- a/src/help.c
+++ b/src/help.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012-2024 Robin Haberkorn
+ * Copyright (C) 2012-2025 Robin Haberkorn
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -289,13 +289,13 @@ teco_state_help_done(teco_machine_main_t *ctx, const teco_string_t *str, GError
return NULL;
}
- teco_ring_undo_edit();
/*
* ED hooks with the default lexer framework
* will usually load the styling SciTECO script
* when editing the buffer for the first time.
*/
- if (!teco_ring_edit(topic->filename, error))
+ if (!teco_current_doc_undo_edit(error) ||
+ !teco_ring_edit(topic->filename, error))
return NULL;
/*
@@ -314,7 +314,10 @@ teco_state_help_done(teco_machine_main_t *ctx, const teco_string_t *str, GError
}
/* in cmdline.c */
-gboolean teco_state_help_process_edit_cmd(teco_machine_main_t *ctx, teco_machine_t *parent_ctx, gunichar chr, GError **error);
+gboolean teco_state_help_process_edit_cmd(teco_machine_main_t *ctx, teco_machine_t *parent_ctx,
+ gunichar chr, GError **error);
+gboolean teco_state_help_insert_completion(teco_machine_main_t *ctx, const teco_string_t *str,
+ GError **error);
/*$ "?" help
* ?[topic]$ -- Get help for topic
@@ -384,5 +387,6 @@ gboolean teco_state_help_process_edit_cmd(teco_machine_main_t *ctx, teco_machine
TECO_DEFINE_STATE_EXPECTSTRING(teco_state_help,
.initial_cb = (teco_state_initial_cb_t)teco_state_help_initial,
.process_edit_cmd_cb = (teco_state_process_edit_cmd_cb_t)teco_state_help_process_edit_cmd,
+ .insert_completion_cb = (teco_state_insert_completion_cb_t)teco_state_help_insert_completion,
.expectstring.string_building = FALSE
);