Commit Graph

34 Commits

Author SHA1 Message Date
Kartik K. Agaram bd2179d8aa bugfix
scenario: run without config file, quit, run again
expected: font size remains the same on second run

Before this commit it was increasing on each run.
It turns out the font height that you pass into love.graphics.newFont()
is not the result of font:getHeight().
2023-12-29 11:52:28 -08:00
Kartik K. Agaram 0f4aea6db7 pull font into editor
Now it adjusts the current font for itself.
And it's up to the caller to adjust the current font after.
2023-12-29 11:18:41 -08:00
Kartik K. Agaram aa9a0b0b15 use my name for a dir 2023-10-27 23:58:42 -07:00
Kartik K. Agaram 52ba030eaa drop an unused arg 2023-07-11 08:36:42 -07:00
Kartik K. Agaram bca7f82598 standardize between run and source some more
We shouldn't be thinking about saving settings when we're initializing
window geometry.
2023-07-10 17:16:58 -07:00
Kartik K. Agaram 7f4c5f847b simplify saving settings
We don't ever call one app's settings while Current_app is the other.
2023-07-10 17:14:38 -07:00
Kartik K. Agaram a8747478ff bugfix: Windows pushing title bar off screen
I'm learning the hard way that resizing the window is a big deal. Only
do this when someone explicitly requests it, otherwise follow LÖVE's
defaults.

Therefore we're also going to stop trying to be smart when showing the
log browser. Leave window resizing to manual operations.

Now initialization looks a lot more similar for the run and source apps.
2023-07-10 17:09:09 -07:00
Kartik K. Agaram 3f52063d02 delete flags that have never been exercised
Initialization is getting complex, and I'm finding bugs.
2023-07-10 16:33:17 -07:00
Kartik K. Agaram b42f08cb79 bugfix: preserve window position
I just noticed we hadn't got this bugfix for Linux on the main app. How
had we not noticed this issue before? Answer: lines.love windows tend to
be tall and skinny, and resize must keep the window entirely within the
screen. So the window was staying in place just because it happened to
be running up against the bottom.
2023-07-10 16:08:18 -07:00
Kartik K. Agaram 14c08f9bd9 several bugfixes in saving/loading cursor position 2023-06-08 01:02:54 -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 282983d084 switch source side to new screen-line-based render
Also copy over the implementation of links from pensieve.love.
2023-04-03 08:33:07 -07:00
Kartik K. Agaram 876d6298b4 App.width can no longer take a Text
In the process I discovered the horrible fact that Text.x allocates a new Text.
And it gets called (just once, thank goodness) on every single frame.
2023-04-01 18:12:29 -07:00
Kartik K. Agaram 4ab901c92e get rid of to_text
I've been misunderstanding what Text objects are. They can render a lot
of text with a given line height, word wrap, colors in various places.
And I've been creating one for every word 🤦

Unwinding this will take some time. This is just a first baby step for
ad hoc text objects. Turns out I don't need to convert to Text to get
something's rendered width, just the Font can do that.

Thanks to the LÖVE Discord for educating me:
  https://discord.com/channels/329400828920070144/330089431379869708/1091535487333826580
2023-04-01 16:12:55 -07:00
Kartik K. Agaram afadb4db66 stop reusing cursor locations between files 2023-03-25 10:37:55 -07:00
Kartik K. Agaram 0b1c47f79f experiment at avoiding some merge conflicts
https://merveilles.town/@akkartik/110084833821965708
2023-03-25 10:36:43 -07:00
Kartik K. Agaram a6dcfc5ac8 some minor cleanup
I can't see the mouse wheel ever setting dx, but it's more obvious now
that the editor doesn't support panning left/right.
2023-03-23 21:38:33 -07:00
Kartik K. Agaram 99faf61abb mouse wheel support 2023-03-23 21:00:09 -07:00
Kartik K. Agaram 30e75991ce get typed in keystrokes to show on screen on iPad
Many thanks to Myte for helping test this!
2023-03-18 23:50:30 -07:00
Kartik K. Agaram e8d6a8a26d consistently use App names for methods everywhere 2023-03-18 23:45:01 -07:00
Kartik K. Agaram e2c1bbe4e5 more robust state validation 2023-03-17 10:28:10 -07:00
Kartik K. Agaram 0719fdeaaf hoist out some common settings 2023-01-16 09:48:06 -08:00
Kartik K. Agaram e8ec87255f bugfix
lines.love was broken since Dec 23 X-( Didn't get caught because all my
tests start at edit, not at main or run. I need 'integration' tests.
2023-01-06 17:39:10 -08:00
Kartik K. Agaram c7de47440b typo 2023-01-01 17:59:10 -08:00
Kartik K. Agaram d6f955f144 fix stale comment 2023-01-01 09:14:08 -08:00
Kartik K. Agaram 2b3e09ca0f make love event names consistent
I want the words to be easy to read, and to use a consistent tense.
update and focus seem more timeless; let's make everything like those.
2022-12-23 18:52:28 -08:00
Kartik K. Agaram 72791d9c35 some debug prints
I'm starting to edit the sources from within the app in ernest. First
question: why does the file navigation menu skip some files? These
prints answer the question.
2022-09-17 20:37:40 -07:00
Kartik K. Agaram 9a41c7c176 more correct absolute path detection 2022-09-11 08:31:05 -07:00
Kartik K. Agaram 511db8cffd bugfix: path munging on Windows 2022-09-10 19:23:34 -07:00
Kartik K. Agaram 7d5dae9e39 bugfix: cold start 2022-09-03 21:08:30 -07:00
Kartik K. Agaram 5cada8cc9e remember window positions across restart/ctrl+e 2022-09-03 17:00:58 -07:00
Kartik K. Agaram e1c5a42f31 editing source code from within the app
integrated from pong.love via text.love:
  https://merveilles.town/@akkartik/108933336531898243
2022-09-03 14:13:22 -07:00
Kartik K. Agaram 555726a87d rename 2022-05-22 18:23:04 -07:00
Kartik K. Agaram ac74592c42 beginnings of a test harness
I have no fucking idea what I'm doing. All I know is that there's still
too many goddamn bugs[1]. Test motherfucking harness or bust. For
starters this is just the default love.run from
https://love2d.org/wiki/love.run

[1] The following file crashes if you repeatedly press cursor-down:
  <<
    a
    b

    c
    ```lines
    ```

    x
  >>
2022-05-22 10:40:34 -07:00