aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+667e-11@users.noreply.github.com>2018-02-21 13:37:14 -0500
committerGravatar mitchell <70453897+667e-11@users.noreply.github.com>2018-02-21 13:37:14 -0500
commiteba612bd6dd8f53b05163af1d06554df4e0bdc9f (patch)
tree5a0070f98519747bfd61ea05e285ae1c71ac7aa1
parent672a74b9d43ae072baa585d7f63b4cad990ed62a (diff)
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.
-rw-r--r--core/ui.lua1
-rw-r--r--src/textadept.c10
2 files changed, 7 insertions, 4 deletions
diff --git a/core/ui.lua b/core/ui.lua
index 708a6454..b725c900 100644
--- a/core/ui.lua
+++ b/core/ui.lua
@@ -476,6 +476,7 @@ if CURSES then
elseif resize then
resize(y, x)
end
+ return resize ~= nil -- false resends mouse event to current view
end)
end
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.