Commit graph

699 commits

Author SHA1 Message Date
Nathan Collins
d887ddcaca [docs] Improve formatting, add example
Some of the lists were not formatted as lists and so rendered
poorly.
2018-11-20 11:23:34 -08:00
Nathan Collins
033c7f7597 [docs] Explain bind example
The most complicated example in the bind docs is exactly what I was
trying to setup, but I didn't understand what it did when I first saw
it.
2018-11-20 10:45:30 -08:00
glacambre
2ed20bf47f
{excmds,config}.ts: Turn tab{first,last} into aliases
Closes #1171.
2018-11-19 18:38:33 +01:00
glacambre
c412c8dad0
Rename buffers to tabs
Note: The CSS class names are kept as they were, see #1183 for more
information.
2018-11-19 18:35:37 +01:00
glacambre
9bf5ad1cc5
Update doc links
Issue #1176 was introduced in #1026. It should have been fixed in #1157
but slipped through the cracks. It made me realize that a few other
links were broken and so I fixed them.

Closes #1176.
2018-11-16 19:52:50 +01:00
pale3
3cf0307945
xselpaste: allow primary select paste using <S-Insert>
currently it only works on web pages and not within commandline! Cos
windows platform dosn't have primary selection, execution of <S-Insert> will silently fail
2018-11-10 17:24:23 +01:00
glacambre
56fe0d9d7e
excmds.ts: Update guiset documentation links
Fixes https://github.com/tridactyl/tridactyl/issues/1104
2018-11-08 07:03:58 +01:00
glacambre
cd55b6f0f8
Update documentation links
As cmcaine said in #1149, the help page links are currently broken
because typedoc tries to generate documentation for source files in the
`compiler/` directory. I just realized that before #1026, these files
were not referenced in any of the files in the `src` directory and this
is why typedoc ignored them. This change happened because I wanted to
type the metadata.

There are three possible solution to #1149.
- Go back to untyped metadata.
- Move the metadata types to Tridactyl's src directory on build.
- Update all links to the doc.

I believe having typed metadata is useful and I'd like to keep it that
way. Moving the metadata types to Tridactyl's src directory is certainly
doable but doesn't sound like the best idea to me, we're unnecessarily
copying files. Updating the links to the doc sounds reasonable as it's
only a one-time thing and so this is what this commit does in order to
close #1149.
2018-11-08 07:00:35 +01:00
glacambre
7b5f7ef298
Minor code cleanups
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.
2018-11-07 06:21:36 +01:00
Oliver Blanthorn
9cf2c2f205
Hide fullscreen internal constant 2018-11-06 12:42:45 +00:00
Oliver Blanthorn
3bdd795e81
Merge pull request #1147 from glacambre/fix_commandline_space
Fix commandline failing to insert spaces in middle of words
2018-11-06 09:08:44 +00:00
glacambre
3d878a5ac3
excmds.ts: Don't rely on activeTab().index for tabprev/tabnext
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 .
2018-11-06 07:55:14 +01:00
glacambre
b30c68fa51
Fix commandline failing to insert spaces in middle of words
Before this commit, it was impossible to insert a space in the middle of
a word in the command line ; the space would always be inserted at its
end.
2018-11-06 02:19:34 +01:00
Oliver Blanthorn
7f034a161c
Merge branch 'type_compiler' 2018-11-05 13:24:35 +00:00
glacambre
170ce78115
scrolling.ts: Fix sticky scrolling
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.
2018-11-05 07:19:41 +01:00
glacambre
b5da7705e9
Improve generated metadata types for objects
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.
2018-11-04 17:28:15 +01:00
glacambre
d80fa64b03
Turn numerical config settings into numbers
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.
2018-11-04 17:28:11 +01:00
glacambre
4d0f7c84eb
Make the generated metadata typed
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.
2018-11-04 17:24:16 +01:00
Oliver Blanthorn
d796f3bf14
Merge branch 'generic_cmdline' 2018-11-04 12:28:31 +00:00
glacambre
946e8031ad
Various tutorial improvements
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.
2018-11-03 08:06:30 +01:00
glacambre
def94f795d
Document ex.* functions 2018-11-02 06:33:09 +01:00
glacambre
c0bffbd4e3
commandline_frame.ts: Remove unnecessary insert_completion_or_space fn 2018-11-01 18:43:59 +01:00
Oliver Blanthorn
2119bbea3e
Merge branch 'undo-tab-window-recent' 2018-11-01 17:27:48 +00:00
glacambre
b680cc638c
Document editor functions 2018-11-01 16:39:16 +01:00
glacambre
1b6b712c2b
excmds.ts: Merge ex/insert commands
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.
2018-11-01 15:54:31 +01:00
Anton Vilhelm Ásgeirsson
e0fdeeb54e Add error handling to undo excmd and remove session limit. 2018-11-01 13:32:12 +00:00
Oliver Blanthorn
b4cab5afe0
Mention that find mode is broken 2018-10-31 14:29:29 +00:00
glacambre
00c01ec6ec
Enable rebinding keys in 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.
2018-10-31 08:16:58 +01:00
Anton Vilhelm Ásgeirsson
7bae3e77ae Refactor undo excmd to explicitly undo tabs, windows or recent.
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.
2018-10-30 20:06:04 +00:00
glacambre
61499fa19a
excmds.ts: Move content of im_* functions to lib/editor.ts
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.
2018-10-30 09:10:49 +01:00
Oliver Blanthorn
454a63e779
Merge pull request #1110 from WhiteAbeLincoln/master
Add Fullscreen{Change,Enter,Left} autocommand events
2018-10-29 10:53:40 +00:00
glacambre
26169efea1
excmds.ts: Fix setpref breaking user.js when value contains spaces
Before this commit, `:setpref my_pref "my value"` broke user.js by only
writing '"my' to the file. This created a syntax error and prevented
firefox from reading the rest of the file. This commit fixes that.
2018-10-27 13:20:18 +02:00
Abraham White
bcfdd1dadb Mark fullscreenhandler function as hidden from docs 2018-10-25 22:59:47 -06:00
Abraham White
2563ddd505 Rename prefixed variable to prevent future name clashes 2018-10-25 22:54:25 -06:00
Abraham White
985e20cf5c Add Fullscreen{Change,Enter,Left} autocommand events 2018-10-25 22:40:25 -06:00
glacambre
f5873ea5ca
excmds.ts: Make idFromIndex('#') default to activeTab if no prev tab
This commit makes idFromIndex("#") return the id of the currently active
tab instead of undefined when only one tab is open. This makes
Tridactyl's "#" behavior closer to vim's, but not 100% the same.

This closes https://github.com/tridactyl/tridactyl/issues/918 .
2018-10-25 07:52:17 +02:00
Oliver Blanthorn
42384cf0a7
Add reloadallbut command 2018-10-19 12:39:48 +01:00
Oliver Blanthorn
44f4714e31
Merge branch 'trigdactyl' 2018-10-17 21:05:31 +01:00
Oliver Blanthorn
aeb491f55e
Update scrollto documentation 2018-10-17 21:05:19 +01:00
Oliver Blanthorn
701ac4c4d0
Merge branch 'setpref' 2018-10-17 20:58:52 +01:00
Oliver Blanthorn
e85883b4e3
Fix broken build 2018-10-15 17:34:05 +01:00
Shou Ya
41e2462cc8
allow executing bookmarklets 2018-10-15 14:24:31 +08:00
Oliver Blanthorn
a555c6a330
Merge pull request #1072 from tridactyl/exclaim_why
[RFC] Try to make exclaim give better errors
2018-10-12 17:11:05 +01:00
glacambre
2acce706e0
Implement setpref excmd 2018-10-12 11:42:31 +02:00
Oliver Blanthorn
c4108c4ac1
Be careful what you wish for, antonva 2018-10-11 13:52:28 +01:00
Oliver Blanthorn
09063ecdf4
Merge branch 'editor_style' 2018-10-11 10:38:24 +01:00
glacambre
8ae6376081
Turn :bmarks into a proper excmd
Turning `:bmarks` into a proper excmd has several advantages: it will
show up in the `:help` pages, be available for excmd completions and
enbales adding specific arguments (such as "-t") in order to open
bookmarks in other tabs.

This time I'm directly messaging the background script in order to
trigger a tabopen rather than trying to bring tabopen to the content
script.

Closes https://github.com/tridactyl/tridactyl/issues/902.
2018-10-11 11:18:54 +02:00
glacambre
1984a66fb9
Add indication that input is being edited in external editor
This commit adds a .TridactylEditing class to input fields that are
being edited in an external editor. In the default theme, this
corresponds to just adding Tridactyl's logo to the input field.

It looks like it is impossible to reference Tridactyl's logo in CSS and
have it work on non-privileged pages so instead of doing that we add a
step to the build process which turns one of Tridactyl's logo into its
base64 representation and embeds it in the default.css theme file.
2018-10-10 18:54:09 +02:00
Oliver Blanthorn
5c0647242c
Merge branch 'improve_docs2' 2018-10-10 17:53:06 +01:00
Oliver Blanthorn
8327d25c07
Merge pull request #1077 from antonva/zoom-features
Extend zoom excmd keybindings and improve documentation.
2018-10-10 16:16:02 +01:00