diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2021-10-11 08:51:02 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2021-10-11 08:51:02 +0300 |
commit | 8ef010da59743fcc4927c790f585ba414ec7b129 (patch) | |
tree | 88b31b9017abc34d0f94209a997413a22788ef95 /src/interface-curses | |
parent | 8baa1b3ebe163de3a55696e50d49f160529473b3 (diff) | |
download | sciteco-8ef010da59743fcc4927c790f585ba414ec7b129.tar.gz |
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.
Diffstat (limited to 'src/interface-curses')
-rw-r--r-- | src/interface-curses/interface.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/interface-curses/interface.c b/src/interface-curses/interface.c index 825a312..6e6e890 100644 --- a/src/interface-curses/interface.c +++ b/src/interface-curses/interface.c @@ -1582,6 +1582,16 @@ teco_interface_event_loop_iter(void) } /* + * We avoid Scintilla messages that scroll the caret during macro + * execution since it has been benchmarked to be very a very costly operation. + * Instead we do it only once after every keypress. + * + * FIXME: This could be in teco_cmdline_keypress() since it is common among + * all interface implementations. + */ + teco_interface_ssm(SCI_SCROLLCARET, 0, 0); + + /* * Info window is updated very often which is very * costly, especially when using PDC_set_title(), * so we redraw it here, where the overhead does |