-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ed: factor r command out of edEdit() (#922)
* Edit (e) command has a forceful alternative (E), but read (r) command doesn't (since r doesn't destroy the buffer) * edEdit() continues to handle e and E ($QuestionsMode param determines the mode) * r and e commands both use the saved filename if no argument is provided * Command arguments starting with '!' now call function init_pipe(), which rejects NUL and provides an argument list to pipe form of open() * Also add helper functions open_file_ro() and readin_lines() for common code * r command never updates $RememberedFilename; e command updates it if a file argument was provided * test1: "e !this" --> bad command, show error, buffer unchanged * test2: "r !this" --> same as test1 * test3: "e !ls -l" --> buffer replaced with ls output if buffer is clean * test4: "E !echo E" --> buffer replaced with ls output unconditionally * test5: "1,2e a.s" --> invalid command, e doesn't take any addresses * test6: "0r a.s" --> file a.s is read into the beginning of the buffer
- Loading branch information
Showing
1 changed file
with
105 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters