Commit Graph

64 Commits

Author SHA1 Message Date
Kartik K. Agaram 95d88a8298 use editor state font for width calculations 2024-01-12 05:23:06 -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 5d4fd4aa93 fix still more issues with the previous scenario
- source editor always expects relative paths
- refresh mocked data

There's still one issue after this: the font size saved in the config
file is the one we use in tests. More broadly, Editor_state is
completely wrong.

Ideally I'd just not save any settings for the source editor if the
tests fail.
2024-01-12 03:35:22 -08:00
Kartik K. Agaram aa6bfb4b15 moar bugfix X-( 2023-12-29 12:02:45 -08:00
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 715c6fd32f source: show file being edited in window title bar 2023-09-15 13:36:27 -07:00
Kartik K. Agaram 76f119b7b9 hide line numbers from log browser 2023-09-15 13:30:42 -07:00
Kartik K. Agaram 1fd30c0462 always show line numbers in source editor
The drawing buttons are now absolutely positioned, which is a horrible
hack. But for just the source editor it seems good enough. The
alternative is to modify magic constants in all the tests :/
2023-09-14 22:27:38 -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 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 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 e68261d7a3 bugfix: preserve window position 2023-07-10 15:50:47 -07:00
Kartik K. Agaram 637e28f300 port inscript's bugfix to source editor 2023-06-04 12:33:23 -07:00
Kartik K. Agaram eb55e18e1d hide cursor in log browser window 2023-05-14 17:25:07 -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 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 0b1c47f79f experiment at avoiding some merge conflicts
https://merveilles.town/@akkartik/110084833821965708
2023-03-25 10:36:43 -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 1b90ffca9e extract a function 2023-03-18 23:48:42 -07:00
Kartik K. Agaram e8d6a8a26d consistently use App names for methods everywhere 2023-03-18 23:45:01 -07:00
Kartik K. Agaram 8c373fdb60 get rid of all bifold text
It's just uneconomic to maintain given how little I've used it. I have a
bug right now and no time to port the bugfix to all the complexities of
the B side.

I briefly considered tossing out the entire source editor. But I _have_
been using it to browse logs across sessions. The live editor doesn't
quite cover all my use cases just yet.

We now have duplication in the source editor only for:
* syntax highlighting
* hyperlinking [[WikiWords]]
* ability to hide cursor (when showing file browser or Focus is in log browser)
2023-03-17 21:48:29 -07:00
Kartik K. Agaram d65b7950a1 state validation in source editor as well 2023-03-17 10:46:50 -07:00
Kartik K. Agaram 266de35f87 create a place for graphical log handlers
Currently only used in pong.love, but let's keep the bad merge that had
it broken since September from occurring again. To do that we'll be
consistent across forks on where globals are initialized.

I haven't appreciated the implications of main.lua for load order.
log.lua comes first just because it's shared by both the main app and
its 'source' editing environment. And it just so happens that source.lua
was loading after log.lua resulting in the pong.love breakage. Now let's
lean into that and enshrine that one should initialize log_render in
log.lua.
2023-01-30 10:20:37 -08:00
Kartik K. Agaram 0719fdeaaf hoist out some common settings 2023-01-16 09:48:06 -08:00
Kartik K. Agaram c7de47440b typo 2023-01-01 17:59:10 -08:00
Kartik K. Agaram e0448d7d7f consistent names in a few more places 2022-12-23 19:32:58 -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 076611fbb5 save state when clearing logs 2022-12-05 15:50:19 -08:00
Kartik K. Agaram f9bea7783b source editor: clear logs 2022-12-05 15:26:38 -08:00
Kartik K. Agaram 0167c57cdf consume a mouse click when switching sides
This way we can have the log side actually take focus sometimes.
2022-12-05 15:04:54 -08:00
Kartik K. Agaram d1d05fe5c9 migrate old settings, attempt #3
This time we have to handle absolute filenames.
Now lines-polygon-experiment fork should merge successfully, at least.
2022-09-19 00:53:25 -07:00
Kartik K. Agaram 6ac45b75b9 ugh, missed deleting an arg 2022-09-19 00:43:31 -07:00
Kartik K. Agaram 2f7b08fb8b handle missing cursors in settings 2022-09-19 00:41:37 -07:00
Kartik K. Agaram 12b1d19761 source: load cursor position from settings 2022-09-19 00:17:36 -07:00
Kartik K. Agaram 34dc49849b source: no commandline args 2022-09-19 00:16:20 -07:00
Kartik K. Agaram 76243382d7 source: remember cursor position of multiple files 2022-09-19 00:10:12 -07:00
Kartik K. Agaram aae35c7e04 source: support only relative paths within the app 2022-09-19 00:08:52 -07:00
Kartik K. Agaram 6d1dee38f0 bugfix: mouse clicks on file navigator above log browser side 2022-09-18 23:55:04 -07:00
Kartik K. Agaram cf227f9031 delete a duplicate filename candidate 2022-09-18 01:54:32 -07:00
Kartik K. Agaram d141822e6c filter candidates in file navigator 2022-09-18 01:53:36 -07:00
Kartik K. Agaram 141d41aec5 hide editor cursor while in file navigator 2022-09-18 01:32:23 -07:00
Kartik K. Agaram 936d3b4616 bugfix: disable typing while file navigator is open 2022-09-18 01:28:05 -07:00