reimplement d% motion so that it first searches for the next occurrence of a pair-character before trying to match it. (Next: add tests for d% motion.)
This commit is contained in:
@@ -1132,9 +1132,17 @@ struct
|
||||
fun deletePair (app: app_type, time) =
|
||||
let
|
||||
val {cursorIdx, buffer, dfa, ...} = app
|
||||
val otherIdx = Cursor.matchPair (buffer, cursorIdx)
|
||||
val buffer = LineGap.goToIdx (cursorIdx, buffer)
|
||||
val otherIdx = Cursor.nextPairChr (buffer, cursorIdx)
|
||||
in
|
||||
if otherIdx = cursorIdx then
|
||||
if otherIdx = ~1 then
|
||||
NormalFinish.clearMode app
|
||||
else
|
||||
let
|
||||
val buffer = LineGap.goToIdx (otherIdx, buffer)
|
||||
val otherIdx = Cursor.matchPair (buffer, otherIdx)
|
||||
in
|
||||
if otherIdx = ~1 then
|
||||
NormalFinish.clearMode app
|
||||
else
|
||||
let
|
||||
@@ -1165,3 +1173,4 @@ struct
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
4
todo.md
4
todo.md
@@ -1,9 +1,7 @@
|
||||
# To-do list
|
||||
|
||||
- Add tests for:
|
||||
- Reimplement `d%` motion.
|
||||
- It should both search for the next character in any pair, the same way in Vim
|
||||
- Add tests for reimplemented movements and motions
|
||||
- `d%` motion
|
||||
- Reimplement `di<symbol>` and `da<symbol>`
|
||||
- They should search for the next char in the specific pair, the same way in Vim
|
||||
- Add tests for both
|
||||
|
||||
Reference in New Issue
Block a user