Issue #1237 is caused by multiple content scripts being inserted in the
page. According to https://bugzilla.mozilla.org/show_bug.cgi?id=1491994
, declarations might be shared between inserted content scripts. This
means that we can implement a lock that the first content script would
grab and that would make the others fail to load entirely.
https://github.com/tridactyl/tridactyl/issues/1237 is caused by multiple
command lines being instantiated in the tab. All command lines receive
the "fillcmdline tabopen" message, only one receives the key events
generated by typing stuff in the command line and then they all receive
the "ex.accept_line" message.
There can be two causes ; either Firefox loads multiple Tridactyls
(unlikely) or we load multiple commandlines (more likely). Moving
command line creation out of init() should fix this as the worst that
can happen now when init() is called twice is that the command line is
re-inserted in the document (before that we could have created multiple
command lines).
https://github.com/tridactyl/tridactyl/issues/1237 is caused by multiple
command lines being instantiated in the tab. All command lines receive
the "fillcmdline tabopen" message, only one receives the key events
generated by typing stuff in the command line and then they all receive
the "ex.accept_line" message.
There can be two causes ; either Firefox loads multiple Tridactyls
(unlikely) or we load multiple commandlines (more likely). Moving
command line creation out of init() should fix this as the worst that
can happen now when init() is called twice is that the command line is
re-inserted in the document (before that we could have created multiple
command lines).
Before storing bindings in the config, bindings are first converted to
their canonical representation by using toMapstr. The problem is that
toMapstr returns " " instead of "<Space>" when asked to convert a
minimalkey representing a space.
This was a problem while trying to bind/unbind keys that were already
bound in the config (e.g. `unbind --mode=ex <Space>` to disable
inserting completions).
This commit fixes that. It also comes with a config updater in order to
make sure that we do not break `<Space>` bindings for users who might
have created some.
Previously, the focussed hint may be unfocussed after it's being hidden,
adding the `TridactylHintElem` class is again which makes it visible.
Also, undo a change to the filter if no hints remain. This is consistent
with the behavior of ignoring keys that wouldn't match any hints.
PR#1183 broke completions for users that had a tab -> buffer alias. This
is because having such an alias created a loop, which made
BufferCompletionSource throw errors when being instanciated, which
resulted in the activeCompletions array not being created.
This is fixed in two ways: first, a config updater is created in order
to remove the alias. Second, completions are instantiated in
try/catchs, which should hopefully prevent a faulty completion source
constructor from breaking every completion source.
Before this commit, hint -c would only use the `selectors` parameter in
order to find the elements it needed to add hints to. This was a problem
when using invocations such as `:hint -c a, b`, because `b` would be put
in the rest argument by the excmd parser and `:hint` would end up trying
to use the `a, ` selector alone, which isn't a valid selector and then
would make the whole command fail.
This commit fixes that by making sure `hint -c` uses all available
arguments as selectors.
By default, insertCSS and removeCSS operate in the active tab. This is a
problem when opening tabs in the background (e.g. with `hint -b`)
because the transformations will be applied to the current tab instead
of the newly opened one.
This commit fixes that.
Before this commit, editor functions that read or modified caret
position in input fields did not work on input fields the type of which
was "email". This was because browsers implement the selectionStart and
selectionEnd attributes only for a few input types.
This problem is fixed by first converting the input field to text,
applying the wanted modifications and then changing the input field's
type back to whatever it was before.
Closes#1209.