Because of a firefox bug (
https://bugzilla.mozilla.org/show_bug.cgi?id=1504775 ), indexes are not
necessarily contiguous. This becomes an issue in tabnext and tabprev as
these two functions expect contiguous indexes.
We circumvent this issue by grabbing an array of all tabs for the
current window, sorting them by index and the using their index within
that array in order to decide what tabs should be selected.
This fixes https://github.com/tridactyl/tridactyl/issues/990 .
Before this commit, Tridactyl used to "stick" at a page's edge. This was
caused by some values (namely lastX and lastY) that should have been
cached not being cached, resulting in Tridactyl trying to start
scrolling from the wrong element.
While testing this fix, I noticed that scrolling could be extremely slow
on large pages (e.g. https://stripe.com/docs/api). I attempted to fix
that by switching from a dumb parent/childNode traversal to a
TreeWalker-based traversal. While this helps a lot, scrolling can still
be slow on such pages.
Before this commit, the compiler pass that generated metadata for
settings didn't generate informetion precise enough to be used to
validate settings that existed in objects (e.g. `logging.cmdline`).
This resulted in no typechecking being done for these settings (e.g.
`:set logging.cmdline 1` would not throw any errors). This commit fixes
that.
This commit turns every numerical config settings into numbers.
Previously, they were stored as string as casting the arguments of the
set excmd was slightly complicated. However, now that arguments are
automatically cast, there is no reason to keep using strings.
In fact, switching to number makes things simpler and fixes a few bugs
where the config setting was accessed without being cast, like in
text_to_speech.ts or completions/History.ts.
This commit makes the compiler pass use different classes in order to
represent the metadata. This enables adding per-class toString/convert
functions. This enables easy type checking and conversion in the `:set`
excmd.
This commit renames tutorial pages with the number in which they are
visited by the user. This helps when you need to add a new page and want
to link to the previous/next one in it.
It also adds a new page about the native messenger which describes what
it does and how to install it. I took this opportunity to rename
installnative to nativeinstall and to add an ex alias that goes the
other way.
Last, this commit mentions that `:help` also accepts settings and keys
as argument and that we now have a troobleshooting guide.
Before this commit, keyEvents was never reset. This caused weird issues
like control closing the commandline after a first ex command had been
accepted. We now reset keyEvents in two places ; when an ex command is
accepted (which could happen when inserting a completion, for example)
and when the command line is closed (which could be triggered by an
outside event).
This commit merges ex and insert commands that behave the same under a
single text.* namespace. document.activeElement is used in order to
figure out if the command should move the caret in the page or in the
command line.
We re-use the ex-command parser in order to enable rebinding keys in
command-line mode. Command-line manipulation is re-implemented using
previously-abstracter editor commands.
This addresses issue #772 and adds functionality for "basic" tab and window
undo. Supplying either tab or window to the undo excmd will explicitly restore
the most recently closed item of the specified type.
Undo now has a return value of the [tab|window]Id or -1 if no matches are made.
Currently it looks like window ids aren't being used/kept when closed so that
might be a small gotcha.
This does not address the problem of the currently default "recent" mode where
seemingly random windows are reopened when no tabs fitting the current window id
are available.
U is now bound to `undo window` to specifically reopen windows.
This commit moves the content of the im_* functions to their own file,
lib/editor.rs. This enables a bit of refactoring since the functions are
not subject to the constraints set by the macro preprocessor. This also
makes re-using the editor functions later easier.