Closed Azarattum closed 2 years ago
I've been testing input this entire in VSCode. I have no idea why, but when I tried the first case in notepad 0_o
R R
-> rrr
R 1
-> rr1
In Windows Search I get 2 or 3 Rs somewhat randomly. Browser search bar gives 2 Rs. Terminal Window gives 4!
WOW! This is crazy
I think I found a somewhat reliable solution that works everywhere. The key is to use R
literally in the edge cases instead of Any
.
R R >> Delete R ArrowLeft
R Shift{R} >> Delete Shift{R} ArrowLeft
R Shift{Any} >> replace
R Shift >>
R Any >> replace
replace >> !R Delete Any ArrowLeft
However it's still really ugly...
This
R R >> !R Delete R ArrowLeft
R Shift{R} >> !R Delete Shift{R} ArrowLeft
is equal to this
R R >> Delete R ArrowLeft
R Shift{R} >> Delete Shift{R} ArrowLeft
for some reason... So I removed !R
there.
Yes, the Any key needs more work. The different behavior depending on focused application is indeed very strange. I could also reproduce the 3 in Notepad and 4 in Powershell... Thanks for reporting!
I will investigate this and try to make Any output only what it matched on the input side. Then this should work:
R Shift{Any} >> Delete Shift{Any} ArrowLeft
R Any >> Delete Any ArrowLeft
Hi Azarattum, this is fixed with commit ba44c8ab967d0f51d1219f0bae4102cf744f45e9 and will be in the 1.10 release.
I've been trying to implement VIM replace hotkey when I stumbled upon a weird behavior while using
Any
key in sequential input.Case 1
Minimal reproduction configuration:
The problem:
R R
it outputsrr
, so Any = r.R 1
it outputsrr1
, so Any = r1.This behavior is inconsistent and creates a weird edge case when Any is the same as the key before. The outputs should either be
rrr rr1
(assuming any includes the whole sequence) orrr r1
(assuming any maps to any in input).Case 2
Another potentially related issue:
Gives:
R R
->R 1
->1
!R
is expected to block the firstR
, but not theAny
one according to the documentation.Case 3
This gets even crazier when you try to use it with
Shift
modifier.Gives:
R R
->r
R 1
->r1
R Shift{R}
->rrR
R R 1
->rr1
Here 2 regular Rs output one symbol, but one regular + capital output 3! Also when pressing
1
after 2 Rs, it gives you an extrar
.The Goal
What I ultimately want to achieve is to make this work:
And now it works with every key except for
R
. To make it work every time I added these 2 lines above:Which is not pretty... :(
Ideally I would want this to work with a one liner like
R Shift?{Any} >> Delete Any ArrowLeft
with an optionalShift
modifier (which transfers to the output anyway). But I guess that but be a separate feature request...Specs
Keymapper: 1.9.1 OS: Windows 10 (1809) have not tested on Linux yet