This commit is contained in:
Kartik K. Agaram 2022-07-08 15:39:51 -07:00
parent 00c64ed6e4
commit 9fb8f25030
2 changed files with 12 additions and 3 deletions

View File

@ -351,7 +351,10 @@ function App.mousepressed(x,y, mouse_button)
Old_cursor1 = Cursor1
Old_selection1 = Selection1
Mousepress_shift = App.shift_down()
Selection1 = {line=line_index, pos=Text.to_pos_on_line(line, x, y)}
Selection1 = {
line=line_index,
pos=Text.to_pos_on_line(line, x, y),
}
--? print('selection', Selection1.line, Selection1.pos)
break
end
@ -384,7 +387,10 @@ function App.mousereleased(x,y, button)
if line.mode == 'text' then
if Text.in_line(line, x,y, Margin_left, App.screen.width-Margin_right) then
--? print('reset selection')
Cursor1 = {line=line_index, pos=Text.to_pos_on_line(line, x, y)}
Cursor1 = {
line=line_index,
pos=Text.to_pos_on_line(line, x, y),
}
--? print('cursor', Cursor1.line, Cursor1.pos)
if Mousepress_shift then
if Old_selection1.line == nil then

View File

@ -946,7 +946,10 @@ function Text.tweak_screen_top_and_cursor(left, right)
if Text.cursor_past_screen_bottom() then
--? print('tweak')
local line = Lines[Screen_bottom1.line]
Cursor1 = {line=Screen_bottom1.line, pos=Text.to_pos_on_line(line, App.screen.width-5, App.screen.height-5)}
Cursor1 = {
line=Screen_bottom1.line,
pos=Text.to_pos_on_line(line, App.screen.width-5, App.screen.height-5),
}
end
end
end