drop file on window to switch to it

This commit is contained in:
Kartik K. Agaram 2023-01-20 14:25:15 -08:00
parent 0fdc40a03e
commit 1fb0cdf736
4 changed files with 11 additions and 1 deletions

1
0108-fwmanifest Normal file
View File

@ -0,0 +1 @@
{"on.key_release":15,"Cursor_editor":16,"on.file_drop":108,"on.mouse_press":63,"on.mouse_release":59,"Filename":85,"Screen_top":87,"initialize_editors":96,"on.draw":105,"fw_app":"broadsheet","resync_editors":107,"fw_parent":107,"on.load_settings":95,"on.resize":98,"on.keychord_press":99,"on":1,"Editors":6,"on.text_input":69,"on.save_settings":88,"on.initialize":94,"Font_height":86}

7
0108-on.file_drop Normal file
View File

@ -0,0 +1,7 @@
on.file_drop = function(dropped_file)
if dropped_file:getFilename() == Editors[1].filename then
initialize_editors(Editors[1].font_height, Editors[1].filename, Editors[1].screen_top1)
else
initialize_editors(Editors[1].font_height, dropped_file:getFilename(), {line=1, pos=1})
end
end

View File

@ -16,6 +16,8 @@ with a file path to edit.
$ path/to/love path/to/broadsheet.love path/to/file
```
To open a different file, drop it on the broadsheet.love window.
To modify it live without restarting the app each time, install [the driver
app](https://codeberg.org/akkartik/driver.love). Here's an example session
with a different freewheeling app:

2
head
View File

@ -1 +1 @@
107
108