Commit graph

732 commits

Author SHA1 Message Date
glacambre
666f9cfc51
Implement {bind,unbind,reset}url 2018-10-04 13:18:12 +01:00
glacambre
1d8edb5a4b
excmds.ts: Remove profile-finding code in guiset
:guiset implemented a bit of its own profile-finding code (checking for
auto, making sure it's using the right platforms...) which isn't really
necessary since all of these checks (and more!) are already implemented
in Native.getProfileDir().

Closes https://github.com/tridactyl/tridactyl/issues/705.
2018-10-04 12:35:13 +02:00
glacambre
c4fc5cc8fe
Rename ffargs to ff_cmdline() and remove constraint on profile name
The rename of ffargs to a more sensible ff_cmdline was suggested in
https://github.com/tridactyl/tridactyl/pull/510#discussion_r188589211

The constraint on profile names was that the `find` command tridactyl
ran looked for profiles the name of which contained a dot. While all
profiles generated by firefox contain a dot in their path, users can
easily rename them to something that doesn't contain a dot, provided
that they also modify their profile.ini file.
2018-10-04 10:04:20 +02:00
glacambre
c7c152bc33
excmds.ts: Fix guiset profile not found error being overwritten 2018-10-04 09:28:03 +02:00
Saul Reynolds-Haertle
35605d3bf9 Add more logging and debug output to perf counters
Also, present a friendly error string instead of an opaque crash if no
samples are avilable for perfhistogram.
2018-09-30 12:01:07 -07:00
Saul Reynolds-Haertle
b98e0af7c0 Rename dumpcounters to perfdump to maintain pseudo-namespacing 2018-09-30 12:01:07 -07:00
Saul Reynolds-Haertle
77832fd8a2 Add documentation for perf counts library and clean up the interface
Most importantly, provide some convenience functions for hooking up
listeners and messaging.
2018-09-30 12:01:07 -07:00
Saul Reynolds-Haertle
b8e0459e6b Build a performance counters system so I can start optimizing things
Complete a circular buffer so we don't log too much data, config
settings for turning it on and off (default off, becuase performance)
and for changing the size of the buffer, an excmd for dumping the raw
json so you can pore over it, and for when you just want to
sanity-check yourself instead of groveling over your data for six days
with a deep learning toolkit and three hundred CPUs of compute, an
excmd for pretty-printing your stats in a nice histogram.

I didn't think far enough ahead and only implemented the easy way to
instrument a function, which is with a decorator. I'm getting _really_
angry at typescript not being able to handle decorators on free
functions. bah. I'll figure out a good way to wrap free
functions. Maybe just go the stupid route and make you change
`export async function foo(args)` to `export foo = measured(async
function(args) ...`. But that would break excmd parsing, so... :/

I think that I already want to do a refactor to break excmd.ts into a
bunch of one-line wrappers referencing implementations spread
throughout a bunch of libraries. This would go nicely with that.

Other things I did while I was here:
* Fix the ugliness we had with (window as any).tri by monkey-patching
  the tri property into the window object in tridactyl.d.ts
2018-09-30 12:01:07 -07:00
Oliver Blanthorn
bbc305c5cf
Merge branch 'readline_excmds' 2018-09-30 19:00:51 +01:00
Oliver Blanthorn
b6573a88f8
Merge branch 'add_saveas' 2018-09-30 18:57:07 +01:00
Oliver Blanthorn
f8fcaf452a
Add disclaimer to saveas help 2018-09-30 18:56:56 +01:00
Saul Reynolds-Haertle
f95a33d76c Fix remaining relative imports 2018-09-29 18:03:36 -07:00
Saul Reynolds-Haertle
a9367f479b move src/keyseq.ts to src/lib/ 2018-09-29 18:03:36 -07:00
Saul Reynolds-Haertle
8670ed1136 move src/dom.ts to src/lib/ 2018-09-29 18:03:36 -07:00
Saul Reynolds-Haertle
9df56bbd64 move src/url_util.ts to src/lib/ 2018-09-29 18:03:36 -07:00
Saul Reynolds-Haertle
7769d6db1b move src/text_to_speec.ts to src/lib/ 2018-09-29 18:03:36 -07:00
Saul Reynolds-Haertle
073a0a7454 move src/state_content.ts into src/content 2018-09-29 18:03:36 -07:00
Saul Reynolds-Haertle
2d16c4d925 move src/scrolling.ts into src/content 2018-09-29 18:03:36 -07:00
Saul Reynolds-Haertle
16f95261f1 move src/number.mod.ts to src/lib 2018-09-29 18:03:36 -07:00
Saul Reynolds-Haertle
3100dca4a3 move src/number.clamp.ts to src/lib 2018-09-29 18:03:36 -07:00
Saul Reynolds-Haertle
eeb74c95c6 move src/native_background.ts to src/background/ 2018-09-29 18:03:36 -07:00
Saul Reynolds-Haertle
a4274d3839 move src/metadata.ts to src/lib/ 2018-09-29 18:03:36 -07:00
Saul Reynolds-Haertle
3160137c57 move src/messaging.ts to src/lib/ 2018-09-29 18:03:36 -07:00
Saul Reynolds-Haertle
c02ef5a90e Move src/itertools.ts to src/lib/ 2018-09-29 18:03:36 -07:00
Saul Reynolds-Haertle
e635034f9e Move src/hinting.ts to src/content/ 2018-09-29 18:03:36 -07:00
Saul Reynolds-Haertle
b255712970 Move src/finding.ts to src/content/ 2018-09-29 18:03:36 -07:00
Saul Reynolds-Haertle
a9486ae6ad Move src/css_util.ts to src/lib/ 2018-09-29 18:03:36 -07:00
Saul Reynolds-Haertle
de860eddb8 Move src/controller_background.ts to src/background/ 2018-09-29 18:03:36 -07:00
Saul Reynolds-Haertle
a4b822336f Move src/config_rc.ts to src/background/ 2018-09-29 18:03:36 -07:00
Saul Reynolds-Haertle
c531aa5481 Move src/config.ts to src/lib/ 2018-09-29 18:03:36 -07:00
Saul Reynolds-Haertle
539fcb18c1 Move src/commandline_content.ts to src/content/ 2018-09-29 18:03:36 -07:00
Saul Reynolds-Haertle
9dad2e4ae8 Move src/commandline_background.ts to src/background/ 2018-09-29 18:03:36 -07:00
Saul Reynolds-Haertle
11e28ce1fc Move src/aliases.ts to src/lib/ 2018-09-29 18:03:36 -07:00
Saul Reynolds-Haertle
10248f4cee Move src/logging.ts to src/lib/ 2018-09-29 18:03:36 -07:00
glacambre
484fcd946a excmds.ts: Add im_{forward,backward}_word
im_{forward,backward}_word are functions meant to be used when in
insert/input mode. They should be functionnally equivalent to readline's
{forward,backward}-word. They move the cursor one word forward or
backward.
2018-09-29 20:28:06 +02:00
glacambre
24974eb17a excmds.ts: Add im_{forward,backward}_char
im_{forward,backward}_char are functions meant to be used when in
insert/input mode. They should be functionnally equivalent to readline's
{forward,backward}-char. They move the cursor one character forward or
backward.
2018-09-29 20:18:33 +02:00
glacambre
91c006c9aa excmds.ts: Add im_end_of_line
im_end_of_line is a function meant to be used when in insert/input
mode. It should be functionnally equivalent to readline's
end-of-line. It moves the cursor to the end of the current line.
2018-09-29 20:14:49 +02:00
glacambre
292fa69567 excmds.ts: Add im_beginning_of_line
im_beginning_of_line is a function meant to be used when in insert/input
mode. It should be functionnally equivalent to readline's
beginning-of-line. It moves the cursor to the beginning of the line.
2018-09-29 20:11:36 +02:00
glacambre
4733e759e9 excmds.ts: Add im_backward_kill_word
im_backward_kill_word is a function meant to be used when in
insert/input mode. It should be functionnally equivalent to readline's
kill-word. It removes the word before the cursor.
2018-09-29 20:02:06 +02:00
glacambre
53a9c043a0 excmds.ts: Add im_kill_word
im_kill_word is a function meant to be used when in insert/input
mode. It should be functionnally equivalent to readline's
kill-word. It deletes every character from the cursor to the end of the
word.
2018-09-29 19:17:10 +02:00
glacambre
05915d3dbb excmds.ts: Add im_kill_whole_line
im_kill_whole_line is a function meant to be used when in insert/input
mode. It should be functionnally equivalent to readline's
kill-whole-line. It removes every character of a line, including the
newline character.
2018-09-29 09:22:45 +02:00
glacambre
dbb173770f excmds.ts: Add im_backward_kill_line
im_backward_kill_line is a function meant to be used when in
insert/input mode. It should be functionnally equivalent to readline's
backward-kill-line. It removes every character from the beginning of the
line up to the cursor. If the cursor is at the beginning of the line, it
removes the newline before the cursor.
2018-09-28 22:38:50 +02:00
glacambre
90a501e802 excmds.ts: Add im_kill_line
im_kill_line is a function meant to be used when in insert/input
mode. It should be functionnally equivalent to readline's
kill-line. It deletes every character from the cursor to the end of a
line, merging lines if the character right after the cursor is a
newline.
2018-09-28 22:04:13 +02:00
glacambre
72a44e9f85 excmds.ts: Add im_{upcase,downcase,capitalize}_word
im_{upcase,downcase,capitalize}_word are functions meant to be used when
in insert/input mode. They should be equivalent to their readline
counterparts.
2018-09-28 20:23:33 +02:00
glacambre
7fcee7e3eb excmds.ts: Add im_transpose_words
im_transpose_words is a function meant to be used when in insert/input
mode. It should be functionnally equivalent to readline's
transpose-words. It transposes the word the cursor is in (or, if the
cursor is not in a word, the word before it) with the next word (or the
previous word if the word to transpose is the last word of the text).

The notion of word is defined by the "wordpattern" setting, which is a
regex that matches every character that a word can contain. The default
pattern is [^\s], which means a word can be any character except
whitespace. Other useful patterns could be [^\s/] or
[^\s?,.;:/!()\[\]\\{}"'`+=].
2018-09-28 17:45:39 +02:00
glacambre
f461d85d2f Add :saveas ex command
This commit adds a `:saveas` ex command that behaves mostly like
pentadactyl's `saveas`. This requires adding a new `move` primitive to
the native messenger which behaves like `cp` (but isn't actually a call
to `cp` in order to stay compatible with windows). Then
native_background.ts uses that in order to move files when their
download is complete.
2018-09-28 07:33:00 +02:00
Oliver Blanthorn
6bfa641b32
Fix #1028 and maybe some other errors: persuade buildbot to rebuild help 2018-09-27 13:01:33 +01:00
glacambre
f2df3b9e4e excmds.ts: Add im_transpose_chars
im_transpose_chars is a function meant to be used when in insert/input
mode. It should be functionnally equivalent to readline's
transpose-chars. It transposes the character before the cursor with the
one after it and then moves the cursor one character to the right.
2018-09-26 22:29:39 +02:00
glacambre
5138b7bf35 excmds.ts: Add im_tab_insert
im_tab_insert is a function meant to be used when in insert/input mode.
It should be functionnally equivalent to readline's tab-insert. It
behaves like the <Tab> key.
2018-09-26 22:15:34 +02:00
glacambre
1783086c13 excmds.ts: Add im_delete_backward_char
im_delete_backward__char is a function meant to be used when in
insert/input mode. It should be functionnally equivalent to readline's
delete-backward-char. It behaves like the <BackSpace> key.
2018-09-26 22:08:27 +02:00