This allows us to write the rc to OS. The only way to overwrite your current
rc file is to use mkt!, mktridactylrc! or mktridactylrc -f. mkt* commands
issued without the force/exclamation mark will not overwrite existing files.
Native messenger was updated to 0.1.11 and the mktridactylrc command is
unavailable in prior versions.
Fixed some random indentation errors that occurred in earlier commit.
This commit turns hint mode into a real mode. This required several
changes:
- In `src/content/hinting.ts`: create a function named getHintCommands
which returns an object containing functions that can be used as ex
commands.
- In `src/content/hinting.ts`: rewriting the `parser` function to have
it check the `hintmaps` object in the config and trigger these if
they're bound to anything. We can't use a generic parser because
vimperator hints need to catch every single keypress, even the ones
that aren't bound to anything and act on them.
- Creating `src/background/hinting.ts`, which just wraps ex commands
from src/content/hintings.ts in a proxy which will forward calls to the
content script.
BGSELF was a hack that I used when implementing ex commands for the
command line. It consisted of having .excmds_background.generated.ts
import itself as BGSELF in order to dynamically add commands to it. This
let us define excmds in other files while not changing anything in
parsers/exmode.ts.
This was awful so I decided to remove it. This required performing the
following changes:
- Moving text.* and ex.* command definitions to their own files where
they have zero side effects. While this was easy for text commands, ex
commands rely a lot on side effects. In order to work around this,
lib/commandline_cmds exports a single function, getCommandlineFns(),
which expects an object representing the commandline's state as
parameter.
- In the background script, import our side effect free files and wrap
them in proxys that will send "commandline_cmd" and "editorfn_content"
messages to tabs when needed.
- In the content script, add a listener that will either execute an
editor function or forward it to the command line when it receives an
"editorfn_content" message.
- In the commandline script, add a listener that will execute exmode
commands.
This rule requires adding a new set of rules, tslint-etc.
no-unused-declaration used to be available in tslint:recommended but was
deprecated when --noUnusedVariables was added to typescript. The problem
with using TypeScript's --noUnusedVariables is that it turns unused
declarations into an error and prevents compilation, which isn't fun
when you're just prototyping things.
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.
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.
profilecmd.code is not necessarily different from 0 if `find` doesn't
return any results. This commit makes sure getProfileDir() checks for
such situations.
This commit does two things:
- If the user didn't specify any arguments, try to detect what profile
is currently being used and specify it in the command passed to
firefox. This makes sure tabs opened with `:nativeopen` are opened
with the right profile if multiple firefox profiles are running.
- Quote url argument to enable adding spaces and quotes to the URL
(closes#555)
There were two problems: first, the format string used by terminator and
termite was wrong: tuicmd was appended after "%f", which resulted in
tridactyl telling the emulator to execute the file rather than the
tuicmd.
The second issue was that, as mentionned in
https://github.com/tridactyl/tridactyl/issues/1346, `-u` was missing
from terminator's options.
https://github.com/tridactyl/tridactyl/issues/1197 is a bug where
settings aren't properly loaded on `:source` because tridactyl performs
concurrent writes on the config. Making sure every function/excmd
returns its last promise restores synchronicity when it's needed and
should thus fix#1197.
Awaiting a promise before returning it doesn't make sense if the await
isn't in a try/catch as awaiting forces a function to be async and thus
turns its return value and any error it might throw into a promise.
Worse than that, it can result in an unnecessary context switch which
could be bad for performance.
commandline_background.ts:history() isn't used anywhere and is wrong (it
doesn't respect the historyresults setting) so this commit removes it.
Also, currentWindowTabs and allWindowTabs are both used in a single
place (respectively Tab and TabAll completions) and do not perform anything
complicated, thus it's better to have completions juste use browserBg
instead of manually messaging the background process.
This commit makes error messages when the native messenger is
unavailable easier to read. Since they're easier to read, there's no
need for custom errors in setclip/getclip anymore, provided that the
errors they throw are correctly logged. In order to make sure of that,
we remove the try/catch in excmds.ts:clipboard(), which should let
errors bubble up as needed.
I also noticed that while {set,get}Clipboard relied on the command line
being focused in order to work, they didn't do that themselves and
instead expected their callers to have set things up. This didn't make
sense to me so I moved the focusing code inside of {set,get}Clipboard.
This was all done while chasing the elusive #1135 but probably doesn't
change anything about it.
Gnome terminal doesn't work consistently: it doesn't block but some
distros add wrappers that will make it block when given the right
arguments. See https://github.com/tridactyl/tridactyl/issues/1035.
This partially reverts commit 698fc6a and 25af877. The completion
was causing breaking tabopen and other completions for people
with outdated native messengers.