diff options
author | 2010-03-04 04:47:20 -0500 | |
---|---|---|
committer | 2010-03-04 04:47:20 -0500 | |
commit | 9ccdc7a172c6a60ce948e4c5093603f02b530750 (patch) | |
tree | 461180556431c5ec2938cc7c695870b3ce6d4c8b | |
parent | a9396a737349df0d2b7daee614431ce171255380 (diff) | |
download | textadept-9ccdc7a172c6a60ce948e4c5093603f02b530750.tar.gz textadept-9ccdc7a172c6a60ce948e4c5093603f02b530750.zip |
Fix auto-insert of closing parenthesis; modules/textadept/editing.lua
If there are multiple selections, don't insert a closing parenthesis.
-rw-r--r-- | modules/textadept/editing.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index 29d16dba..1813a4a6 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -75,7 +75,9 @@ local comment_strings = { if AUTOPAIR then textadept.events.add_handler('char_added', function(c) -- matches characters specified in char_matches - if char_matches[c] then buffer:insert_text(-1, char_matches[c]) end + if char_matches[c] and buffer.selections == 1 then + buffer:insert_text(-1, char_matches[c]) + end end) end |