aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2015-01-12 18:32:20 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2015-01-12 18:32:20 -0500
commit44afcd157ce82b5492b31474b4d38a56084fee89 (patch)
treecc68fec8b855465a2dc9245c3b0985d67559a049
parente0bf08c3199dd01d575df4f0d4d7faf54c9034a4 (diff)
downloadtextadept-44afcd157ce82b5492b31474b4d38a56084fee89.tar.gz
textadept-44afcd157ce82b5492b31474b4d38a56084fee89.zip
Emit an `events.FOCUS` event after resuming from a suspended state.
-rw-r--r--core/events.lua3
-rw-r--r--src/textadept.c1
2 files changed, 3 insertions, 1 deletions
diff --git a/core/events.lua b/core/events.lua
index 5b7e92fd..144917a7 100644
--- a/core/events.lua
+++ b/core/events.lua
@@ -119,7 +119,8 @@ local M = {}
-- * _`next`_: Whether or not to search forward.
-- @field FOCUS (string)
-- Emitted when Textadept receives focus.
--- This event is never emitted when Textadept is running in the terminal.
+-- In the terminal, this event is only emitted after resuming from a suspended
+-- state.
-- @field HOTSPOT_CLICK (string)
-- Emitted when clicking on text that is in a style that has the hotspot
-- attribute set.
diff --git a/src/textadept.c b/src/textadept.c
index 3061b256..1b1dad0e 100644
--- a/src/textadept.c
+++ b/src/textadept.c
@@ -2387,6 +2387,7 @@ static void t_signal(int signal) {
resizeterm(w.ws_row, w.ws_col), pane_resize(pane, LINES - 2, COLS, 1, 0);
WINDOW *ce_win = scintilla_get_window(command_entry);
wresize(ce_win, 1, COLS), mvwin(ce_win, LINES - 1 - getmaxy(ce_win), 0);
+ if (signal == SIGCONT) lL_event(lua, "focus", -1);
lL_event(lua, "update_ui", -1);
refresh_all();
} else endwin(), termkey_stop(ta_tk), kill(0, SIGSTOP);