diff options
Diffstat (limited to 'main.lua')
-rw-r--r-- | main.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/main.lua b/main.lua index 3e60d19..3801a3f 100644 --- a/main.lua +++ b/main.lua @@ -196,9 +196,14 @@ function App.mousepressed(x,y, mouse_button) for line_index,line in ipairs(Lines) do if line.mode == 'text' then if Text.in_line(line, x,y) then + if App.shift_down() then + Selection1 = {line=Cursor1.line, pos=Cursor1.pos} + end Cursor1.line = line_index Cursor1.pos = Text.to_pos_on_line(line, x, y) - Selection1 = {line=Cursor1.line, pos=Cursor1.pos} + if not App.shift_down() then + Selection1 = {line=Cursor1.line, pos=Cursor1.pos} + end end elseif line.mode == 'drawing' then if Drawing.in_drawing(line, x, y) then @@ -218,12 +223,13 @@ function App.mousereleased(x,y, button) if Text.in_line(line, x,y) then Cursor1.line = line_index Cursor1.pos = Text.to_pos_on_line(line, x, y) - if Text.eq1(Cursor1, Selection1) then + if Text.eq1(Cursor1, Selection1) and not App.shift_down() then Selection1 = {} end end end end +--? print('select:', Selection1.line, Selection1.pos) end end |