aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/keys.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2011-07-30 19:02:51 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2011-07-30 19:02:51 -0400
commitf34ffdf83c66991efc42b04bb312af0a787d201e (patch)
tree7888793f826bbfd5611f47176816412454d719ac /modules/textadept/keys.lua
parent36675f10b0cefaee7e9451b3eec3dfd715888625 (diff)
downloadtextadept-f34ffdf83c66991efc42b04bb312af0a787d201e.tar.gz
textadept-f34ffdf83c66991efc42b04bb312af0a787d201e.zip
Code cleanup.
Diffstat (limited to 'modules/textadept/keys.lua')
-rw-r--r--modules/textadept/keys.lua15
1 files changed, 8 insertions, 7 deletions
diff --git a/modules/textadept/keys.lua b/modules/textadept/keys.lua
index 8aeffbd2..a29d79d9 100644
--- a/modules/textadept/keys.lua
+++ b/modules/textadept/keys.lua
@@ -16,7 +16,7 @@ local c, OSX = _SCINTILLA.constants, OSX
-- Utility functions.
utils = {
enclose_as_xml_tags = function()
- enclose('<', '>')
+ m_editing.enclose('<', '>')
local buffer = buffer
local pos = buffer.current_pos
while buffer.char_at[pos - 1] ~= 60 do pos = pos - 1 end -- '<'
@@ -94,6 +94,7 @@ local function constantize_menu_buffer_functions()
for _, f in ipairs(menu_buffer_functions) do buffer[f] = buffer[f] end
end
events.connect(events.BUFFER_NEW, constantize_menu_buffer_functions)
+-- Scintilla's first buffer doesn't have this.
if not RESETTING then constantize_menu_buffer_functions() end
--[[
@@ -190,9 +191,9 @@ keys[not OSX and 'csdown' or 'msdown'] = _buffer.move_selected_lines_down
-- Search.
keys.cf = gui.find.focus
keys.cg = gui.find.find_next
-if not OSX then keys.f3 = gui.find.find_next end
+if not OSX then keys.f3 = keys.cg end
keys.cG = gui.find.find_prev
-if not OSX then keys.sf3 = gui.find.find_prev end
+if not OSX then keys.sf3 = keys.cG end
keys.cr = gui.find.replace
keys.cR = gui.find.replace_all
keys.caf = gui.find.find_incremental
@@ -229,9 +230,7 @@ keys.ci = utils.show_style
-- Buffer.
keys[not OSX and 'c\t' or 'm`'] = { _view.goto_buffer, _view, 1, false }
-if not OSX then keys.cpgdn = keys['c\t'] end
keys[not OSX and 'cs\t' or 'm~'] = { _view.goto_buffer, _view, -1, false }
-if not OSX then keys.cpgup = keys['cs\t'] end
keys.cb = gui.switch_buffer
-- Indentation.
-- TODO: { utils.set_indentation, 2 }
@@ -267,9 +266,11 @@ keys[not OSX and 'ca-' or 'm-'] = { utils.shrink, 10 }
keys[not OSX and 'ca\n' or 'm\n'] = { utils.toggle_property, 'view_eol' }
if not OSX then keys['ca\n\r'] = keys['ca\n'] end
keys[not OSX and 'ca\\' or 'm\\'] = { utils.toggle_property, 'wrap_mode' }
-keys[not OSX and 'caI' or 'mI'] = { utils.toggle_property, 'indentation_guides' }
+keys[not OSX and 'caI' or 'mI'] =
+ { utils.toggle_property, 'indentation_guides' }
keys[not OSX and 'ca ' or 'm '] = { utils.toggle_property, 'view_ws' }
-keys[not OSX and 'caV' or 'mV'] = { utils.toggle_property, 'virtual_space_options', c.SCVS_USERACCESSIBLE }
+keys[not OSX and 'caV' or 'mV'] =
+ { utils.toggle_property, 'virtual_space_options', c.SCVS_USERACCESSIBLE }
keys['c='] = _buffer.zoom_in
keys['c-'] = _buffer.zoom_out
keys.c0 = utils.reset_zoom