diff options
author | 2012-03-14 15:51:12 -0400 | |
---|---|---|
committer | 2012-03-14 15:51:12 -0400 | |
commit | 9964c09b5a9a769786f9fc62f316781050fe2dc9 (patch) | |
tree | 3b93ab3e4c899b1f8585b5d5a4b980539d878382 /modules/textadept/editing.lua | |
parent | 0d69af77291c66e4d982497b8e189f5228d4d07e (diff) | |
download | textadept-9964c09b5a9a769786f9fc62f316781050fe2dc9.tar.gz textadept-9964c09b5a9a769786f9fc62f316781050fe2dc9.zip |
Use buffer:get_lexer(true) more often when it should be used.
Diffstat (limited to 'modules/textadept/editing.lua')
-rw-r--r-- | modules/textadept/editing.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index 5ca59989..9093a150 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -86,7 +86,7 @@ local K = keys.KEYSYMS events_connect(events.CHAR_ADDED, function(c) if not M.AUTOPAIR then return end local buffer = buffer - local match = (M.char_matches[buffer:get_lexer()] or M.char_matches)[c] + local match = (M.char_matches[buffer:get_lexer(true)] or M.char_matches)[c] if match and buffer.selections == 1 then buffer:insert_text(-1, match) end end) @@ -96,7 +96,7 @@ events_connect(events.KEYPRESS, function(code) local buffer = buffer local pos = buffer.current_pos local c = buffer.char_at[pos - 1] - local match = (M.char_matches[buffer:get_lexer()] or M.char_matches)[c] + local match = (M.char_matches[buffer:get_lexer(true)] or M.char_matches)[c] if match and buffer.char_at[pos] == string.byte(match) then buffer:clear() end end) @@ -105,7 +105,7 @@ events_connect(events.UPDATE_UI, function() if not M.HIGHLIGHT_BRACES then return end local buffer = buffer local pos = buffer.current_pos - if (M.braces[buffer:get_lexer()] or M.braces)[buffer.char_at[pos]] then + if (M.braces[buffer:get_lexer(true)] or M.braces)[buffer.char_at[pos]] then local match = buffer:brace_match(pos) if match ~= -1 then buffer:brace_highlight(pos, match) @@ -238,7 +238,7 @@ end function M.block_comment(comment) local buffer = buffer if not comment then - comment = M.comment_string[buffer:get_lexer()] + comment = M.comment_string[buffer:get_lexer(true)] if not comment then return end end local anchor, caret = buffer.selection_start, buffer.selection_end |