Skip to content

Commit 524062c

Browse files
authoredNov 8, 2024··
ed: make wq shortcut work again (#790)
* Previously typing wq was supported, but recent changes in edParse() broke it * Command suffix processing goes before check for a space, then optional filename argument * This time document wq in pod
1 parent b488c0f commit 524062c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎bin/ed

+9
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,11 @@ sub edParse {
951951
}
952952
if (s/\A([acdEefHhijlmnPpQqrstWw=\!])//) { # optional argument
953953
$command = $1;
954+
if ($command eq 'W' || $command eq 'w') {
955+
if (s/\A[Qq]//) {
956+
$commandsuf = 'q';
957+
}
958+
}
954959
if ($WANT_FILE{$command} && m/\A\S/) {
955960
return 0; # space before filename
956961
}
@@ -1303,6 +1308,10 @@ Write buffer to file in append mode
13031308
13041309
Write buffer to file
13051310
1311+
=item wq [FILE]
1312+
1313+
Write buffer to file, then quit
1314+
13061315
=item =
13071316
13081317
Display current line number

0 commit comments

Comments
 (0)
Please sign in to comment.