Up Next:
-* update edit to cd to dir containing tags file if it exists
+* clipboard does not persist after exit
+* Run commands in the background and don't block the main thread.
* Make Fn keys execute nth command in the tags buffer
* check for file changes on save
* check for file changes when window regains focus
* Right click in tags region should search edit region
* 100% coverage with unit and unit-integration tests
-* selecting text should set PRIMARY x11 selection
* Add a SaveAs tag that takes an argument for the filename to save as
* Add a GoTo tag for ctags lookup and line number jump (or right click magic?)
* Add keyboard shortcut to highlight the thing under the cursor
* right click to fetch file or line
+* selecting text should set PRIMARY x11 selection
Straight-up Bugs:
* ctrl+space selects too large of a word in some cases (function names followed by paren)
-* tab inserts dont coalesce like one would expect
* off by one error on scrolling up with wrapped lines
* Ctrl+u with a selection clears to bol *before* selected text
-* clipboard does not persist after exit
+* tab inserts dont coalesce like one would expect
The Future:
-* Run commands in the background and don't block the main thread.
* shortcut to repeat previous operation
* add command line flags to toggle options (Tabs, Indent, etc..)
* add command env vars to set options (Tabs, Indent, etc..)
#!/bin/sh
+# search for a ctags file recursively up the directory tree from the file to be
+# opened. If one is found, change the working directory of the new process to
+# the containing folder and launch xedit with the path of the file relative to
+# the new working directory.
+edit_relative_ctags(){
+ file="$(realpath -m "$1")"
+ path="$(basename "$file")"
+ dir="$(dirname "$file")"
+ while [ "$dir" != "/" ]; do
+ if [ -f "$dir/tags" ]; then
+ cd "$dir"
+ (nohup xedit "$path" > /dev/null 2>&1) &
+ #echo "cd to $dir" >2
+ #cd "$dir"
+ #echo "$path"
+ return 0
+ else
+ path="$(basename "$dir")/$path"
+ dir="$(dirname "$dir")"
+ fi
+ done
+ (nohup xedit "$1" > /dev/null 2>&1) &
+}
+
# Add the editing tools directory to your PATH var so its contents may be used
# while editing.
export PATH="$HOME/.config/edit/tools:$PATH"
(nohup xedit > /dev/null 2>&1) &
else
for f in "$@"; do
- (nohup xedit "$f" > /dev/null 2>&1) &
+ edit_relative_ctags "$f" &
done
fi