Before this commit, Tridactyl had a bug where resizeArea could be called
before completion computation had ended, which resulted in completions
pushing the input field out of the viewport (easy way to reproduce this:
open a lot of tabs and press `b` to open buffer completions).
This happened because for some of the completion sources, `filter`
returned before completion computation had actually ended. This is fixed
by making sure that filter() (and all underlying calls to updateOptions,
onInput, updateChain...) return a promise that will only be resolved
once completion computation has actually ended.
One of the problems of the command line was that it made a resizeArea()
call for each enabled completion, no matter whether its status was
"hidden" or "normal". This was a problem because a resizeArea call
results in 2 cross-script messages: a "show" and a "focus" message. This
means that for each keystroke, we sent 28 messages. This commit fixes
that thanks to modifications in multiple files:
- commandline_frame.ts: Stop accumulating event listeners on resizeArea
calls. Make sure completion sources actually need a refresh before
calling resizeArea().
- completions.ts: Add logic to know whether a completion source needs a
refresh or not.
- {Rss,Sessions,Tab,TabAll,Window}.ts: Make sure that completions are
actually needed before computing them.
This seems to make opening the command line slightly faster for me,
although I can't tell if this is placebo or not.
This commit removes commandline_background.ts. I believe this is useful
because the only thing it did was provide recvExStr, which just
triggered a synthetic "onLine" event the only consumer of which was the
parser. Since we already used controller_background + acceptExCmd in
some places, it made sense to me to directly use controller_background +
acceptExCmd everywhere.
Using `-w newtab` wouldn't allow us to use selectors with `-c`, and
using composite would always open a new empty tab on cancel (esc).
Other changes:
- Better flag handling in hint().
- `-c` is now a flag (can be combined with others like `-t`), and is
handled in the `default` case
- support flags `-c`, `-J` and `-t` in any position
https://github.com/tridactyl/tridactyl/pull/1355 introduced a bug on
systems where profile names do not match profile paths. Fixing it
required implementing proper profiles.ini parsing, which should help
making profile discovery work on windows.
The new getProfileDir() function breaks compatibility with previous
versions. The previous version turned backslashes into slashes on
windows. I believe doing this is wrong since paths such as
`C:/Users/Bob` do not make any sense on windows. They might work in
mingw and wsl but I believe we should aim to have everything work on
'normal' windows.
- Fix `find` in bodgecss.sh appending an extra /
- Remove bashism from bodgecss.sh which doesn't work in 3.2 (macos
default)
- Remove `-p .` from mktemp which is unnecessary and doesn't exist on macos.
Having `:editor` in the background script and constantly messaging the
content one to update the page doesn't really make sense. This commit
moves `:editor` to the content script and thus simplifies the code a
little bit.
All functions in native_background.ts use browserBg in order to interact
with the native messenger. This means that these functions can also be
used in the content script. This means that there's no point in keeping
these functions in the background/ folder and that there's no point in
having a native_background message type.