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.
It seems the actual change in PR #1150 (a09a771) has been lost in its merge (6562699).
This should now actually fix Issue #1084 and ignore hidden tabs when cycling through tabs.
As discussed on riot, turning noiframeon into a site-specific setting
is a good thing for consistency. This commit also adds a deprecation
warning when users try to `:set noiframeon` and updates the
troubleshooting guide.
The try/catch in init() prevents errors from bubbling up and thus
also prevents the document.addEventListener("DOMContentLoaded", init)
call from being performed. We fix this by removing the try/catch from
init() and adding a new one in the document.addEventListener call.
https://github.com/tridactyl/tridactyl/pull/1194 introduced a huge bug.
Config.get relies on config.getURL returning undefined when a target
doesn't exist for a url in order to know whether it should return the
default value or not. However, #1194 accidentally made getURL return
empty objects for every target that does not have a url-specific
setting.
This commit fixes that and maybe
https://github.com/tridactyl/tridactyl/issues/1197, although I am not
100% sure.
[[ is a bashism and is not defined in posix sh. Since the shebang is
#!/bin/sh, the build script is executed with posix sh and this caused
error messages to be printed when building.
[[ couldn't just be replaced with [ because [ doesn't allow matching
globs, so a switch/case was used instead.
sed and base64 have different flags on darwin (and possibly other
BSDs). Alternatively we could encourage the user to install coreutils and use
gsed and gbase64.
https://github.com/tridactyl/tridactyl/issues/1193 happened because
before this commit, getURL did not merge objects from different
site-specific configs. This means that if a user had the following site
specific configs:
"example": {
"priority": 1,
"nmaps": {
"a": "js alert('')"
},
}
"example.org": {
"priority": 2,
"nmaps": {}
}
A call to config.getURL("example.org", ["nmaps"]) resulted in the empty
object from the "example.org" config being returned and the mappings for
"example" to be ignored. This obviously is not the desired behavior.
This is fixed by mergeDeep()'ing objects found in matching site-specific
configs.
Closes#1193.
One of the possible problems of #1184 (firefox freezing periodically
with Tridactyl enabled) is that Tridactyl uses too much RAM, which could
cause Firefox to attempt to GC it from time to time.
One easy optimisation to try to reduce this problem is to use singletons
for metadata when possible (VoidType, AnyType...).
According to my measurements, this saves the allocation of 933 objects,
which amounted to ~0.03MB. Multiply this by 40 tabs and you get about
1.20MB saved, the space of a whole 1980-era floppy disk.