Commit Graph

86 Commits (main)

Author SHA1 Message Date
Daniel Barlow a5a65006ca make keyboard completions work
1. When adding a button to flowbox, the flowbox widget interposes a
flowboxchild between the two, which can receive events and so becomes
part of the tab order. this is why our buttons weren't getting
activated - they weren't focused even though they looked focused.  So,
use labels instead of buttons for completions

2. For some reason I don't understand, flowboxchild widgets receive
:activate *only* on keyboard activation. So instead of using it,
we connect to :child-activated on the flowbox.

3. Setting widget:on_foo *adds* a handler to the widget instead of
replacing what was previously there. There is no nice way to remove
handlers from a widget either. Because we need a new
on_child_activated handler every time the completions change,
the only way I can see to achieve this is to create the flowbox
afresh on each keystroke instead of creating it once when the
frame is created
2023-01-17 21:54:31 +00:00
Daniel Barlow d76769752b rename function 2023-01-17 13:11:25 +00:00
Daniel Barlow c09138ad02 link to fennel-lang/style and explain the departures from it 2023-01-17 11:46:29 +00:00
Daniel Barlow 4b78434ea4 extract search into a module, improve it 2023-01-17 11:30:10 +00:00
Daniel Barlow fe25203bad proof of concept search command 2023-01-17 11:03:30 +00:00
Daniel Barlow 3a577b71d8 url completion allows current text as a completion option
whatever the user has typed, it should be allowable as a
URL otherwise we can only visit locations we've already been to
2023-01-17 10:45:19 +00:00
Daniel Barlow bf8fa80dac tidy, remove debug prints 2023-01-16 21:07:56 +00:00
Daniel Barlow d62b9dea3e repair command completions 2023-01-15 18:29:46 +00:00
Daniel Barlow d962dd7c41 trim outdated stuff 2023-01-15 18:23:10 +00:00
Daniel Barlow 34fb1b2ff4 revisit completer/completion api
A completion is now a table with attributes :text, :widget, :value
A completer returns an array of completions

This means we can now render URL completions with the page title
as well as the URL
2023-01-15 16:55:22 +00:00
Daniel Barlow 4d3a2bf237 complete command names
we really need to make TAB and Return work for keyboard-selecting
a proffered completion
2023-01-03 23:36:58 +00:00
Daniel Barlow c2c89b6dfd fix buggy call to instr 2023-01-03 21:18:29 +00:00
Daniel Barlow 24613ea424 hook up the history logger thing 2023-01-02 22:03:03 +00:00
Daniel Barlow 3cbe77a55e sqlite-based browsing history api
not hooked up to actual browsing actions yet
2023-01-02 21:25:36 +00:00
Daniel Barlow cc0f881fed fix tests for rename 2023-01-02 18:22:46 +00:00
Daniel Barlow d39d7059b9 Revert "inline temps and whitespace, improve update-widget-state"
This reverts commit 9775e00545.
2023-01-02 18:20:19 +00:00
Daniel Barlow 561c717609 rename on-activate as on-input-finished
it's just too easily confused with "active" as in commander state.active
2023-01-01 22:32:50 +00:00
Daniel Barlow 9775e00545 inline temps and whitespace, improve update-widget-state
update-widget-state accepts a second parameter which duplicates
information available in self.state. This commit gets rid of
some not all of it
2023-01-01 22:23:07 +00:00
Daniel Barlow c1b7c2d777 add back button 2023-01-01 22:22:40 +00:00
Daniel Barlow bc17c3af6c show url in echo area when it changes 2023-01-01 20:55:11 +00:00
Daniel Barlow 055e8b792f hide commander and print messages in echo area 2023-01-01 19:12:54 +00:00
Daniel Barlow 1f93dc2310 tidying up 2023-01-01 19:12:39 +00:00
Daniel Barlow b1bdc326ef WIP popup commander 2023-01-01 16:49:15 +00:00
Daniel Barlow c3e9c14186 index->string allows printing keystrokes readably 2023-01-01 15:08:45 +00:00
Daniel Barlow ad2628ddfc accept C-g to cancel key sequence 2023-01-01 12:03:15 +00:00
Daniel Barlow a81d9d4d4c remove hardcoded keyvals 2023-01-01 11:27:33 +00:00
Daniel Barlow 3fac6a2601 ESC cancels command 2023-01-01 11:10:14 +00:00
Daniel Barlow 0f9d93630e fixup da06309e75 2023-01-01 11:08:36 +00:00
Daniel Barlow 862780878c clean up the spew file a bit 2023-01-01 00:15:26 +00:00
Daniel Barlow 64d4dfe2ff hook up progress-bar, uri display
the road to callback hell is plagued with good intentions:
I am not unwilling to revisit this code if it gets any more gnarly
2023-01-01 00:11:01 +00:00
Daniel Barlow 39735be891 unnest conditionals in keymap recogniser 2022-12-31 23:49:41 +00:00
Daniel Barlow ec391a9e57 delete unused params 2022-12-31 23:24:38 +00:00
Daniel Barlow 7065b89c92 visit-location defaults to current 2022-12-31 17:33:20 +00:00
Daniel Barlow da06309e75 fix hardcoded visit-buffer param default 2022-12-31 16:46:34 +00:00
Daniel Barlow daa244c0b3 add switch-to-buffer command 2022-12-31 16:46:34 +00:00
Daniel Barlow 69d8aa4131 detect and discard modifier-only key events
for recognising key sequences, we only want  to look at
events containing non-modifier keystrokes
2022-12-31 16:46:34 +00:00
Daniel Barlow cc2caae372 all commands are called with frame as well as declared params
the commander is per-frame, so this is in the nature of a
"context" parameter
2022-12-31 16:46:34 +00:00
Daniel Barlow b8d86c65cb invoke command.function with completion value not string
this means a function that wants a buffer (for example) gets called
with the actual buffer not the buffer name
2022-12-31 16:46:34 +00:00
Daniel Barlow e4ed51e137 add gtk stuff to show completions as user types 2022-12-31 16:46:34 +00:00
Daniel Barlow 36edd12c6e remove duplicated code 2022-12-31 16:46:34 +00:00
Daniel Barlow fb834f496c rename on-input -> on-activate
it's only called when RET is pressed, not during editing
2022-12-31 16:46:34 +00:00
Daniel Barlow 28080a1387 define-command parameters now specify a 'completer' function 2022-12-31 16:46:27 +00:00
Daniel Barlow 0ea9ba1b92 remove dead code 2022-12-29 17:40:09 +00:00
Daniel Barlow 6454620307 ignore generated file 2022-12-29 17:34:51 +00:00
Daniel Barlow 454f9ae094 use overmind to restart dying test runners 2022-12-29 17:21:50 +00:00
Daniel Barlow 5069e6aff1 move command state into per-frame table
lots of dependent changes here, unfortunately

- get rid of Buffer.current (it's per-frame now)
- in define-command, functions providing default parameter values
   now accept frame as parameter
- in keymaps, parameter values are functions that accept frame as
   parameter
2022-12-27 12:25:50 +00:00
Daniel Barlow dea9d925a5 add lume module 2022-12-27 12:23:24 +00:00
Daniel Barlow dd139c9796 express keymap bindings as [command-name args]
instead of using functions directly. This is so that the
appropriate frame-relevant commander can be used to execure
the command, but also makes the keymaps a little less opaque
2022-12-26 16:53:41 +00:00
Daniel Barlow a5612fce2a some musing about switch-to-buffer 2022-12-26 14:48:53 +00:00
Daniel Barlow bbd67b3a16 make entry widget a file-scoped local 2022-12-26 14:48:53 +00:00