aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interface-gtk/interface.c
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2023-04-23 02:15:53 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2023-04-27 01:51:51 +0300
commit417ee008981c9aabc04fb574c63f3d90e232986c (patch)
treeae3d8da10e0f04f61226115b3f66a52e9c5d164c /src/interface-gtk/interface.c
parent4c79d26a15385af046a18b05b7068e5878faf93c (diff)
downloadsciteco-417ee008981c9aabc04fb574c63f3d90e232986c.tar.gz
Gtk: fixed scrolling in the command line widget
* The caret wasn't always kept out of the UZ and at some point would totally leave the view. This was apparently cause by executing two SCI_SCROLLCARETs per teco_interface_cmdline_update(). * Instead, we now use a CARET_EVEN scroll policy which also works sufficiently well.
Diffstat (limited to 'src/interface-gtk/interface.c')
-rw-r--r--src/interface-gtk/interface.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/interface-gtk/interface.c b/src/interface-gtk/interface.c
index 8ccfd30..d22009b 100644
--- a/src/interface-gtk/interface.c
+++ b/src/interface-gtk/interface.c
@@ -603,7 +603,6 @@ teco_interface_cmdline_update(const teco_cmdline_t *cmdline)
* NOTE: teco_view_ssm() already locks the GDK lock.
*/
teco_view_ssm(teco_interface.cmdline_view, SCI_CLEARALL, 0, 0);
- teco_view_ssm(teco_interface.cmdline_view, SCI_SCROLLCARET, 0, 0);
/* format effective command line */
for (guint i = 0; i < cmdline->effective_len; i++)
@@ -1138,17 +1137,13 @@ 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,
GdkRectangle *allocation, gpointer user_data)
{
- teco_view_ssm(teco_interface.cmdline_view,
- SCI_SETXCARETPOLICY, CARET_SLOP, allocation->width/2);
+ teco_view_ssm(teco_interface.cmdline_view, SCI_SETXCARETPOLICY,
+ CARET_SLOP | CARET_EVEN, allocation->width/2);
}
static gboolean