]> git.mdlowis.com Git - projs/tide.git/commitdiff
tweaked the selection handling for command execution
authorMichael D. Lowis <mike@mdlowis.com>
Tue, 20 Dec 2016 23:41:30 +0000 (18:41 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Tue, 20 Dec 2016 23:41:30 +0000 (18:41 -0500)
TODO.md
xedit.c

diff --git a/TODO.md b/TODO.md
index b23852ee2cc2fc412cb1b721f7a09e4cdd03dfe2..ba47b899ad6a2f1568ae5bdff142331cce8c8dc2 100644 (file)
--- 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 40c279745729ec3db2835eaee006605a8922f487..903c81c545f7e038cfe55a41d858767a7d730388 100644 (file)
--- 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);