about summary refs log tree commit diff stats
path: root/main.lua
diff options
context:
space:
mode:
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/main.lua b/main.lua
index 4eb3d5a..71c7e4d 100644
--- a/main.lua
+++ b/main.lua
@@ -413,8 +413,12 @@ function App.textinput(t)
   schedule_save()
 end
 
-function App.keychord_pressed(chord)
-  if Selection1.line and not App.shift_down() and chord ~= 'C-c' and chord ~= 'C-x' and chord ~= 'backspace' and backspace ~= 'delete' and not App.is_cursor_movement(chord) then
+function App.keychord_pressed(chord, key)
+  if Selection1.line and
+      -- printable character created using shift key => delete selection
+      -- (we're not creating any ctrl-shift- or alt-shift- combinations using regular/printable keys)
+      (not App.shift_down() or utf8.len(key) == 1) and
+      chord ~= 'C-c' and chord ~= 'C-x' and chord ~= 'backspace' and backspace ~= 'delete' and not App.is_cursor_movement(chord) then
     Text.delete_selection()
   end
   if Search_term then