diff options
author | 2009-07-12 13:15:29 -0400 | |
---|---|---|
committer | 2009-07-12 13:15:29 -0400 | |
commit | 248890fae4c581332aacda6b8b81b1d8c5b161bd (patch) | |
tree | c1e0760b0d87a0671472034739c796bc071bb947 /modules | |
parent | 16782a2ab5e158f418581b74452415cd561a5046 (diff) | |
download | textadept-248890fae4c581332aacda6b8b81b1d8c5b161bd.tar.gz textadept-248890fae4c581332aacda6b8b81b1d8c5b161bd.zip |
The 'char_added' handler shouldn't convert int to string.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/textadept/editing.lua | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index c832c8fe..ee312df0 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -20,8 +20,8 @@ local kill_ring = { pos = 1, maxn = 10 } -- @class table -- @name char_matches local char_matches = { - ['('] = ')', ['['] = ']', ['{'] = '}', - ["'"] = "'", ['"'] = '"' + [40] = ')', [91] = ']', [123] = '}', + [39] = "'", [34] = '"' } --- @@ -95,7 +95,7 @@ textadept.events.add_handler('update_ui', textadept.events.add_handler('char_added', function(char) -- auto-indent on return - if char ~= '\n' then return end + if char ~= 10 then return end local buffer = buffer local anchor, caret = buffer.anchor, buffer.current_pos local curr_line = buffer:line_from_position(caret) @@ -483,7 +483,6 @@ end -- Selects text in a specified enclosure. -- @param str The enclosure type in enclosure. -- @see enclosure --- @see char_matches function select_enclosed(str) if not str then return end local buffer = buffer |