Re: [code] [textadept] Focus changes in GUI version

From: Mitchell <>
Date: Sun, 6 Apr 2014 15:20:36 -0400 (EDT)

Hi Chris,

On Thu, 20 Mar 2014, Chris Emerson wrote:

> In textadept-curses (7.2 beta 2), with my textredux-based command entry, when
> hitting the key which opens it (":"), subsequent keys go into the new view -
> so I can even paste in ":command" into the terminal and things happen as I
> expect. The handler for ":" does some unsplitting/splitting and selects the
> new view.
> In the Win32 GUI version same keys are lost (it seems more likely with a
> larger file loaded into the current buffer, when it takes longer to do the
> split), or possibly end up acting on the different view. So I have to wait
> for it to sort itself out, making it feel much less responsive (and annoying
> when I inadvertently modify the current buffer when expecting to be entering
> a command).
> I'll try to do some debugging if I get time, but there's not much hope in the
> near future - I only use the GUI version at work.

I won't say I had a similar issue, but I ran into an obscure bug with view
splitting. Normally, the new view in a split should match the scroll
position in the existing view. Instead, the new view would scroll to a
seemingly random position. The problem turned out to be that I was setting
the scroll position too quickly after the split -- it was happening before
GTK could paint the new view. I had to insert the following line after
splitting the view, but before setting the scroll position:

   while (gtk_events_pending()) gtk_main_iteration();

You can search for it in `src/textadept.c`. Perhaps a similar thing needs
to happen for you; evaluate the backlog of GTK events before handling your
keypress. If a patch is necessary, please send one.


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Sun 06 Apr 2014 - 15:20:36 EDT

This archive was generated by hypermail 2.2.0 : Mon 07 Apr 2014 - 06:44:53 EDT