aboutsummaryrefslogtreecommitdiff
path: root/modules/lua
diff options
context:
space:
mode:
authormitchell <70453897+orbitalquark@users.noreply.github.com>2020-09-19 14:53:20 -0400
committermitchell <70453897+orbitalquark@users.noreply.github.com>2020-09-19 14:53:20 -0400
commit14e524cf217250388d374433cf6f3241f66e4e01 (patch)
treebaa0c6f3c45cbd1946403a9762cadcffdb530ef7 /modules/lua
parent28a73bcf0fe6fa9cd97e50734fb243c625284a89 (diff)
downloadtextadept-14e524cf217250388d374433cf6f3241f66e4e01.tar.gz
textadept-14e524cf217250388d374433cf6f3241f66e4e01.zip
Added `events.FILE_{BEFORE,AFTER}_RELOAD` and save/restore bookmarks.
Also moved buffer state save/restore into ui module.
Diffstat (limited to 'modules/lua')
-rw-r--r--modules/lua/ta_api4
-rw-r--r--modules/lua/ta_tags2
2 files changed, 5 insertions, 1 deletions
diff --git a/modules/lua/ta_api b/modules/lua/ta_api
index 6a7faa4e..315fe204 100644
--- a/modules/lua/ta_api
+++ b/modules/lua/ta_api
@@ -61,7 +61,9 @@ EOL_CRLF buffer.EOL_CRLF (number, Read-only)\n
EOL_LF buffer.EOL_LF (number, Read-only)\n
ERROR events.ERROR (string)\nEmitted when an error occurs.\nArguments:\n\n* _`text`_: The error message text.
ERROR lexer.ERROR (string)\nThe token name for error tokens.
+FILE_AFTER_RELOAD events.FILE_AFTER_RELOAD (string)\nEmitted after reloading the current file.\nEmitted by `buffer:reload()`.
FILE_AFTER_SAVE events.FILE_AFTER_SAVE (string)\nEmitted right after saving a file to disk.\nEmitted by `buffer:save()` and `buffer:save_as()`.\nArguments:\n\n* _`filename`_: The filename of the file being saved.\n* _`saved_as`_: Whether or not the file was saved under a different\n filename.
+FILE_BEFORE_RELOAD events.FILE_BEFORE_RELOAD (string)\nEmitted before reloading the current file.\nEmitted by `buffer:reload()`.
FILE_BEFORE_SAVE events.FILE_BEFORE_SAVE (string)\nEmitted right before saving a file to disk.\nEmitted by `buffer:save()`.\nArguments:\n\n* _`filename`_: The filename of the file being saved.
FILE_CHANGED events.FILE_CHANGED (string)\nEmitted when Textadept detects that an open file was modified externally.\nWhen connecting to this event, connect with an index of 1 in order to\noverride the default prompt to reload the file.\nArguments:\n\n* _`filename`_: The filename externally modified.
FILE_OPENED events.FILE_OPENED (string)\nEmitted after opening a file in a new buffer.\nEmitted by `io.open_file()`.\nArguments:\n\n* _`filename`_: The opened file's filename.
@@ -779,7 +781,7 @@ regex_label_text ui.find.regex_label_text (string, Write-only)\nThe text of the
register args.register(short, long, narg, f, description)\nRegisters a command line switch with short and long versions *short* and\n*long*, respectively. *narg* is the number of arguments the switch accepts,\n*f* is the function called when the switch is tripped, and *description* is\nthe switch's description when displaying help.\n@param short The string short version of the switch.\n@param long The string long version of the switch.\n@param narg The number of expected parameters for the switch.\n@param f The Lua function to run when the switch is tripped. It is passed\n *narg* string arguments.\n@param description The string description of the switch for command line\n help.
register_image view.register_image(view, type, xpm_data)\nRegisters XPM image *xpm_data* to type number *type* for use in\nautocompletion and user lists.\n@param view A view.\n@param type Integer type to register the image with.\n@param xpm_data The XPM data as described in `view.marker_define_pixmap()`.
register_rgba_image view.register_rgba_image(view, type, pixels)\nRegisters RGBA image *pixels* to type number *type* for use in autocompletion\nand user lists.\nThe dimensions for *pixels* (`view.rgba_image_width` and\n`view.rgba_image_height`) must have already been defined. *pixels* is a\nsequence of 4 byte pixel values (red, blue, green, and alpha) defining the\nimage line by line starting at the top-left pixel.\n@param view A view.\n@param type Integer type to register the image with.\n@param pixels The RGBA data as described in\n `view.marker_define_rgba_image()`.
-reload buffer.reload(buffer)\nReloads the buffer's file contents, discarding any changes.\n@param buffer A buffer.
+reload buffer.reload(buffer)\nReloads the buffer's file contents, discarding any changes.\nEmits `FILE_BEFORE_RELOAD` and `FILE_AFTER_RELOAD` events if the buffer is\nthe current one.\n@param buffer A buffer.
replace ui.find.replace()\nMimics pressing the "Replace" button.
replace_all ui.find.replace_all()\nMimics pressing the "Replace All" button.
replace_all_button_text ui.find.replace_all_button_text (string, Write-only)\nThe text of the "Replace All" button.\nThis is primarily used for localization.
diff --git a/modules/lua/ta_tags b/modules/lua/ta_tags
index ecda2683..feb359d0 100644
--- a/modules/lua/ta_tags
+++ b/modules/lua/ta_tags
@@ -61,7 +61,9 @@ EOL_CRLF _HOME/core/.buffer.luadoc /^module('buffer')$/;" F class:buffer
EOL_LF _HOME/core/.buffer.luadoc /^module('buffer')$/;" F class:buffer
ERROR _HOME/core/events.lua /^module('events')]]$/;" F class:events
ERROR _HOME/lexers/lexer.lua /^module('lexer')]=]$/;" F class:lexer
+FILE_AFTER_RELOAD _HOME/core/file_io.lua /^module('io')]]$/;" F class:events
FILE_AFTER_SAVE _HOME/core/file_io.lua /^module('io')]]$/;" F class:events
+FILE_BEFORE_RELOAD _HOME/core/file_io.lua /^module('io')]]$/;" F class:events
FILE_BEFORE_SAVE _HOME/core/file_io.lua /^module('io')]]$/;" F class:events
FILE_CHANGED _HOME/core/file_io.lua /^module('io')]]$/;" F class:events
FILE_OPENED _HOME/core/file_io.lua /^module('io')]]$/;" F class:events