Commit Graph

1140 Commits

Author SHA1 Message Date
Kartik K. Agaram de699696c5 Merge lines.love 2023-06-08 01:24:34 -07:00
Kartik K. Agaram 1aceabc846 reconcile manual tests with some downstream forks 2023-06-08 01:21:33 -07:00
Kartik K. Agaram fdb2172843 Merge lines.love 2023-06-08 01:12:38 -07:00
Kartik K. Agaram 14c08f9bd9 several bugfixes in saving/loading cursor position 2023-06-08 01:02:54 -07:00
Kartik K. Agaram e8a5faaa4c Merge lines.love 2023-06-07 21:47:04 -07:00
Kartik K. Agaram 68eaba7d3d document some editor constants 2023-06-07 21:30:17 -07:00
Kartik K. Agaram 77164c61c8 Merge lines.love 2023-06-06 13:17:57 -07:00
Kartik K. Agaram 96c056bd4c return height of editor widget after drawing 2023-06-06 12:52:44 -07:00
Kartik K. Agaram cf1f860d20 Merge lines.love 2023-06-06 11:39:50 -07:00
Kartik K. Agaram 43114e2fa5 document facilities for buttons on screen 2023-06-06 11:18:20 -07:00
Kartik K. Agaram 64c4015167 Merge lines.love 2023-06-05 22:37:26 -07:00
Kartik K. Agaram f1981e85db document a couple of miscellaneous helpers 2023-06-05 22:23:25 -07:00
Kartik K. Agaram fc094496c1 document a few more keyboard primitives 2023-06-05 22:22:53 -07:00
Kartik K. Agaram 9e17337217 rename modifier_down to key_down
The old name was confusing, as its description showed.
2023-06-05 22:21:04 -07:00
Kartik K. Agaram bf2c2555d6 Merge lines.love 2023-06-04 15:11:24 -07:00
Kartik K. Agaram 637e28f300 port inscript's bugfix to source editor 2023-06-04 12:33:23 -07:00
Kartik K. Agaram 9656e13774 bugfix: inscript's bug
To fix this I have to first stop incrementally updating screen_bottom1
in the middle of a frame. Now it always has a good value from the end of
a frame.

I'm also running into some limitations in the test I'd ideally like to
write (that are documented in a comment), but I still get some sort of
automated test for this bugfix.
2023-06-04 12:20:24 -07:00
Kartik K. Agaram cf0ba7c154 handle wrapping lines 2023-06-03 10:44:11 -07:00
Kartik K. Agaram 3114176ebd change how we handle clicks above top margin 2023-06-03 10:36:05 -07:00
Kartik K. Agaram 541519a998 desired behavior now looks good 2023-06-02 07:46:45 -07:00
Kartik K. Agaram e0462ea2d8 save the list of tests in repo 2023-06-02 07:45:30 -07:00
Kartik K. Agaram cdef37c419 get rid of recent_mouse
It's a hack:
  - if you start selecting from below final line the start of the
    selection is the most recent click even if it was forever ago
  - (the crash we're currently fixing) if you start up and immediately
    select all then click below final line => crash. recent_mouse was
    never set.
  - getting rid of it breaks no tests (except the crash we're currently
    fixing)
2023-06-01 22:12:12 -07:00
Kartik K. Agaram 9b27a4d816 failing test now looks realistic 2023-06-01 21:59:09 -07:00
Kartik K. Agaram 9b3fa33f5b idea: set recent_mouse on mouse events
This helps, but doesn't address the C-a case. As it stands, literally my
first click of the mouse might need access to recent_mouse.line/pos
2023-06-01 21:58:28 -07:00
Kartik K. Agaram 3e848efb08 ah, I see the problem
Text.mouse_pos can sometimes set recent_mouse.time but not
recent_mouse.x/y. I'd assumed x/y is never nil in those situations, but
that's violated. It's most easily seen when typing C-a and then
clicking.
2023-06-01 12:37:17 -07:00
Kartik K. Agaram f1886391c5 some temporary logging to catch a bug
The bug has been spotted twice:

1. In snap.love, I selected text in one node, then another, and hit:
  Error: text.lua:789: attempt to compare nil with number
  stack traceback:
    text.lua:789: in function 'lt1'
    select.lua:19: in function 'clip_selection'
    text.lua:32: in function 'draw'
    edit.lua:117: in function 'draw'
    [string "REPL"]:21: in function 'draw'
    main.lua:152: in function 'draw'
    app.lua:102: in function <app.lua:84>
    [C]: in function 'xpcall'
    app.lua:112: in function <app.lua:111>
    [C]: in function 'xpcall'

  Couldn't reproduce.

2. In text.love, inscript selected all text in a small buffer and then
   clicked outside the text. And got:

  Error: text.lua:784: attempt to compare nil with number
  Traceback
    [love "callbacks.lua"]:228: in function 'handler'
    text.lua:784: in function 'lt1'
    select.lua:19: in function 'clip_selection'
    text.lua:27: in function 'draw'
    edit.lua:117: in function 'draw'
    run.lua:136: in function 'draw'
    main.lua:148: in function 'draw'
    app.lua:42: in function <app.lua:22>
    [C]: in function 'xpcall'

  This is reproducible, and also across forks.
2023-06-01 12:30:19 -07:00
Kartik K. Agaram 074f4d9b0a Merge lines.love 2023-05-30 00:31:34 -07:00
Kartik K. Agaram e568378ecb wait, fix tests
We had this problem because our test fakes were out of sync with reality.
And just in the source app.
2023-05-30 00:24:16 -07:00
Kartik K. Agaram 7c5a99f105 Merge lines.love 2023-05-30 00:15:13 -07:00
Kartik K. Agaram da21512440 bugfix: drawings in source editor
Broken since 2022-09 X-(

Scenario:
* switch to source editor
* draw a line
* wait 3 seconds

Before this commit the app would crash and then fail to restart until
you deleted the created .lua file from save dir.

This is not the first time I've confused Lua's files and LÖVE's
droppedFile objects. Just never rely on multiple args in file:write().
2023-05-30 00:02:09 -07:00
Kartik K. Agaram 0f3841f186 Merge lines.love 2023-05-14 17:31:55 -07:00
Kartik K. Agaram eb55e18e1d hide cursor in log browser window 2023-05-14 17:25:07 -07:00
Kartik K. Agaram c96be4b007 add an assert
I added this to catch a rare bug. I've had it locally for a few weeks
now without hitting it. Doesn't hurt to publish it.
2023-05-14 17:23:08 -07:00
Kartik K. Agaram 0d96fbe860 Merge lines.love 2023-05-14 17:12:23 -07:00
Kartik K. Agaram 47730a2b33 bugfix: rendering hyperlinks in wrapping lines
Scenario: a long line containing a hyperlink towards the end.
Before this commit the underline for the hyperlink was being rendered on
an x pixel starting from the start of the line.
2023-05-14 17:05:11 -07:00
Kartik K. Agaram 10932bd491 Merge lines.love 2023-05-13 17:29:45 -07:00
Kartik K. Agaram 8e02c2c021 bugfix: searching files containing unicode
Before this change the cursor was moving, but not being highlighted
properly when the cursor line contained unicode before the cursor.
2023-05-13 17:02:10 -07:00
Kartik K. Agaram e39fe490e4 Merge lines.love 2023-05-06 09:09:48 -07:00
Kartik K. Agaram 6a1d8e5164 bugfix: never use utf8 pos in string.sub
This is a violation of an existing rule in Manual_tests.md. The
following command weakly suggests there aren't any others:
  grep ':sub(' *.lua |grep pos
2023-05-06 08:56:44 -07:00
Kartik K. Agaram 6274df27c3 Merge lines.love 2023-04-21 23:29:47 -07:00
Kartik K. Agaram ac27d36dd0 delete inapplicable issue 2023-04-21 23:25:28 -07:00
Kartik K. Agaram 8e0fb09483 Merge lines.love 2023-04-21 23:10:09 -07:00
Kartik K. Agaram b9d3cf3578 correct a characterization 2023-04-21 22:53:40 -07:00
Kartik K. Agaram 488f0e4bce Merge lines.love 2023-04-19 22:15:58 -07:00
Kartik K. Agaram 22071c9b71 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
2023-04-19 21:53:11 -07:00
Kartik K. Agaram 88caf4eb31 Merge lines.love 2023-04-11 21:41:27 -07:00
Kartik K. Agaram 658f96667b primitives for writing tests 2023-04-11 21:33:33 -07:00
Kartik K. Agaram 4049176dfb couple of typos 2023-04-11 15:15:58 -07:00
Kartik K. Agaram c16998bcc6 Merge lines.love 2023-04-10 00:47:12 -07:00
Kartik K. Agaram ad7cffca27 editor documentation 2023-04-10 00:42:56 -07:00