Commit graph

2039 commits

Author SHA1 Message Date
glacambre
eda244b75a
Make text.* excmds work in the command line on the newtab page again 2019-04-23 19:56:10 +02:00
glacambre
3efc5f03b1
config.ts: Fix :issue autocmd being triggered on :viewconfig 2019-04-23 18:15:56 +02:00
Saul Reynolds-Haertle
25d64258e2 Move all of the update* configs to an update namespace
updatenag => update.nag, etc.
2019-04-22 22:03:17 -07:00
Saul Reynolds-Haertle
e131757fb3 Add updatecheck to the new-tab page
This should be more reliable than checking in the background.
2019-04-22 22:01:58 -07:00
Saul Reynolds-Haertle
ec48314d7c Refactor update-checking logic so we can check more frequently
We couldn't have just invoked "check for updates" on every single
operation because it would've gone out to the RSS every time. This
refactor permits it to cache a highest known version for a
configurable interval. It should be safe to invoke this new
update-checking logic as frequently as desired.
2019-04-22 22:01:58 -07:00
Saul Reynolds-Haertle
587b498684 Refine explanation of background vs content in docs for repeat 2019-04-21 11:16:13 -07:00
Saul Reynolds-Haertle
2e5fdfb63c Run excmds in content. 2019-04-21 02:42:59 -07:00
glacambre
973ec07f92
Remove BGSELF
BGSELF was a hack that I used when implementing ex commands for the
command line. It consisted of having .excmds_background.generated.ts
import itself as BGSELF in order to dynamically add commands to it. This
let us define excmds in other files while not changing anything in
parsers/exmode.ts.

This was awful so I decided to remove it. This required performing the
following changes:
- Moving text.* and ex.* command definitions to their own files where
  they have zero side effects. While this was easy for text commands, ex
  commands rely a lot on side effects. In order to work around this,
  lib/commandline_cmds exports a single function, getCommandlineFns(),
  which expects an object representing the commandline's state as
  parameter.
- In the background script, import our side effect free files and wrap
  them in proxys that will send "commandline_cmd" and "editorfn_content"
  messages to tabs when needed.
- In the content script, add a listener that will either execute an
  editor function or forward it to the command line when it receives an
  "editorfn_content" message.
- In the commandline script, add a listener that will execute exmode
  commands.
2019-04-21 10:33:05 +02:00
glacambre
40a8713712
Actually make tridactyl listen for :editor return code
This piece of code was missing from 91dffe6. This actually closes #1455.
Note that you need your terminal emulator to forward the exit code of
your editor in order for this to work.
2019-04-19 06:54:02 +02:00
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
Oliver Blanthorn
14c51dfce3
Merge pull request #1470 from tridactyl/fix_sonarcloud_bugs
Fix errors found by sonarcloud
2019-04-17 13:37:34 +01:00
Oliver Blanthorn
a0ff313adb
Merge pull request #1469 from tridactyl/fix_lgtm_errors
Fix errors found by LGTM
2019-04-17 13:35:32 +01:00
Saul Reynolds-Haertle
09005940ef Make extension_info in background comply with no-unused-declarations 2019-04-17 00:29:46 -07:00
Saul Reynolds-Haertle
627340c1cd Remove management permission and shortcut in extensioninfo
This should allow the new autocontainer-coexistence code to be
committed while remaining nonfunctional so I don't have to keep it
synced until we fix the functionality for asking for permissions.
2019-04-17 00:09:55 -07:00
Saul Reynolds-Haertle
b4c94c97a3 Fix lint errors in autocontain-coexistence code
Also uncomment the commented-out openerTabId. I can't figure out why
I'd removed it. >_>
2019-04-16 22:59:30 -07: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
fde403c3da Add warning when we fail to talk to MAC extension 2019-04-16 22:59:30 -07:00
Saul Reynolds-Haertle
b648539a89 Fix whitespace in manifest 2019-04-16 22:59:30 -07:00
Saul Reynolds-Haertle
bc482ec64d Add new check to autocontain code to suppress some double-opens 2019-04-16 22:59:30 -07:00
Saul Reynolds-Haertle
0582e4fb5e Augment typing in DefaultMap to admit use by autocontainer code 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
74db069ef2
Fix errors found by sonarcloud
https://sonarcloud.io/dashboard?id=tridactyl
2019-04-17 07:49:41 +02:00
glacambre
51f88f51c9
Fix errors found by LGTM
https://lgtm.com/projects/g/tridactyl/tridactyl/overview/
2019-04-17 07:18:18 +02: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
3fe1e5a091
TSLint: re-enable no-empty rule 2019-04-14 10:27:22 +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
Oliver Blanthorn
a7281585e4
Merge pull request #1450 from tridactyl/fix_saveas_completion
Fix completions/FileSystem.ts
2019-04-09 07:32:20 +01:00
glacambre
b54e08aa42
Fix completions/FileSystem.ts
Prettier broke it a long time ago.
2019-04-09 06:45:21 +02:00
glacambre
52103a0578
Add :issue excmd and autocmd to autofill new issues 2019-04-08 09:10:34 +02:00
glacambre
00ce513ccc
TSLint: re-enable no-conditional-assignment rule 2019-04-05 13:38:14 +02:00
glacambre
3953830787
TSLint: re-enable import-spacing rule 2019-04-05 13:20:23 +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
15e26d65a2
TSLint: re-enable prefer-promise-shorthand rule 2019-04-05 13:09:04 +02:00
glacambre
0e1ed199f3
TSLint: re-enable prefer-immediate-return rule 2019-04-05 13:05:37 +02:00
glacambre
2ac27b0b1d
TSLint: re-enable one-variable-per-declaration rule 2019-04-05 08:59:21 +02:00
glacambre
c5948c640d
TSLint: re-enable object-literal-shorthand rule 2019-04-04 13:30:11 +02:00
glacambre
8b3b809417
TSLint: re-enable no-useless-catch rule 2019-04-04 13:10:46 +02:00
Oliver Blanthorn
4adc256d8a
Merge pull request #1434 from tridactyl/bind_J_and_K
config.ts: Bind J to tabprev and K to tabnext
2019-04-04 10:12:15 +01:00
glacambre
70f7769e3c
config.ts: Bind J to tabprev and K to tabnext
Closes #1433 and #1406
2019-04-04 08:08:16 +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