diff options
author | mitchell <70453897+orbitalquark@users.noreply.github.com> | 2021-04-30 18:40:06 -0400 |
---|---|---|
committer | mitchell <70453897+orbitalquark@users.noreply.github.com> | 2021-04-30 18:40:06 -0400 |
commit | 715901363a02634f5336c0d3f18cbd9a9c080b4a (patch) | |
tree | 315146ace595595cefe4e6b4eae01c475a21a85b /docs/api.md | |
parent | a775e9fb4188f2638111c15623ea9bd5c804b3e2 (diff) |
Replaced `events.FILE_{BEFORE,AFTER}_RELOAD` with `events.BUFFER_{BEFORE,AFTER}_REPLACE_TEXT`.
This allows more features to save/restore state when buffer contents are replaced (e.g. file
reload, filter through, etc.)
Diffstat (limited to 'docs/api.md')
-rw-r--r-- | docs/api.md | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/docs/api.md b/docs/api.md index 61d61dbe..c73bdf7a 100644 --- a/docs/api.md +++ b/docs/api.md @@ -2933,7 +2933,6 @@ Parameters: #### `buffer.reload`(*buffer*) Reloads the buffer's file contents, discarding any changes. -Emits `FILE_BEFORE_RELOAD` and `FILE_AFTER_RELOAD` events if the buffer is the current one. Parameters: @@ -3711,6 +3710,14 @@ Emitted as items are highlighted in an autocompletion or user list. * _`text`_: The current selection's text. * _`position`_: The position the list was displayed at. +<a id="events.BUFFER_AFTER_REPLACE_TEXT"></a> +#### `events.BUFFER_AFTER_REPLACE_TEXT` (string) + +Emitted after replacing the contents of the current buffer. + Note that it is not guaranteed that [`events.BUFFER_BEFORE_REPLACE_TEXT`](#events.BUFFER_BEFORE_REPLACE_TEXT) was emitted + previously. + The buffer **must not** be modified during this event. + <a id="events.BUFFER_AFTER_SWITCH"></a> #### `events.BUFFER_AFTER_SWITCH` (string) @@ -3718,6 +3725,14 @@ Emitted right after switching to another buffer. The buffer being switched to is `buffer`. Emitted by [`view.goto_buffer()`](#view.goto_buffer). +<a id="events.BUFFER_BEFORE_REPLACE_TEXT"></a> +#### `events.BUFFER_BEFORE_REPLACE_TEXT` (string) + +Emitted before replacing the contents of the current buffer. + Note that it is not guaranteed that [`events.BUFFER_AFTER_REPLACE_TEXT`](#events.BUFFER_AFTER_REPLACE_TEXT) will be emitted + shortly after this event. + The buffer **must not** be modified during this event. + <a id="events.BUFFER_BEFORE_SWITCH"></a> #### `events.BUFFER_BEFORE_SWITCH` (string) @@ -4139,12 +4154,6 @@ Extends Lua's `io` library with Textadept functions for working with files. ### Fields defined by `io` -<a id="events.FILE_AFTER_RELOAD"></a> -#### `events.FILE_AFTER_RELOAD` (string) - -Emitted after reloading the current file. - Emitted by [`buffer:reload()`](#buffer.reload). - <a id="events.FILE_AFTER_SAVE"></a> #### `events.FILE_AFTER_SAVE` (string) @@ -4155,12 +4164,6 @@ Emitted right after saving a file to disk. * _`filename`_: The filename of the file being saved. * _`saved_as`_: Whether or not the file was saved under a different filename. -<a id="events.FILE_BEFORE_RELOAD"></a> -#### `events.FILE_BEFORE_RELOAD` (string) - -Emitted before reloading the current file. - Emitted by [`buffer:reload()`](#buffer.reload). - <a id="events.FILE_BEFORE_SAVE"></a> #### `events.FILE_BEFORE_SAVE` (string) |