diff options
author | 2010-10-15 17:19:49 -0400 | |
---|---|---|
committer | 2010-10-15 17:19:49 -0400 | |
commit | c2e121cb38d84cbe6a1aa37b9f8ef9c7d81d5b66 (patch) | |
tree | bb8beb1bb15425ccc93640ee269ac6c6093d1133 /modules/textadept/editing.lua | |
parent | 903e94af9204eddeec3f50cd6d5b5c62e1d651ad (diff) | |
download | textadept-c2e121cb38d84cbe6a1aa37b9f8ef9c7d81d5b66.tar.gz textadept-c2e121cb38d84cbe6a1aa37b9f8ef9c7d81d5b66.zip |
Added key commands and changed LuaDoc for highlighting words.
Diffstat (limited to 'modules/textadept/editing.lua')
-rw-r--r-- | modules/textadept/editing.lua | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index d611e982..b7645770 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -22,13 +22,14 @@ module('_m.textadept.editing', package.seeall) -- * `SAVE_STRIPS_WS`: Flag indicating whether or not to strip trailing -- whitespace on file save. -- * `MARK_HIGHLIGHT`: The unique integer mark used to identify a line --- containing a highlighted word. +-- containing a highlighted word. -- * `MARK_HIGHLIGHT_BACK`: The [Scintilla color][scintilla_color] used for a --- line containing a highlighted word. +-- line containing a highlighted word. -- * `INDIC_HIGHLIGHT`: The unique integer indicator for highlighted words. --- * `INDIC_HIGHLIGHT_BACK`: The [Scintilla color][scintilla_color] used for a --- highlighted word. --- * `INDIC_HIGHLIGHT_ALPHA`: The transparency used for a highlighted word. +-- * `INDIC_HIGHLIGHT_BACK`: The [Scintilla color][scintilla_color] used for an +-- indicator for a highlighted word. +-- * `INDIC_HIGHLIGHT_ALPHA`: The transparency used for an indicator for a +-- highlighted word. -- settings AUTOPAIR = true @@ -503,16 +504,19 @@ function convert_indentation() buffer:end_undo_action() end --- Clears highlighted words. +-- Clears highlighted word indicators and markers. local function clear_highlighted_words() local buffer = buffer buffer:marker_delete_all(MARK_HIGHLIGHT) buffer.indicator_current = INDIC_HIGHLIGHT buffer:indicator_clear_range(0, buffer.length) end +events.connect('keypress', + function(c) if c == 0xff1b then clear_highlighted_words() end end) -- Esc --- --- Highlights all occurances of the word under the caret. +-- Highlights all occurances of the word under the caret and adds markers to the +-- lines they are on. function highlight_word() clear_highlighted_words() local buffer = buffer @@ -537,10 +541,7 @@ function highlight_word() buffer:set_sel(s, e) end -events.connect('keypress', - function(c) if c == 0xff1b then clear_highlighted_words() end end) -- Esc - --- Sets view properties for highlighted words. +-- Sets view properties for highlighted word indicators and markers. local function set_highlight_properties() local buffer = buffer buffer:marker_set_back(MARK_HIGHLIGHT, MARK_HIGHLIGHT_BACK) |