From 8ef010da59743fcc4927c790f585ba414ec7b129 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Mon, 11 Oct 2021 08:51:02 +0300 Subject: optimized caret scrolling: this is a costly operation and is now done only once per keypress * Esp. costly since Scintilla 5. * We now avoid any Scintilla message that automatically scrolls the caret (makes the caret visible) and instead call SCI_SCROLLCARET only once after every keypress in the interface implementation. * From nowon, use * SCI_SETEMPTYSELECTION instead of SCI_GOTOPOS * SCI_SETEMPTYSELECTION(SCI_POSITIONFROMLINE(...)) instead of SCI_GOTOLINE * SCI_SETSELECTIONSTART and SCI_SETSELECTIONEND instead of SCI_SETSEL * With these optimizations we are significantly faster than before the Scintilla upgrade (6e67f5a682ff46d69888fec61b94bf45cec46721). It is now even safe to execute the Gtk test suite during CI. --- src/qreg-commands.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/qreg-commands.c') diff --git a/src/qreg-commands.c b/src/qreg-commands.c index 35508d7..b505b33 100644 --- a/src/qreg-commands.c +++ b/src/qreg-commands.c @@ -487,7 +487,6 @@ teco_state_getqregstring_got_register(teco_machine_main_t *ctx, teco_qreg_t *qre if (str.len > 0) { teco_interface_ssm(SCI_BEGINUNDOACTION, 0, 0); teco_interface_ssm(SCI_ADDTEXT, str.len, (sptr_t)str.data); - teco_interface_ssm(SCI_SCROLLCARET, 0, 0); teco_interface_ssm(SCI_ENDUNDOACTION, 0, 0); teco_ring_dirtify(); -- cgit v1.2.3