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
4b78434ea4
extract search into a module, improve it
2023-01-17 11:30:10 +00:00
fe25203bad
proof of concept search command
2023-01-17 11:03:30 +00:00
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
bf8fa80dac
tidy, remove debug prints
2023-01-16 21:07:56 +00:00
d62b9dea3e
repair command completions
2023-01-15 18:29:46 +00:00
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
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
c2c89b6dfd
fix buggy call to instr
2023-01-03 21:18:29 +00:00
cc0f881fed
fix tests for rename
2023-01-02 18:22:46 +00:00
d39d7059b9
Revert "inline temps and whitespace, improve update-widget-state"
...
This reverts commit 9775e00545
.
2023-01-02 18:20:19 +00:00
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
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
c1b7c2d777
add back button
2023-01-01 22:22:40 +00:00
bc17c3af6c
show url in echo area when it changes
2023-01-01 20:55:11 +00:00
055e8b792f
hide commander and print messages in echo area
2023-01-01 19:12:54 +00:00
1f93dc2310
tidying up
2023-01-01 19:12:39 +00:00
3fac6a2601
ESC cancels command
2023-01-01 11:10:14 +00:00
0f9d93630e
fixup da06309e75
2023-01-01 11:08:36 +00:00
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
7065b89c92
visit-location defaults to current
2022-12-31 17:33:20 +00:00
da06309e75
fix hardcoded visit-buffer param default
2022-12-31 16:46:34 +00:00
daa244c0b3
add switch-to-buffer command
2022-12-31 16:46:34 +00:00
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
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
e4ed51e137
add gtk stuff to show completions as user types
2022-12-31 16:46:34 +00:00
36edd12c6e
remove duplicated code
2022-12-31 16:46:34 +00:00
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
28080a1387
define-command parameters now specify a 'completer' function
2022-12-31 16:46:27 +00:00
0ea9ba1b92
remove dead code
2022-12-29 17:40:09 +00:00
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
bbd67b3a16
make entry widget a file-scoped local
2022-12-26 14:48:53 +00:00
6efbc34576
WIP show prompt for command parameters
2022-12-23 20:38:39 +00:00
2610930690
mark command.reset-state as private (except for tests)
2022-12-23 19:52:40 +00:00
8d871b20b8
define command parameters as array not kv table
...
a command should be able to say in which order it wants to ask for
unsupplied parameter values
2022-12-23 19:48:17 +00:00
a489df34ab
remove unneeded call to activate
2022-12-21 21:54:35 +00:00
1c1608fe1f
add invoke-interactively, for use in keymaps
...
move commander widget to Command.widget
2022-12-21 18:04:20 +00:00
491f3225b0
deactivate commander at startup
...
use M-x to activate it
2022-12-21 15:26:24 +00:00
0e103a673c
first pass at commands with args
...
very rudimentary ui, and only handles string args
2022-12-21 15:26:24 +00:00
87448bd5ee
add visit-location command
...
though it does hardcode the URL, making it less than generally useful
2022-12-20 11:14:27 +00:00
102afaa90e
add command parameters (as long as there are none)
2022-12-19 21:01:10 +00:00
38786d3790
add command line
2022-12-19 20:57:23 +00:00