aboutsummaryrefslogtreecommitdiff
path: root/core/.buffer.luadoc
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2020-03-16 19:49:05 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2020-03-16 19:49:05 -0400
commit874b3ef5965170d152c9e702eb7c90075e7ab418 (patch)
tree5d2045a093120259b9fa2248893a90b181b81219 /core/.buffer.luadoc
parent1f50b95c871660fc117241b703b2ee42643eea6c (diff)
downloadtextadept-874b3ef5965170d152c9e702eb7c90075e7ab418.tar.gz
textadept-874b3ef5965170d152c9e702eb7c90075e7ab418.zip
Moved individual buffer functions in `io` into `buffer`.
e.g. `io.reload_buffer()` was renamed `buffer:reload()`.
Diffstat (limited to 'core/.buffer.luadoc')
-rw-r--r--core/.buffer.luadoc35
1 files changed, 34 insertions, 1 deletions
diff --git a/core/.buffer.luadoc b/core/.buffer.luadoc
index f7670b7b..fab4f9eb 100644
--- a/core/.buffer.luadoc
+++ b/core/.buffer.luadoc
@@ -3118,7 +3118,7 @@ function zoom_out(buffer) end
---
-- Deletes the buffer.
--- **Do not call this function.** Call `io.close_buffer()` instead. Emits a
+-- **Do not call this function.** Call `buffer:close()` instead. Emits a
-- `BUFFER_DELETED` event.
-- @param buffer A buffer.
-- @see events.BUFFER_DELETED
@@ -3140,6 +3140,39 @@ function new() end
function text_range(buffer, start_pos, end_pos) end
---
+-- Reloads the buffer's file contents, discarding any changes.
+-- @param buffer A buffer.
+-- @name reload_file
+function reload(buffer) end
+
+---
+-- Saves the buffer to its file.
+-- Emits `FILE_BEFORE_SAVE` and `FILE_AFTER_SAVE` events.
+-- @param buffer A buffer.
+-- @name save_file
+function save(buffer) end
+
+---
+-- Saves the buffer to file *filename* or the user-specified filename.
+-- Emits a `FILE_AFTER_SAVE` event.
+-- @param buffer A buffer.
+-- @param filename Optional new filepath to save the buffer to. If `nil`, the
+-- user is prompted for one.
+-- @name save_file_as
+function save_as(buffer, filename) end
+
+---
+-- Closes the buffer, prompting the user to continue if there are unsaved
+-- changes (unless *force* is `true`), and returns `true` if the buffer was
+-- closed.
+-- @param buffer A buffer.
+-- @param force Optional flag that discards unsaved changes without prompting
+-- the user. The default value is `false`.
+-- @return `true` if the buffer was closed; `nil` otherwise.
+-- @name close_buffer
+function close(buffer, force) end
+
+---
-- Converts the current buffer's contents to encoding *encoding*.
-- @param buffer A buffer.
-- @param encoding The string encoding to set. Valid encodings are ones that GNU