From 9ccdc7a172c6a60ce948e4c5093603f02b530750 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 4 Mar 2010 04:47:20 -0500 Subject: Fix auto-insert of closing parenthesis; modules/textadept/editing.lua If there are multiple selections, don't insert a closing parenthesis. --- modules/textadept/editing.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3