aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/keys.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2012-01-05 06:44:30 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2012-01-05 06:44:30 -0500
commitbd351f0bef198d981b67830ddb5e4cd42c3aca37 (patch)
treeb3a8e3b902a1f585e4f486ff2f4e38f1995476a6 /modules/textadept/keys.lua
parent8c1f243ec135e2d2eec79961534f0a6df7c16efa (diff)
downloadtextadept-bd351f0bef198d981b67830ddb5e4cd42c3aca37.tar.gz
textadept-bd351f0bef198d981b67830ddb5e4cd42c3aca37.zip
Renamed editing module's 'current_word' to 'select_word'.
Also added utils function for deleting the current word.
Diffstat (limited to 'modules/textadept/keys.lua')
-rw-r--r--modules/textadept/keys.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/textadept/keys.lua b/modules/textadept/keys.lua
index 40954110..285263a3 100644
--- a/modules/textadept/keys.lua
+++ b/modules/textadept/keys.lua
@@ -11,6 +11,10 @@ module('_M.textadept.keys')]]
-- Utility functions.
M.utils = {
+ delete_word = function()
+ _M.textadept.editing.select_word()
+ buffer:delete_back()
+ end,
enclose_as_xml_tags = function()
_M.textadept.editing.enclose('<', '>')
local buffer = buffer
@@ -159,7 +163,7 @@ keys.del = buffer.clear
keys[not OSX and 'ca' or 'ma'] = buffer.select_all
keys.cm = Mediting.match_brace
keys[not OSX and 'c\n' or 'cesc'] = { Mediting.autocomplete_word, '%w_' }
-keys[not OSX and 'adel' or 'cdel'] = { Mediting.current_word, 'delete' }
+keys[not OSX and 'adel' or 'cdel'] = utils.delete_word
keys[not OSX and 'caH' or 'mH'] = Mediting.highlight_word
keys[not OSX and 'c/' or 'm/'] = Mediting.block_comment
keys.ct = Mediting.transpose_chars
@@ -173,7 +177,7 @@ keys[not OSX and 'c"' or 'm"'] = { Mediting.select_enclosed, '"', '"' }
keys[not OSX and 'c(' or 'm('] = { Mediting.select_enclosed, '(', ')' }
keys[not OSX and 'c[' or 'm['] = { Mediting.select_enclosed, '[', ']' }
keys[not OSX and 'c{' or 'm{'] = { Mediting.select_enclosed, '{', '}' }
-keys[not OSX and 'cD' or 'mD'] = { Mediting.current_word, 'select' }
+keys[not OSX and 'cD' or 'mD'] = Mediting.select_word
keys[not OSX and 'cN' or 'mN'] = Mediting.select_line
keys[not OSX and 'cP' or 'mP'] = Mediting.select_paragraph
keys[not OSX and 'cI' or 'mI'] = Mediting.select_indented_block