From: Michael D. Lowis Date: Tue, 31 Jan 2017 19:41:54 +0000 (-0500) Subject: Fixed issue with unit tests, added a new etabs function to the rc file and tweaked... X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=1667dd313b2dfb86b32641b3601888e3cea9183c;p=projs%2Ftide.git Fixed issue with unit tests, added a new etabs function to the rc file and tweaked the edit script to load the rc file exactly once --- diff --git a/edit b/edit index 6da5094..b4b53dd 100755 --- a/edit +++ b/edit @@ -9,6 +9,11 @@ export PATH="$HOME/.config/edit/tools:$PATH" export EDITRCFILE="$HOME/.config/edit/editrc" export BASH_ENV="$EDITRCFILE" +# Load the rc file +if [ -f "$EDITRCFILE" ]; then + . "$EDITRCFILE" +fi + # Now figure out the correct editor to execute if [ -z "$DISPLAY" ]; then if [ -z "$EDITOR" ]; then @@ -20,7 +25,6 @@ elif [ 0 -eq $# ]; then (nohup xedit > /dev/null 2>&1) & else for f in "$@"; do - [ -f "$EDITRCFILE" ] && . "$EDITRCFILE" (nohup xedit "$f" > /dev/null 2>&1) & done fi diff --git a/editrc b/editrc index 6cd3eaf..a984698 100644 --- a/editrc +++ b/editrc @@ -24,3 +24,6 @@ uc(){ sed -e 's/^\/\///'; } bcmt(){ sed -e 's/^/#/'; } ucmt(){ sed -e 's/^#//'; } +# Expand tabs to spaces +etabs(){ sed -e 's/\t/ /g'; } + diff --git a/tests/xedit.c b/tests/xedit.c index 5146457..13d67ff 100644 --- a/tests/xedit.c +++ b/tests/xedit.c @@ -23,6 +23,7 @@ void mockexit(int code) { /* Helper Functions *****************************************************************************/ void setup_view(enum RegionId id, char* text, int crlf, unsigned cursor) { + ShellCmd[0] = "/bin/sh"; Focused = id; view_init(getview(id), NULL); getbuf(id)->crlf = crlf;