2023-11-23 06:49:33 +00:00
|
|
|
# Lua Carousel
|
2022-08-14 17:17:53 +01:00
|
|
|
|
2023-11-23 18:43:13 +00:00
|
|
|
![screenshot](assets/1.png)
|
|
|
|
|
2023-11-23 06:49:33 +00:00
|
|
|
A lightweight environment for writing small, throwaway
|
|
|
|
[Lua](https://www.lua.org) and [LÖVE](https://love2d.org) programs. Tested on
|
|
|
|
Windows, Mac, Linux, iOS and Android. The environment itself can be modified
|
|
|
|
as it runs. In early release; please report issues, particularly with
|
|
|
|
usability or accessibility.
|
2023-05-30 09:11:12 +01:00
|
|
|
|
2023-07-01 21:22:05 +01:00
|
|
|
This repo is an example of a [Freewheeling App](http://akkartik.name/freewheeling),
|
|
|
|
designed above all to be easy to run, easy to modify and easy to share.
|
2022-06-07 02:33:44 +01:00
|
|
|
|
2023-01-25 02:46:40 +00:00
|
|
|
## Getting started
|
|
|
|
|
|
|
|
Install [LÖVE](https://love2d.org). It's just a 5MB download, open-source and
|
|
|
|
extremely well-behaved. I'll assume below that you can invoke it using the
|
|
|
|
`love` command, but that might vary depending on your OS.
|
2022-06-07 21:58:38 +01:00
|
|
|
|
2023-01-08 16:11:15 +00:00
|
|
|
Run this app from the terminal, [passing its directory to LÖVE](https://love2d.org/wiki/Getting_Started#Running_Games)
|
2022-06-07 02:33:44 +01:00
|
|
|
|
new file-system format for freewheeling apps
1. No more version history, now we have just the contents of the current
version.
2. Editing a definition no longer changes the order in which definitions
load.
This should make repos easier to browse, and more amenable to modify.
You don't need driver.love anymore. And a stable order eliminates some
gotchas. For example:
using driver.love, define `Foo = 3` in a definition
define `Bar = Foo + 1`
edit and redefine `Foo = 4`
Before this commit, you'd get an error when you restart the app.
Definitions used to be loaded in version order, and editing a definition
would move it to the end of the load order, potentially after
definitions using it. I mostly avoided this by keeping top-level
definitions independent. It's fine to refer to any definition inside a
function body, we only need to be careful with initializers for global
variables which run immediately while loading.
After this commit you can still end up in a weird state if you modify a
definition that other later definitions use. In the above example, you
will now see Foo = 4 and Bar = 4. But when you restart, Foo = 4 and Bar
= 5. But that's no more confusing than Emacs's C-x C-e. It's still
a good idea to keep top-level definitions order-independent. It's just
confusing in a similar way to existing tools if you fail to do so. And
your tools won't tend to break as badly.
Why did I ever do my weird version history thing? I think it's my deep
aversion to risking losing any data entered. (Even though the app
currently will seem to lose data in those situations. You'd need to
leave your tools to find the data.) Now I rely on driver.love's undo to
avoid data loss, but once you shut it down you're stuck with what you
have on disk. Or in git.
I also wasn't aware for a long time of any primitives for deleting
files. This might have colored my choices a lot.
2023-04-16 19:15:03 +01:00
|
|
|
## Hacking
|
|
|
|
|
2023-01-25 02:36:49 +00:00
|
|
|
To modify it live without restarting the app each time, download [the driver
|
2023-01-23 08:49:48 +00:00
|
|
|
app](https://git.sr.ht/~akkartik/driver.love). Here's an example session
|
2023-01-08 16:11:15 +00:00
|
|
|
using a fork of this repo:
|
2022-06-07 02:33:44 +01:00
|
|
|
|
2023-01-08 16:11:15 +00:00
|
|
|
![making changes without restarting the app](assets/2.gif)
|
2022-06-07 02:33:44 +01:00
|
|
|
|
2023-11-23 06:49:33 +00:00
|
|
|
(Only on non-mobile platforms for now.)
|
|
|
|
|
|
|
|
[Some reference documentation on how to create your own apps.](reference.md)
|
|
|
|
|
2023-12-14 02:19:34 +00:00
|
|
|
If the app being modified by the driver lives in a .love file, your changes
|
|
|
|
will go into the [save directory](https://love2d.org/wiki/love.filesystem.getSaveDirectory).
|
|
|
|
If it lives in a directory (like this repo), your changes will go straight
|
|
|
|
into the same directory.
|
new file-system format for freewheeling apps
1. No more version history, now we have just the contents of the current
version.
2. Editing a definition no longer changes the order in which definitions
load.
This should make repos easier to browse, and more amenable to modify.
You don't need driver.love anymore. And a stable order eliminates some
gotchas. For example:
using driver.love, define `Foo = 3` in a definition
define `Bar = Foo + 1`
edit and redefine `Foo = 4`
Before this commit, you'd get an error when you restart the app.
Definitions used to be loaded in version order, and editing a definition
would move it to the end of the load order, potentially after
definitions using it. I mostly avoided this by keeping top-level
definitions independent. It's fine to refer to any definition inside a
function body, we only need to be careful with initializers for global
variables which run immediately while loading.
After this commit you can still end up in a weird state if you modify a
definition that other later definitions use. In the above example, you
will now see Foo = 4 and Bar = 4. But when you restart, Foo = 4 and Bar
= 5. But that's no more confusing than Emacs's C-x C-e. It's still
a good idea to keep top-level definitions order-independent. It's just
confusing in a similar way to existing tools if you fail to do so. And
your tools won't tend to break as badly.
Why did I ever do my weird version history thing? I think it's my deep
aversion to risking losing any data entered. (Even though the app
currently will seem to lose data in those situations. You'd need to
leave your tools to find the data.) Now I rely on driver.love's undo to
avoid data loss, but once you shut it down you're stuck with what you
have on disk. Or in git.
I also wasn't aware for a long time of any primitives for deleting
files. This might have colored my choices a lot.
2023-04-16 19:15:03 +01:00
|
|
|
|
2022-06-07 02:33:44 +01:00
|
|
|
## Keyboard shortcuts
|
|
|
|
|
2023-11-23 06:49:33 +00:00
|
|
|
Within the editor widget:
|
2023-01-08 16:11:15 +00:00
|
|
|
|
2022-06-07 02:33:44 +01:00
|
|
|
* `ctrl+f` to find patterns within a file
|
|
|
|
* `ctrl+c` to copy, `ctrl+x` to cut, `ctrl+v` to paste
|
|
|
|
* `ctrl+z` to undo, `ctrl+y` to redo
|
|
|
|
* `ctrl+=` to zoom in, `ctrl+-` to zoom out, `ctrl+0` to reset zoom
|
2022-06-17 18:28:25 +01:00
|
|
|
* `alt+right`/`alt+left` to jump to the next/previous word, respectively
|
2022-11-19 08:11:39 +00:00
|
|
|
* mouse drag or `shift` + movement to select text, `ctrl+a` to select all
|
2022-06-07 02:33:44 +01:00
|
|
|
|
2022-08-14 17:17:53 +01:00
|
|
|
Exclusively tested so far with a US keyboard layout. If
|
2022-06-07 21:48:59 +01:00
|
|
|
you use a different layout, please let me know if things worked, or if you
|
2022-06-09 20:16:03 +01:00
|
|
|
found anything amiss: http://akkartik.name/contact
|
2022-06-07 21:48:59 +01:00
|
|
|
|
2022-05-30 01:03:01 +01:00
|
|
|
## Known issues
|
2022-05-21 18:36:27 +01:00
|
|
|
|
2022-05-18 06:05:00 +01:00
|
|
|
* No support yet for Unicode graphemes spanning multiple codepoints.
|
2022-05-21 18:36:27 +01:00
|
|
|
|
2022-07-08 22:16:48 +01:00
|
|
|
* No support yet for right-to-left languages.
|
|
|
|
|
2023-04-22 07:16:51 +01:00
|
|
|
* Undo/redo may be sluggish in editor windows containing large files. Large
|
|
|
|
files may grow sluggish in other ways.
|
2022-06-05 18:26:35 +01:00
|
|
|
|
2022-06-10 22:19:27 +01:00
|
|
|
* If you kill the process, say by force-quitting because things things get
|
|
|
|
sluggish, you can lose data.
|
|
|
|
|
2022-06-03 21:32:42 +01:00
|
|
|
* Can't scroll while selecting text with mouse.
|
|
|
|
|
2023-11-23 06:54:08 +00:00
|
|
|
* Some colors can't be customized yet.
|
|
|
|
|
2023-11-23 18:40:04 +00:00
|
|
|
## Contributors
|
|
|
|
|
|
|
|
Many thanks to Mike Stein for code, feedback and suggestions.
|
|
|
|
|
2022-06-07 02:33:44 +01:00
|
|
|
## Mirrors and Forks
|
|
|
|
|
2023-01-19 04:30:37 +00:00
|
|
|
This repo is a fork of [lines.love](http://akkartik.name/lines.html), an
|
|
|
|
editor for plain text where you can also seamlessly insert line drawings.
|
2023-11-23 06:49:33 +00:00
|
|
|
Its immediate upstream is [the template repo for freewheeling apps](https://git.sr.ht/~akkartik/template-live-editor).
|
|
|
|
Updates to it can be downloaded from the following mirrors:
|
2022-06-15 21:35:55 +01:00
|
|
|
|
2023-11-23 06:49:33 +00:00
|
|
|
* https://git.sr.ht/~akkartik/carousel.love
|
2024-01-31 23:27:03 +00:00
|
|
|
* https://tildegit.org/akkartik/carousel.love
|
2023-11-23 06:49:33 +00:00
|
|
|
* https://nest.pijul.com/akkartik/carousel.love (using the Pijul version control system)
|
2022-07-02 23:23:44 +01:00
|
|
|
|
2022-08-14 17:17:53 +01:00
|
|
|
Further forks are encouraged. If you show me your fork, I'll link to it here.
|
2022-07-02 23:23:44 +01:00
|
|
|
|
2022-06-07 02:33:44 +01:00
|
|
|
## Feedback
|
|
|
|
|
|
|
|
[Most appreciated.](http://akkartik.name/contact)
|