From 1d714ed885aeeae40003dfb99bd31ad27d536646 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Tue, 20 Dec 2016 18:41:30 -0500 Subject: [PATCH] tweaked the selection handling for command execution --- TODO.md | 2 ++ xedit.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index b23852e..ba47b89 100644 --- a/TODO.md +++ b/TODO.md @@ -3,6 +3,7 @@ * Indent on first line of buffer causes infinite loop * block selection should handle brace-balancing * Add tag for ctags lookup and line number jump +* Add a SaveAs tag that takes an argument for the filename to save as * add a shortcut to autocomplete ctag * Use select to check for error strings in exec.c * Should not be able to undo initial tag line text insertion @@ -12,6 +13,7 @@ Nice to haves: +* Undo/Redo should set selection to inserted text. * focus should follow mouse between regions * Expand tabs setting should be disabled if opened file contains tabs * Add a tools dir to namespace utility scripts only useful inside the editor diff --git a/xedit.c b/xedit.c index 40c2797..903c81c 100644 --- a/xedit.c +++ b/xedit.c @@ -685,7 +685,7 @@ static void cmd_exec(char* cmd) { /* execute the command */ char *input = NULL, *output = NULL, *error = NULL; enum RegionId dest = EDIT; - if (0 == view_selsize(getview(EDIT))) + if (op && op != '<' && 0 == view_selsize(getview(EDIT))) getview(EDIT)->selection = (Sel){ .beg = 0, .end = buf_end(getbuf(EDIT)) }; input = view_getstr(getview(EDIT), NULL); -- 2.52.0