brookhong/Surfingkeys

Repeating previous actions

bhajneet opened this issue · 6 comments

Let's say there is a carousel, to advance the carousel you do:

  • F
  • XX

is there any easy way to repeat this action? Such as '.' in vim? The link doesn't change but i need to follow that link multiple times on that page. This happens quite often on different websites. I thought at first "mapkey" would be helpful, would this be the correct route to take? (I would prefer "temporary" mapkeys in a sense, as the second step in following those links can change site to site or after reloading the page).

Implemented, will be released in next version.

You could try it by loading unpacked extension, after you clone this repository.

Any comments is welcomed.

Released in 0.5.3.

I looked at the referenced commit but I can't understand how to use repeat for hints.
If I run sql it doesn't show hint clicks there (oh I'm stupid, sql also gets registered for repeat, so it's messed up because of that).

Also, if I'm not mistaken the repeat just works with hint-letters, not the actual dom element that was clicked? If something is clicked and the dom changes in a major way, wouldn't the hint be different next time (on repeat)?

How is this supposed to work? I guess it keeps some queue of actions for the current tab?
For me sql somehow always shows <Ctrl-'>... first and . triggers all of the actions. How can I just repeat the last command or clear this queue?

Example for sql:

<Ctrl-'>M → Hints E → Hints Q → Hints E → Hints E → Hints E

The dot . only repeats the actions with multiple key strokes, for example https://github.com/brookhong/Surfingkeys/blob/master/pages/default.js#L266, those actions with only one key stroke are not repeatable with ..

I'm confused. Following a link has multiple key strokes, e.g. f + hint.
Where is f in the default mappings? I don't see any link-opening commands with repeatIgnore.
It would be nice if @bhajneet initial use case was supported, i.e., follow the same hint with ..
The part you linked now points to

mapkey('B', '#4Go one tab history back', function() {
    RUNTIME("historyTab", {backward: true});
}, {repeatIgnore: true});