[code] [textadept] Unwanted view switch events

From: Chris Emerson <c-ta.att.mail.nosreme.org>
Date: Sun, 14 Apr 2019 15:46:08 +0100


I got some time to look at the LSP support again. The current issue for
me is not directly related to LSP, though - it's interactions with

The sequence is:
* I go into insert mode to start editing the current source.
* An LSP event appears, which results in a message being added to the [LSP]
buffer, so eventually a `buffer:append_text()` on the log buffer.
* This causes Scintilla to emit an SCN_SAVEPOINTLEFT event
* Textadept, in `s_notify()`, gets to the second case:

   } else if (n->nmhdr.code == SCN_SAVEPOINTLEFT) {
      Scintilla *prev = focused_view;
      // Do not let a split view steal focus.
      goto_view(view), lL_notify(lua, n), goto_view(prev);

I'm guessing that's on purpose so that the `SAVE_POINT_LEFT` event can be
emitted with the right view set. But this causes the
VIEW_{BEFORE,AFTER}_SWITCH events to be emitted twice, causing textadept-vi
to exit insert mode, causing me confusion as I'm currently typing.

So I think what I want is to ignore (or somehow cause not to happen) the
VIEW_*_SWITCH events when it's only a temporary switch. Or maybe the 'SCN'
event should include a reference to the view instead of having to switch
twice. Also, I think the only thing which uses the SAVE_POINT_LEFT event
(at least in my configuration) is ui.lua to update the title text - which you
can't see when you're in a different view anyway. :-)

I'm not very sure about why all this is happening, so here I am asking for
suggestions on how to fix or work around this. :-)



You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Sun 14 Apr 2019 - 10:46:08 EDT

This archive was generated by hypermail 2.2.0 : Mon 15 Apr 2019 - 06:33:52 EDT