Commit graph

933 commits

Author SHA1 Message Date
glacambre
5f40217d06
Add line and column number to :editor
Closes https://github.com/tridactyl/tridactyl/issues/1448
2019-04-18 08:22:36 +02:00
glacambre
91dffe6be8
excmds.ts: Make editor() listen to exit code
Closes https://github.com/tridactyl/tridactyl/issues/1455
2019-04-18 07:01:02 +02:00
Saul Reynolds-Haertle
9f875afd28 Add some more warnings to the autocontain command about redirects 2019-04-16 22:59:30 -07:00
Saul Reynolds-Haertle
5c7ae5331f Teach tabopen to use autocontainer directives when -c is not set
Apparently I have to run the prettifier before I can touch this file?

This behavior is actually pretty simple: If -c isn't set, check to see
if there's an autocontainer directive that matches the url. If there
is a matching container, go ahead and use it.
2019-04-16 22:59:30 -07:00
Saul Reynolds-Haertle
6f726d7092 Teach autocontainers to coexist with other container-management exts
This has a few moving parts.

First, we need a bit of code for keeping track of what other
extensions are installed and enabled. This isn't completely trivial
because we need to listen for "on {en,dis}abled" and "on
{,un}installed" events. This requires a new permission, `management`,
which is _annoying_, but not having this permission would require
extension detection to be done using kludgy messaging hacks that would
be on the critical path for essentially every navigation operation.

Second, we need to write code to talk to the other addons and ask them
if they're handling things. Thankfully they do provide public APIs and
and we can use their sample code to do exactly what we need to do.

Third, it turns out some important chunks of the firefox webext API
aren't handled by the web-ext-browser ts declaration we're
using. They *are* handled by a PR on @types/firefox-webext-browser,
though, so we can copy and paste that to make TS happy.

Fourth, and finally, we need to add some code to the autocontainer
logic to use the compatibility code. This is pretty easy, but
autocontainer logic starts taking a noticeable amount of time becuase
of all the sequences awaits we're doing, so I also have to tweak
things to do all of the async stuff in parallel.
2019-04-16 22:59:30 -07:00
glacambre
923f9caf92
TSLint: enable no-unused-declaration rule
This rule requires adding a new set of rules, tslint-etc.
no-unused-declaration used to be available in tslint:recommended but was
deprecated when --noUnusedVariables was added to typescript. The problem
with using TypeScript's --noUnusedVariables is that it turns unused
declarations into an error and prevents compilation, which isn't fun
when you're just prototyping things.
2019-04-16 08:30:31 +02:00
glacambre
af20bbe4df
TSLint: re-enable no-identical-functions rule 2019-04-15 19:47:41 +02:00
glacambre
2b11d1d464
TSLint: re-enable prefer-const rule 2019-04-14 08:01:26 +02:00
glacambre
0a8c3cd2f6
TSLint: re-enable whitespace rule 2019-04-12 05:54:31 +02:00
glacambre
37dfddca4e
TSLint: ignore generated files
This enables removing file-specific rules-disabling comments in
excmds.ts
2019-04-12 05:50:01 +02:00
glacambre
ff8f313aa5
Turn double-equals into triple-equals
See https://github.com/tridactyl/tridactyl/pull/1451
2019-04-10 12:28:47 +02:00
glacambre
bd65146ca8
TSLint: re-enable no-unnecessary-initializer rule 2019-04-10 06:47:46 +02:00
glacambre
3ff4713247
TSLint: re-enable no-trailing-whitespace rule 2019-04-10 06:39:19 +02:00
glacambre
52103a0578
Add :issue excmd and autocmd to autofill new issues 2019-04-08 09:10:34 +02:00
glacambre
85706a4347
TSLint: re-enable radix rule 2019-04-05 13:16:04 +02:00
glacambre
0f5068f34c
TSLint: re-enable quotemark rule 2019-04-05 13:11:49 +02:00
glacambre
2ac27b0b1d
TSLint: re-enable one-variable-per-declaration rule 2019-04-05 08:59:21 +02:00
glacambre
8b3b809417
TSLint: re-enable no-useless-catch rule 2019-04-04 13:10:46 +02:00
glacambre
1b7c4f2052
TSLint: re-enable no-useless-cast rule 2019-04-04 07:09:44 +02:00
glacambre
b70832ef40
TSLint: re-enable no-unused-expression rule 2019-04-04 06:54:11 +02:00
glacambre
fd09bd6c1d
TSLint: re-enable no-string-literal rule 2019-04-03 19:09:49 +02:00
glacambre
600a324941
TSLint: re-enable no-self-assignment rule 2019-04-03 18:34:19 +02:00
glacambre
0734798c45
TSLint: re-enable no-misleading-array-reverse rule
The no-misleading-array-reverse rule prevents using .sort() and
.reverse() in chains because this make these calls look like they return
a new sorted/reversed slice. But the truth is, these functions modify
the array in place and return that same array, which could cause quite a
lot of confusion if you don't expect that.
2019-04-03 18:27:50 +02:00
glacambre
e3c6c13573
TSLint: re-enable no-ignored-return rule 2019-04-03 18:16:59 +02:00
glacambre
5ae3f501a2
TSLint: re-enable no-small-switch rule 2019-04-03 13:49:38 +02:00
glacambre
94a6f240ea
TSLint: re-enable no-redundant-boolean rule 2019-04-03 13:38:55 +02:00
glacambre
a943081f3b
TSLint: re-enable no-nested-template-literals rule 2019-04-03 13:33:03 +02:00
glacambre
270a1dbf9c
TSLint: re-enable no-dead-store rule
No point in storing things that we're not going to use.
2019-04-03 07:45:09 +02:00
glacambre
7240444d9a
TSLint: re-enable no-consecutive-blank-lines rule
Deactivated in excmds.ts as it is used to generate
.excmds_{background,content}.generated.ts which are full of consecutive
blank lines.
2019-04-03 07:17:48 +02:00
glacambre
15b627c340
TSLint: re-enable no-collapsible-if rule
This rule detects unnecessary nesting of if/else statements and tells
you to remove them.
2019-04-03 07:03:03 +02:00
glacambre
9119944bd9
TSLint: re-enable no-angle-bracket-type-assertion rule
This rule enforces using `x as y` instead of `<y>x` in order to cast
elements. This makes things easier to read and protects against
conflicts with tsx.
2019-04-03 06:33:13 +02:00
glacambre
f8419b20ed
TSLint: re-enable interface-over-type-literal rule
The interface-over-type-literal rule specifies that object types should
be represented with `interface` instead of `type` if possible.
2019-04-02 18:22:54 +02:00
glacambre
3c9c3867e2
TSLint: re-enable forin rule
The forin rule forbids using the `for (let key in object)` syntax. This
is because iterating with `for in` also iterates over keys obtained from
prototypal inheritance. This is most of the time wrong and using `for
(let key of Object.keys(object)` protects against that.
2019-04-02 18:17:12 +02:00
glacambre
8545efdf3f
TSLint: re-enable comment-format rule
This rule requires that all single line comments must start with a
space, i.e. `//hello` is forbidden and `// hello` is allowed.
This made me discover a few pre-processor macro in files that aren't
taken into account by the macro-preprocessor and so I've decided to
remove these directives.
Note that this rule must stay disabled for excmds.ts as it would break
our preprocessor macros.
2019-04-02 06:38:59 +02:00
glacambre
f11f5481e2
TSLint: re-enable bool-param-default rule
The bool-param-default rule requires all optional boolean parameters to
have a default value.
2019-04-01 18:06:13 +02:00
glacambre
8ed07362e0
TSLint: re-enable ban-types rule
This rule disallows using Number, String or Boolean constructors as
types and instead forces using the actual type, `number`, `string` or
`boolean`.
2019-04-01 12:57:19 +02:00
glacambre
f5563c3d3e
TSLint: re-activate array-type rule
This rule stipulates that complex array types should be represented as
Array<T> rather than T[].
2019-04-01 05:28:21 +02:00
glacambre
b2e88f8a02
Fix :winopen -private about:addons not working 2019-03-26 08:27:38 +01:00
Oliver Blanthorn
1f12c31615
Merge pull request #1414 from glacambre/fix_editor_doc
Fix editor documentation
2019-03-25 13:30:19 +00:00
glacambre
018c247dae
Fix editor documentation
You shouldn't single-quote values you give to editorcmd.

Closes #1413.
2019-03-25 05:21:00 +01:00
Colin Caine
618f7f6446 excmds: document composite 2019-03-12 23:45:08 +00:00
Oliver Blanthorn
4d3b86f5ee
Merge branch 'remove_commandline_background' 2019-03-12 15:15:58 +00:00
glacambre
6a4e2e3c41
excmds.ts: Fix nativeopen using wrong escaping scheme on windows
See comment in patch for explanations.
2019-03-06 06:49:47 +01:00
glacambre
bdd3e04199
Implement deselect_completion ex command
Left unbound by default.
2019-02-28 18:27:21 +01:00
glacambre
4ff992f49e
excmds.ts: Fix hint -j
https://github.com/tridactyl/tridactyl/pull/1381 inverted the behavior
of -J. This commit fixes that.
2019-02-27 06:17:15 +01:00
glacambre
85b3e33719
Remove commandline_background
This commit removes commandline_background.ts. I believe this is useful
because the only thing it did was provide recvExStr, which just
triggered a synthetic "onLine" event the only consumer of which was the
parser. Since we already used controller_background + acceptExCmd in
some places, it made sense to me to directly use controller_background +
acceptExCmd everywhere.
2019-02-26 08:41:19 +01:00
glacambre
295471d592
excmds.ts: Fix hint -pipe not working
https://github.com/tridactyl/tridactyl/pull/1381 broke `hint -pipe`
(just try `:composite hint -pipe a href | tabopen` for example).
This commit makes `-pipe` work again.
2019-02-26 06:24:18 +01:00
Oliver Blanthorn
026f409add
Merge pull request #1381 from nfvs/hint_t
Added `hint -t`, `hint -tc` and `hint -Jtc`, to open links in a new tab.
2019-02-24 14:03:11 +00:00
Nuno Santos
31c1d52641 Added hint -t, hint -tc and hint -Jtc, to open links in a new tab.
Using `-w newtab` wouldn't allow us to use selectors with `-c`, and
using composite would always open a new empty tab on cancel (esc).

Other changes:
- Better flag handling in hint().
- `-c` is now a flag (can be combined with others like `-t`), and is
handled in the `default` case
- support flags `-c`, `-J` and `-t` in any position
2019-02-23 23:08:26 +01:00
glacambre
02c133fa0b
native.ts: implement proper profile-checking
https://github.com/tridactyl/tridactyl/pull/1355 introduced a bug on
systems where profile names do not match profile paths. Fixing it
required implementing proper profiles.ini parsing, which should help
making profile discovery work on windows.

The new getProfileDir() function breaks compatibility with previous
versions. The previous version turned backslashes into slashes on
windows. I believe doing this is wrong since paths such as
`C:/Users/Bob` do not make any sense on windows. They might work in
mingw and wsl but I believe we should aim to have everything work on
'normal' windows.
2019-02-23 14:22:49 +01:00