aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/events.lua5
-rw-r--r--core/file_io.lua1
2 files changed, 5 insertions, 1 deletions
diff --git a/core/events.lua b/core/events.lua
index f4f520c5..a79be38b 100644
--- a/core/events.lua
+++ b/core/events.lua
@@ -118,6 +118,9 @@ local M = {}
--
-- * _`text`_: The text to search for.
-- * _`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.
-- @field HOTSPOT_CLICK (string)
-- Emitted when clicking on text that is in a style that has the hotspot
-- attribute set.
@@ -376,7 +379,7 @@ for _, n in pairs(scnotifications) do M[n[1]:upper()] = n[1] end
local ta_events = {
'appleevent_odoc', 'buffer_after_switch', 'buffer_before_switch',
'buffer_deleted', 'buffer_new', 'command_entry_command',
- 'command_entry_keypress', 'error', 'find', 'initialized', 'keypress',
+ 'command_entry_keypress', 'error', 'find', 'focus', 'initialized', 'keypress',
'menu_clicked', 'quit', 'replace', 'replace_all', 'reset_after',
'reset_before', 'view_after_switch', 'view_before_switch', 'view_new'
}
diff --git a/core/file_io.lua b/core/file_io.lua
index 7ddfee00..eb91ed2a 100644
--- a/core/file_io.lua
+++ b/core/file_io.lua
@@ -305,6 +305,7 @@ local function update_modified_file()
end
events_connect(events.BUFFER_AFTER_SWITCH, update_modified_file)
events_connect(events.VIEW_AFTER_SWITCH, update_modified_file)
+events_connect(events.FOCUS, update_modified_file)
-- Prompts the user to reload the current file if it has been externally
-- modified.