aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interface-gtk
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2021-12-22 20:41:31 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2021-12-22 20:52:28 +0100
commit3706112c6bff358f1467afced9ff29d8a3246eb2 (patch)
tree1c4b9f751534caf251f39f5cfe6318ed148f1c06 /src/interface-gtk
parent3614e5877818a3f3e187b43f8247cabaf842c39f (diff)
downloadsciteco-3706112c6bff358f1467afced9ff29d8a3246eb2.tar.gz
Curses: added teco_interface_is_interrupted() fallback and standardized how to detect interactive/batch mode
* Adds support for CTRL+C interruptions on Curses variants like PDCurses/GUI and XCurses. This also affects the current Win32 nightly builds which should now support CTRL+C interruptions. * The fallback is of course less efficient than the existing platform optimizations (existing for UNIX and Win32 console builds) and slows down parsing in interactive mode. * Use teco_interface.cmdline_window consistently to detect interactive mode. This may theoretically speed up SciTECO code execution slightly on shutdown.
Diffstat (limited to 'src/interface-gtk')
-rw-r--r--src/interface-gtk/interface.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/interface-gtk/interface.c b/src/interface-gtk/interface.c
index 104bb89..c32d2e3 100644
--- a/src/interface-gtk/interface.c
+++ b/src/interface-gtk/interface.c
@@ -713,6 +713,12 @@ teco_interface_popup_clear(void)
* system call overhead.
* But the GDK lock that would be necessary for synchronization
* has been deprecated.
+ *
+ * @todo It would be great to have platform-specific optimizations,
+ * so we can detect interruptions without having to drive the Glib
+ * event loop (e.g. using libX11 or Win32 APIs).
+ * On the downside, such solutions will probably freeze the window
+ * while SciTECO is busy.
*/
gboolean
teco_interface_is_interrupted(void)
@@ -1095,6 +1101,10 @@ teco_interface_cleanup(void)
* Called when the commandline widget is resized.
* This should ensure that the caret jumps to the middle of the command line,
* imitating the behaviour of the current Curses command line.
+ *
+ * @bug This no longer works when the command-line gets very long
+ * and the caret will eventually be stuck at the right edge.
+ * There seems to be an internal limit.
*/
static void
teco_interface_cmdline_size_allocate_cb(GtkWidget *widget,