Commit graph

1065 commits

Author SHA1 Message Date
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
glacambre
4b830dbaf9 excmds.ts: Add im_delete_char
im_delete_char is a function meant to be used when in insert/input mode.
It should be functionnally equivalent to readline's delete-char. It
behaves like the <Del> key.
2018-09-26 22:07:55 +02:00
Oliver Blanthorn
318423b1e6
Merge branch 'urlspecific_config' 2018-09-21 11:33:23 +01:00
Oliver Blanthorn
576ff17df6
Merge pull request #1014 from WorldCodeCentral/master
Change :set home to :set homepages
2018-09-19 11:04:24 +01:00
WorldCodeCentral
dfc1e73499
Change home to homepages
Correct documentation of home to show "set homepages" instead of "set home" which was incorrect.
2018-09-19 00:50:45 +02:00
glacambre
46ca5daf64
excmds.ts: Make editor() return a [filepath, content] tuple
`editor()` didn't return anything useful. This partially fixes #1005 by
letting users create commands to automatically delete a the temporary
file after `editor()` finishes.
2018-09-15 08:17:10 +02:00
Oliver Blanthorn
64f1422187
Remove reference to ESR since it no longer supports Vimperator 2018-09-14 10:30:26 +01:00
glacambre
601cffbab8
config.ts: Implement priority setting for site-specific settings 2018-09-12 11:12:17 +02:00
glacambre
547065fed7
Add unseturl ex command 2018-09-11 06:34:36 +02:00
glacambre
1a1688a83f
Implement site-specific settings
This PR implements site-specific settings. It requires multiple changes
and new features.

First, I needed to create a new value in `window.tri` named
`contentLocation`. This contentLocation object is either a Location or
URL object containing the URL of the currently selected tab of the
currently selected window. This is required because config.get() is not
asynchronous and we probably want to keep it that way, thus we can't
message the content script just to get the current url.

Then, we create a new object, URLCONFIGS, in content.ts. It behaves
exactly the same as USERCONFIG, except it has a level of indirection,
matching url patterns to config objects. This requires creating new
seturl, geturl and unseturl functions which behave mostly the same as
set, get and unset.

Last, we create a `seturl` ex command in order to interact with this new
object.
2018-09-10 18:51:31 +02:00
glacambre
7bf5198e65
Turn logging levels into string in the config
Using numbers instead of strings made things complicated when dealing
with logging (:set was more complex, :get returned a number instead of a
string...). This commit fixes this.

Note that this commit removes validation for logging levels. This means
that users can now set erroneous logging levels. Fixing this will
require better type info generation in the compiler and will happen in
another commit.
2018-09-10 17:39:08 +02:00
glacambre
a7ddcb1b5a
Respect the tabs.move/tabs.create API
According to MDN[1], when you create a tab that should be placed at the
end of a window, you should use the number of tabs of the window as
index.
But if you use tabs.move(), you should use an index value of -1[2].

Probably fixes https://github.com/tridactyl/tridactyl/issues/990 .

1: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/create#Parameters
2: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/move#Parameters
2018-09-10 07:05:47 +02:00
Alex Griffin
e8f216f441 Some small fixes to the native messenger installer 2018-09-06 10:02:31 -05:00
Oliver Blanthorn
35f48ae1f5
Merge branch 'key-translation-map' 2018-09-05 14:37:58 +01:00
Oliver Blanthorn
79fec22109
Add keymap excmd 2018-09-05 14:34:10 +01:00
Saul Reynolds-Haertle
8c8b0a680f Unbreak gobble-mode
I apparently missed putting the relevant excmd into content-mode where
it could actually act on the state. >_>
2018-09-05 03:15:12 -07:00
Oliver Blanthorn
8a2ec6fda0
Fix link to config help 2018-09-04 13:00:32 +01:00
Saul Reynolds-Haertle
77d17a6d5f Fix typo in exmcds docstring, add TODO in bind-args mode mapping 2018-09-02 16:25:34 -07:00