From 22071c9b71ad9b2256bd8302f2eeacdbbce5c01f Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Wed, 19 Apr 2023 21:53:11 -0700 Subject: remove some support for long lines from source editor A code editor is unlikely to need support for extremely long lines. And that kind of scroll is jarring anyway in a code editor. We don't read code like a novel, and less scroll per page implies more scrolling work. I'd gotten rid of this functionality and the test for it [1] back in the spokecone fork, but only took out the test when first pulling it into the source editor. [1] test_pagedown_often_shows_start_of_wrapping_line --- text.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'text.lua') diff --git a/text.lua b/text.lua index 1f247e1..24fba90 100644 --- a/text.lua +++ b/text.lua @@ -617,6 +617,9 @@ function Text.move_cursor_down_to_next_text_line_while_scrolling_again_if_necess y = y + Drawing_padding_height + Drawing.pixels(State.lines[State.cursor1.line].h, State.width) State.cursor1.line = State.cursor1.line + 1 end + if State.cursor1.pos == nil then + State.cursor1.pos = 1 + end -- hack: insert a text line at bottom of file if necessary if State.cursor1.line > #State.lines then assert(State.cursor1.line == #State.lines+1) -- cgit 1.4.1-2-gfad0