Skip to content

Commit e87a513

Browse files
authored
ed: r command should not updated saved filename (briandfoy#920)
* edEdit() implements r and e, but r does not technically change the file being edited; it only adds more content to the file's buffer * r command was updating $RememberedFilename which is undesirable * edEdit() is too complicated, so I'd like to split it soon into 2 functions: edEdit() for e and edRead() for r (currently edRead() is a helper function calling edEdit()) * test1: open a one.c file, "r" a two.s, then verify with "f" command that the editor file is still one.c * test1: open a one.c file, "r !ifconfig" to include command output in buffer, then verify with "f" command as before
1 parent c35ac25 commit e87a513

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bin/ed

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,8 @@ sub edEdit {
711711
return E_FNAME unless (length $args[0]);
712712
if ($args[0] =~ s/\A\!//) {
713713
$do_pipe = 1;
714-
} else {
714+
}
715+
if (!$InsertMode && !$do_pipe) {
715716
$RememberedFilename = $args[0];
716717
}
717718
$filename = $args[0];

0 commit comments

Comments
 (0)