Skip to content

Commit

Permalink
Fix repeat actions with a numeric arg (#242)
Browse files Browse the repository at this point in the history
Fix repeat actions with a numeric arg
  • Loading branch information
LymarV authored and nosami committed Feb 26, 2019
1 parent 7816019 commit f874cc3
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
51 changes: 51 additions & 0 deletions XSVim.Tests/MiscTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,54 @@ module ``Miscellaneous tests`` =
[<Test>]
let ``<C-x> decrements -1``() =
assertText "abc -1$ " "<C-x>" "abc -2$ "

[<Test>]
let ``dot repeats 2dd``() =
assertText
"""
a$aaaa
aaaaa
bbbbb
bbbbb
ccccc
"""

"2dd."

"""
c$cccc
"""

[<Test>]
let ``dot repeats 2dj``() =
assertText
"""
a$aaaa
aaaaa
aaaaa
bbbbb
bbbbb
bbbbb
"""

"2dj."

"""
$"""

[<Test>]
let ``dot repeats 3S``() =
assertText
"""
a$aaaa
aaaaa
bbbbb
bbbbb
ccccc
ccccc"""

"3S<esc>."

"""
$ ccccc"""
2 changes: 2 additions & 0 deletions XSVim/XSVim.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1772,6 +1772,8 @@ module Vim =
macros.[m] <- macros.[m] @ [ typeChar vimKey ])
//{ newState with lastAction = newState.lastAction @ [ typeChar vimKey ]}
newState
| NotInsertMode, _, SwitchMode VisualMode
| NotInsertMode, _, SwitchMode VisualLineMode
| NotInsertMode, _, Delete
| NotInsertMode, _, Change
| NotInsertMode, _, Indent
Expand Down

0 comments on commit f874cc3

Please sign in to comment.