aboutsummaryrefslogtreecommitdiff
path: root/modules
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 /modules
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 'modules')
-rw-r--r--modules/textadept/keys.lua8
-rw-r--r--modules/textadept/menu.lua18
-rw-r--r--modules/textadept/run.lua2
3 files changed, 14 insertions, 14 deletions
diff --git a/modules/textadept/keys.lua b/modules/textadept/keys.lua
index 09dbb433..a72899ca 100644
--- a/modules/textadept/keys.lua
+++ b/modules/textadept/keys.lua
@@ -280,11 +280,11 @@ local keys, OSX, GUI, CURSES, _L = keys, OSX, not CURSES, CURSES, _L
keys[not OSX and (GUI and 'cn' or 'cmn') or 'mn'] = buffer.new
keys[not OSX and 'co' or 'mo'] = io.open_file
keys[not OSX and GUI and 'cao' or 'cmo'] = io.open_recent_file
-keys[not OSX and (GUI and 'cO' or 'mo') or 'mO'] = io.reload_file
-keys[not OSX and 'cs' or 'ms'] = io.save_file
-keys[not OSX and (GUI and 'cS' or 'cms') or 'mS'] = io.save_file_as
+keys[not OSX and (GUI and 'cO' or 'mo') or 'mO'] = buffer.reload
+keys[not OSX and 'cs' or 'ms'] = buffer.save
+keys[not OSX and (GUI and 'cS' or 'cms') or 'mS'] = buffer.save_as
-- TODO: io.save_all_files
-keys[not OSX and 'cw' or 'mw'] = io.close_buffer
+keys[not OSX and 'cw' or 'mw'] = buffer.close
keys[not OSX and (GUI and 'cW' or 'cmw') or 'mW'] = io.close_all_buffers
-- TODO: textadept.sessions.load
-- TODO: textadept.sessions.save
diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua
index 02ae948b..ed1cd763 100644
--- a/modules/textadept/menu.lua
+++ b/modules/textadept/menu.lua
@@ -15,7 +15,7 @@ module('textadept.menu')]]
local _L = _L
local SEPARATOR = {''}
--- The following buffer functions need to be constantized in order for menu
+-- The following buffer functions need to be made constant in order for menu
-- items to identify the key associated with the functions.
local menu_buffer_functions = {
'undo', 'redo', 'cut', 'copy', 'paste', 'line_duplicate', 'clear',
@@ -59,12 +59,12 @@ local default_menubar = {
{_L['New'], buffer.new},
{_L['Open'], io.open_file},
{_L['Open Recent...'], io.open_recent_file},
- {_L['Reload'], io.reload_file},
- {_L['Save'], io.save_file},
- {_L['Save As'], io.save_file_as},
+ {_L['Reload'], buffer.reload},
+ {_L['Save'], buffer.save},
+ {_L['Save As'], buffer.save_as},
{_L['Save All'], io.save_all_files},
SEPARATOR,
- {_L['Close'], io.close_buffer},
+ {_L['Close'], buffer.close},
{_L['Close All'], io.close_all_buffers},
SEPARATOR,
{_L['Load Session...'], textadept.session.load},
@@ -381,12 +381,12 @@ local default_context_menu = {
-- @class table
-- @name tab_context_menu
local default_tab_context_menu = {
- {_L['Close'], io.close_buffer},
+ {_L['Close'], buffer.close},
SEPARATOR,
- {_L['Save'], io.save_file},
- {_L['Save As'], io.save_file_as},
+ {_L['Save'], buffer.save},
+ {_L['Save As'], buffer.save_as},
SEPARATOR,
- {_L['Reload'], io.reload_file},
+ {_L['Reload'], buffer.reload},
}
-- Table of proxy tables for menus.
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua
index 3b19c222..91a2e672 100644
--- a/modules/textadept/run.lua
+++ b/modules/textadept/run.lua
@@ -183,7 +183,7 @@ end
local function compile_or_run(filename, commands)
if filename == buffer.filename then
buffer:annotation_clear_all()
- io.save_file()
+ buffer:save()
end
local ext = filename:match('[^/\\.]+$')
local lexer = filename == buffer.filename and buffer:get_lexer() or