aboutsummaryrefslogtreecommitdiff
path: root/src/textadept.c
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2018-02-21 13:37:14 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2018-02-21 13:37:14 -0500
commiteba612bd6dd8f53b05163af1d06554df4e0bdc9f (patch)
tree5a0070f98519747bfd61ea05e285ae1c71ac7aa1 /src/textadept.c
parent672a74b9d43ae072baa585d7f63b4cad990ed62a (diff)
downloadtextadept-eba612bd6dd8f53b05163af1d06554df4e0bdc9f.tar.gz
textadept-eba612bd6dd8f53b05163af1d06554df4e0bdc9f.zip
The terminal version can immediately focus a clicked view.
This allows for immediate scrolling, selections, etc. in non-focused views. This behavior mimics the GUI version.
Diffstat (limited to 'src/textadept.c')
-rw-r--r--src/textadept.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/textadept.c b/src/textadept.c
index 27df7144..2f3bfa73 100644
--- a/src/textadept.c
+++ b/src/textadept.c
@@ -2602,10 +2602,12 @@ int main(int argc, char **argv) {
LUA_TBOOLEAN, ctrl, LUA_TBOOLEAN, alt, -1))
scintilla_send_key(view, ch, shift, ctrl, alt);
else if (!ch && !scintilla_send_mouse(view, event, millis, button, y, x,
- shift, ctrl, alt))
- lL_event(lua, "mouse", LUA_TNUMBER, event, LUA_TNUMBER, button,
- LUA_TNUMBER, y, LUA_TNUMBER, x, LUA_TBOOLEAN, shift,
- LUA_TBOOLEAN, ctrl, LUA_TBOOLEAN, alt, -1);
+ shift, ctrl, alt) &&
+ !lL_event(lua, "mouse", LUA_TNUMBER, event, LUA_TNUMBER, button,
+ LUA_TNUMBER, y, LUA_TNUMBER, x, LUA_TBOOLEAN, shift,
+ LUA_TBOOLEAN, ctrl, LUA_TBOOLEAN, alt, -1))
+ scintilla_send_mouse(focused_view, event, millis, button, y, x, shift,
+ ctrl, alt); // try again with possibly another view
if (quit && !lL_event(lua, "quit", -1)) {
l_close(lua);
// Free some memory.