vim: Set current line as default sed command scope (#17234)

Closes #16977

Release Notes:
- added current line as default sed range to match vim's behavior
- changed tests accordingly

This also simplifies `ReplaceCommand` implementation by changing
`Option<CommandRange>` to `CommandRange` .
This commit is contained in:
Horam Zarri
2024-09-04 13:26:32 -06:00
committed by GitHub
parent 65bc1ea7c8
commit 694c912201
3 changed files with 39 additions and 25 deletions
+12 -3
View File
@@ -1,4 +1,4 @@
{"Put":{"state":"ˇa\nb\nc"}}
{"Put":{"state":"ˇa\nb\nb\nc"}}
{"Key":":"}
{"Key":"%"}
{"Key":"s"}
@@ -7,7 +7,7 @@
{"Key":"/"}
{"Key":"d"}
{"Key":"enter"}
{"Get":{"state":"a\nˇd\nc","mode":"Normal"}}
{"Get":{"state":"a\nd\nˇd\nc","mode":"Normal"}}
{"Key":":"}
{"Key":"%"}
{"Key":"s"}
@@ -19,4 +19,13 @@
{"Key":"\\"}
{"Key":"0"}
{"Key":"enter"}
{"Get":{"state":"aa\ndd\nˇcc","mode":"Normal"}}
{"Get":{"state":"aa\ndd\ndd\nˇcc","mode":"Normal"}}
{"Key":"k"}
{"Key":":"}
{"Key":"s"}
{"Key":"/"}
{"Key":"dd"}
{"Key":"/"}
{"Key":"ee"}
{"Key":"enter"}
{"Get":{"state":"aa\ndd\nˇee\ncc", "mode":"Normal"}}