Commit graph

73 commits

Author SHA1 Message Date
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
073a0a7454 move src/state_content.ts into src/content 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
4bdd07308a Move src/convert.ts to src/lib/ 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
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
Saul Reynolds-Haertle
14889fbc58 Add key translation maps to help with i18n and accessibility 2018-09-05 03:19:31 -07:00
Colin Caine
8f683f672c Make non-generic mode parsers report isMatch true
Causes keys to be suppressed in these modes too.
2018-09-04 21:51:46 +01:00
Saul Reynolds-Haertle
58c3ed6fc6 Nuke msgsafe, since no need to message events any more, and fix ARIA
`pick` in `msgsafe.ts` was not type safe and was concealing an error
where HTMLElements don't have a `pick` property. Then
`MsgSafeNode.pick` would have always been absent, which would have
caused `isTextEditable` to fail to detect elements with the ARIA role
of `application`. Using real types throughout allows us to fix this by
iterating over `Element.attributes`, which appears to do the right
thing.
2018-09-02 16:25:34 -07:00
Saul Reynolds-Haertle
90fa242e84 fix name of content state script to fit style 2018-09-02 16:25:34 -07:00
Saul Reynolds-Haertle
d1e6a86539 Janky proof of concept for per-tab state, incl mode and parsers
I've been programming on pure instinct for like five hours and I'm not
sure what exactly I did any more. I *think* that what I did was
something like:
* Split `state.ts` into `state.ts` and `content_state.ts`, then
  removed mode from state and moved it to content_state.
* Made the types in content_state.ts a hair more powerful
* Fixed all errors resulting from those two changes, in the process
  swapping state out for content_state wherever appropriate.
* Moved a couple excmds from background into content since they
  depended heavily on the mode and should live with the mode
* Split the controller in half, moving the parser logic to the content
  script and leaving acceptExCmds in the background
  version. content_controller forwards excmds to background script
  using messaging.
* Nuked the keydown_* code, since we no longer need to forward keys to
  the background.
* Went around fixing everything resulting from *those* changes, mostly
  the various perversions of keydown listeners
* Various tweaks here and there that probably didn't do anything but I
  was just changing things at random a third of the time and I really
  need to go through this and clean it up.

Things that work:
* excmds are nice now. each tab has its own commandline; they stay
  open when you navigate between tabs and you can come back to them
  after doing stuff in another tab and finish your command line input.
* keybinds that don't don't involve mode switching: `[[`, `]]`, `j`,
  `k`, `r`, etc, all still functional.
* You can turn on hinting mode and, again, navigate to another tab
  which will *not* be in hinting mode, do whatever you need to do
  there including excmds or more hinting, and then come back to finish
  the hint you started in the first tab
* You can exit hint mode by pressing escape. :P

Things that I broke:
* ...Actually quite a bunch of stuff, I think.
* I don't seem to be able to *finish* a hint any more. Sometimes I
  can't even get one key in.
2018-09-02 16:25:34 -07:00
Oliver Blanthorn
d26402929d
Remove obsolete code >:D 2018-07-25 12:08:04 +01:00
Oliver Blanthorn
99f6dc4e8e
Hack keyseq into working with ignore 2018-07-25 11:44:34 +01:00
Oliver Blanthorn
c799c9a39d
Start thinking about generic parser 2018-07-24 18:52:32 +01:00
Oliver Blanthorn
a9f6707282
Fix #505 again: add <CA-`> bind 2018-05-16 14:59:11 +01:00
Oliver Blanthorn
d181e0b4a5
Fix #505: add CA-Esc bind for ignore 2018-05-13 13:30:08 +01:00
glacambre
8493eeb1ad
insertmode.ts: Go back to normal mode when Escape is pressed 2018-04-29 07:16:57 +02:00
Oliver Blanthorn
5f7b411a4d
Change insert mode bind for editor to <C-i>, like Vimperator 2018-04-28 14:19:07 +01:00
Oliver Blanthorn
afd0eb95a7
Change ignore mode binds to be symmetric and resolve Jupyter conflict 2018-04-28 13:38:53 +01:00
Oliver Blanthorn
5d936a7d44
Make editor work in input mode 2018-04-25 20:43:43 +01:00
Oliver Blanthorn
5f68f9428d
Install native messenger on build; edit text in external editor
Currently we only support gVim and Linux, but `winword.exe` support is
theoretically possible.
2018-04-25 20:43:13 +01:00
Oliver Blanthorn
47409e4fd2
Make Logging.Logger.error print an error to the command line 2018-04-23 15:09:20 +01:00
Oliver Blanthorn
fad7851829
Fix #394: rename generated source .name.generated.ext 2018-04-22 17:15:40 +01:00
Colin Caine
2626d292f0 Fix :unbind better
Remove all unbound keys before passing to keyseq.parse(). Resolves #402.
2018-04-18 11:07:57 +01:00
Colin Caine
1ef49cb6e8 Fix :unbind
Unbinding actually sets the property to `""`, but the keyseq code
rightly doesn't know about that convention.

For now I'm putting some special casing in the normalmode parser.

Fixes #398.
2018-04-17 01:09:59 +01:00
Colin Caine
2ccfdda110 Use keyseq for normalmode
Also rename ex_str to exstr in a bunch of places for no real reason.
2018-04-16 00:07:49 +01:00
Oliver Blanthorn
095ce771ea
Formatting: run all typescript through prettier 2018-04-13 19:28:03 +01:00
Colin Caine
8a4a493a30 Stop logging excommands and args 2018-04-11 17:50:43 +01:00
Isaac Khor
cd3396d39c
Delete leftover comment 2018-01-09 17:37:16 +08:00
Isaac Khor
d2f4de962a
Expand exstr in parser unconditionally 2018-01-09 17:32:21 +08:00
Isaac Khor
1a20a646b5 Extract core aliasing functionality into separate file and change to recursively expand aliases 2018-01-09 00:15:06 +08:00
Isaac Khor
29d58cd571 Change from 'alias' to 'command' and access config options differently 2017-12-31 16:53:35 +08:00
Isaac Khor
6fb260673f Fix aliasing parser 2017-12-28 17:11:52 +08:00
Isaac Khor
767aafce3b Implement aliasing in exmode 2017-12-28 16:04:25 +08:00
Zhong Jianxin
01221f3052 Add inputmode
- Add `focusinput -n` and `focusinput -N`
- Press `gi` to focus input and enter inputmode
- When in inputmode, `Tab` to focus input after last focussed one, `Shift+Tab`
  to focus input before last focussed one
2017-12-05 22:12:34 +00:00
Oliver Blanthorn
da68d5f398
Add basic configuration with set
Currently does not import previous binds
2017-11-29 16:28:06 +00:00
John Beard
a3ca5cd2c1 Add yank anchor hint submode (;#)
THis yanks the page URL with the hinted elements id or title as a hash
fragment, which can be used to link to the page at that element's
location.

For example: https://en.wikipedia.org/wiki/Vim_(text_editor)#History

;# nmap added, from Vimperator
2017-11-29 02:27:23 +00:00
Colin Caine
e933c100d3 excmd: Replace tabchoose with tabprev_gt
The gT and gt maps in vim aren't symmetric, this better preserves
those semantics while removing a confusingly named excmd
2017-11-28 16:16:41 +00:00
Oliver Blanthorn
de84cd42f5
Fix #134: [count]gt now goes to nth tab
Known issues: count is ignored on gT
2017-11-28 14:28:20 +00:00
Robbie McMichael
87aa3ee225 Add tabfirst and tablast commands 2017-11-27 19:59:43 +00:00
Oliver Blanthorn
eef773f44a
Add binding to yankcanon, yankshort 2017-11-27 18:51:33 +00:00
Oliver Blanthorn
38ff3f7ca4
Merge branch 'master' of github.com:cmcaine/tridactyl into johnbeard-focusinput 2017-11-26 12:18:14 +00:00
John Beard
221b94c8ff Add hint focus mode (;;)
This focuses the hinted element with excmd ":hint -;".

Includes VImperator binding to ";;"
2017-11-25 01:47:56 +00:00
John Beard
6a48990751 Add focusinput command (gi)
Can focus the nth input from the start or end of a page.

Also has some special modes:

  -l: last focussed input
  -p: first password input
  -b: the largest input by area
2017-11-25 01:41:38 +00:00
Oliver Blanthorn
aeb3fa167e
Fix #68 2017-11-23 19:55:45 +00:00
chocolateboy
0953425cf5 improve pagination:
- prefer the canonical forms over fallback patterns
  (fixes rockpapershotgun.com, Discourse etc.):

  1) link[rel]
  2) a[rel]
  3) a::text(pattern)

- tighten fallback patterns (fixes Google, GitHub etc.)

- remove site-specific patterns
2017-11-23 15:07:48 +00:00
John Beard
a46934b2dd Add image hinting (;i, ;I)
This supports hinting of <img> tags, and will open the src attribute in
the current or BG tab.
2017-11-22 23:03:28 +00:00
Koushien
f982233a49 completions: initial implementation
This commit squashes a load of work by @Koushien, a dozen hours from
@cmcaine and some CSS by @bovine3dom.

@cmcaine is writing this commit message, but the work was mostly by
Koushien so the author is set to them. Thanks Koushien!

The following issues need to be fixed:

 - The interface is over complicated (my fault)
 - commandline_frame is hard-coded to use BufferCompletionSource. This
   needs to be made more general
 - BufferCompletionSource should be generalised
 - completions.ts calls helper functions in commandline_frame. Should
   just use browser proxy. If that's too slow can define a
   completions_background.ts

After that's done, this should be fixed:

 - Completion hiding/unhiding is currently too messy.
2017-11-22 21:30:37 +00:00