Commit Graph

655 Commits

Author SHA1 Message Date
Kartik K. Agaram 4e15b8eee3 Merge lines.love 2024-05-19 23:05:41 -07:00
Kartik K. Agaram 8219db2bcd mousefocus handler 2024-05-19 22:41:52 -07:00
Kartik K. Agaram b6102d0489 mousemoved handler 2024-05-19 22:40:27 -07:00
Kartik K. Agaram 25c9249b5f Merge lines.love 2024-01-15 02:24:30 -08:00
Kartik K. Agaram 4121613fc6 don't save settings on error in source editor 2024-01-12 03:51:34 -08:00
Kartik K. Agaram a736e9705b Merge lines.love 2023-12-07 01:15:58 -08:00
Kartik K. Agaram 366d806515 copy correct warning message
Not really useful here, but other forks might make use of it.
2023-12-07 01:08:09 -08:00
Kartik K. Agaram 2ae350b013 Merge lines.love 2023-12-06 23:30:25 -08:00
Kartik K. Agaram 8c97755480 hide some details within the 'warning' state
Renamed from the 'error' state.

Now we no longer overload Error_message; it's only used for actual
errors that trigger opening the source editor.

I was tempted to hide Skip_rest_of_key_events inside the 'warning' state
as well, but that isn't right. It applies to all Current_app
transitions, not just those in and out of 'warning'.
2023-12-06 22:59:24 -08:00
Kartik K. Agaram 19597e7619 redo version checks yet again
I'm starting to feel better after replacing 1 line with 20 and 2 new
bits of global state. I'm now handling two scenarios more explicitly:

* If I change Current_app within key_press, the corresponding text_input
  and key_release events go to the new app. If it's an editor it might
  insert the key, which is undesirable. Putting such handlers in
  key_release now feels overly clever, particularly since it took me
  forever to realize why I was getting stuck in an infinite loop.

* Both 'run' and 'source' can hit the version check, so we need to be
  able to transition from the 'error' app to either. Which
  necessitates yet another global bit of state: Next_app.
2023-12-06 22:43:28 -08:00
Kartik K. Agaram 01a26cad5f redo version checks
This is still ugly, but hopefully easier to follow.
2023-12-06 20:14:24 -08:00
Kartik K. Agaram 7076aef656 Merge lines.love 2023-12-03 12:58:42 -08:00
Kartik K. Agaram f37b45196a speculatively recommend new LÖVE v11.5 in all forks 2023-12-03 12:12:56 -08:00
Kartik K. Agaram 9993014904 bugfix: version check 2023-12-03 12:11:17 -08:00
Kartik K. Agaram 841034fd9e Merge lines.love 2023-11-12 19:52:13 -08:00
Kartik K. Agaram 5cce511550 remove some dead code
We have an early exit for 'error' mode in this function.
2023-11-12 17:14:37 -08:00
Kartik K. Agaram 7057ac74ec check for 'error' mode in a few more places
In particular, I want to be able to switch to 'error' mode rather than
throw a real error() on test failures, because that's a little more
responsive and might be recoverable. (On some Android devices the font
is slightly different, and tests fail as a result.)
2023-11-12 16:31:12 -08:00
Kartik K. Agaram 07e217546d Merge lines.love 2023-10-09 20:51:00 -07:00
Kartik K. Agaram 6e391d7875 start supporting LÖVE v12
To do this I need some support for multiple versions. And I need an
'error' mode to go with existing 'run' and 'source' modes
(`Current_app`). Most errors will automatically transition to 'source'
editor mode, but some errors aren't really actionable in the editor. For
those we'll use 'error' mode.

The app doesn't yet work with LÖVE v12. There are some unit tests failing
because of differences in font rendering.
2023-10-09 20:05:19 -07:00
Kartik K. Agaram 985016af88 Merge lines.love 2023-09-10 21:54:52 -07:00
Kartik K. Agaram 7062963888 Revert "deemphasize the source editor"
Now that we have decent error handling, I think we can encourage people
to press ctrl+e again.

This reverts commit 4b43e9e85d.
2023-09-10 21:45:59 -07:00
Kartik K. Agaram 209dc38a9b change how we provide the notes directory
Before:
- notes directory is saveDir/data by default
  where saveDir = love.filesystem.getSaveDirectory()
- providing a commandline arg of x makes the notes directory saveDir/data.x

Now:
- there is no default directory; you get an error message instead
  telling you what to do.
- the commandline arg is the (preferably absolute) path of the notes
  directory you want to load

Unchanged: once you set the notes directory it gets remembered for
future runs.

Now the Readme is a lot simpler.

I tried to make migrating simpler, but this is complicated enough (see
Manual_tests.md)
2023-09-08 14:20:42 -07:00
Kartik K. Agaram 11d2a917f5 get rid of commandline args
Now pensieve.love always manages notes in the data/ subdirectory of the
save dir, and stores its settings in the 'config' file in the save dir.

And main.lua is now much more similar to upstream and most forks. I made
this edit using an external editor, just to keep the comparison with
lines.love in view.
2023-09-08 08:36:54 -07:00
Kartik K. Agaram 5f6184baa4 get rid of old_columns
It was a security blanket to get me to start deleting columns, and I've
never used it once.
2023-09-08 08:16:29 -07:00
Kartik K. Agaram 20ec9799f6 Merge lines.love 2023-09-04 15:18:54 -07:00
Kartik K. Agaram e74b92b733 show any error after switching to source editor
Error_message is a special global. It's set when the app (Current_app = 'run')
encounters an error and switches to the source editor, and cleared when
switching from source editor back to the app.
2023-09-04 15:07:54 -07:00
Kartik K. Agaram e25f596d8b Merge lines.love 2023-04-09 14:13:22 -07:00
Kartik K. Agaram 4b43e9e85d deemphasize the source editor
This repo does not support freewheeling modification. It's a primitive
to enable freewheeling modification in downstream forks.

The source editor is a convenience, but it's a sharp tool and can easily
leave the app in a broken state that requires dropping down to external
tools (editor, file manager) to fix.
2023-04-09 11:12:36 -07:00
Kartik K. Agaram 8be6417e47 clean up debug prints 2023-03-27 23:02:54 -07:00
Kartik K. Agaram 7f873025b8 bugfix
Scenario:
  * get 2 copies of a note on screen at once (say by running 'extract'
    on a note at the top of recent changes)
  * click on one of them to focus cursor on it
  * press ctrl-e to edit then again to stop editing
  * press ctrl-e again to edit, then hit enter

Before this commit the app would crash on an assertion failure; a pane's
line and line_cache were no longer in sync.

I'm fixing it by reloading all other copies of a pane from disk
immediately after writing it to disk. Which may well be massively
slower, but is a) likely cached by the OS, and b) not noticeable.

This bug has likely been present since 2022-11 (commit 813e06fd4d).
2023-03-27 22:50:21 -07:00
Kartik K. Agaram 7fc8aeb84f Merge lines.love
I've adjusted mouse_wheel_move to work even when there's no editable
pane. It could be improved though. This app really wants some sense of
acceleration.

I've also had to hack in a check for cursor_x/cursor_y being nil when
scrolling in an editable pane.
2023-03-23 21:35:49 -07:00
Kartik K. Agaram 99faf61abb mouse wheel support 2023-03-23 21:00:09 -07:00
Kartik K. Agaram fa95d945c2 extract fn to forestall future data loss 2023-02-13 09:13:14 -08:00
Kartik K. Agaram e64f69be36 Merge lines.love 2023-01-19 22:19:18 -08:00
Kartik K. Agaram 674042d4c7 no, turn vsync back on
I notice my laptop's fan starts coming on when running many of my apps.
An empty app takes 10% CPU where it used to take just 1-2%.
2023-01-19 22:14:08 -08:00
Kartik K. Agaram 4650e6f9c8 Merge lines.love 2023-01-16 10:22:46 -08:00
Kartik K. Agaram 15f56341df correct comment; vsync is hard to reason about 2023-01-16 10:20:46 -08:00
Kartik K. Agaram 0b4a3fea8f Merge lines.love 2023-01-16 09:56:25 -08:00
Kartik K. Agaram e7b37e39de disable vsync
Thanks Nils Berg for the suggestion!
2023-01-16 09:50:32 -08:00
Kartik K. Agaram 0719fdeaaf hoist out some common settings 2023-01-16 09:48:06 -08:00
Kartik K. Agaram d70f0265f2 Merge lines.love 2022-12-23 20:46:06 -08:00
Kartik K. Agaram f351ee2f8f fix some arg names 2022-12-23 20:43:37 -08:00
Kartik K. Agaram 7ef551b821 another missed rename 2022-12-23 20:43:30 -08:00
Kartik K. Agaram e0448d7d7f consistent names in a few more places 2022-12-23 19:32:58 -08:00
Kartik K. Agaram fab86cb6f0 Merge lines.love 2022-12-23 19:30:06 -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 3f8a3c454f no, the second experiment makes no sense
There can be many frames between a keypress and key release event.

I ran into this a couple of months ago.

keypress and textinput still happen on the same frame. Hmm.
I should just track when an event actually does any work, and only
plan_draw then. That way if keypress and textinput have disjoint cases
of activation there'll be no duplication.
2022-12-10 11:34:00 -08:00
Kartik K. Agaram fce6a0f4f8 limit number of columns 2022-12-03 21:09:08 -08:00
Kartik K. Agaram 4124d29339 monitor aggregate heap size over time 2022-11-15 23:39:01 -08:00
Kartik K. Agaram 6e5ca32665 Merge lines.love 2022-11-03 21:14:29 -07:00