"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "plugins/autojump" between
nnn-v4.1.1.tar.gz and nnn-v4.2.tar.gz

About: nnn is a full-featured terminal file manager.

autojump  (nnn-v4.1.1):autojump  (nnn-v4.2)
#!/usr/bin/env sh #!/usr/bin/env sh
# Description: Navigate to directory using jump/autojump/zoxide # Description: Navigate to directory using jump/autojump/zoxide/z
# #
# Dependencies: # Dependencies:
# - jump - https://github.com/gsamokovarov/jump # - jump - https://github.com/gsamokovarov/jump
# - OR autojump - https://github.com/wting/autojump # - OR autojump - https://github.com/wting/autojump
# - OR zoxide - https://github.com/ajeetdsouza/zoxide # - OR zoxide - https://github.com/ajeetdsouza/zoxide
# - OR z - https://github.com/rupa/z (z requires fzf)
# #
# Note: The dependencies STORE NAVIGATION PATTERNS # Note: The dependencies STORE NAVIGATION PATTERNS
# #
# Shell: POSIX compliant # Shell: POSIX compliant
# Authors: Marty Buchaus, Dave Snider, Tim Adler # Authors: Marty Buchaus, Dave Snider, Tim Adler, Nick Waywood
if [ ! -p "$NNN_PIPE" ]; then if [ ! -p "$NNN_PIPE" ]; then
printf 'ERROR: NNN_PIPE is not set!' printf 'ERROR: NNN_PIPE is not set!'
read -r _ read -r _
exit 2 exit 2
fi fi
if type jump >/dev/null 2>&1; then if type jump >/dev/null 2>&1; then
printf "jump to : " printf "jump to : "
read -r dir read -r dir
skipping to change at line 42 skipping to change at line 43
if type fzf >/dev/null 2>&1; then if type fzf >/dev/null 2>&1; then
odir="$(zoxide query -i --)" odir="$(zoxide query -i --)"
printf "%s" "0c$odir" > "$NNN_PIPE" printf "%s" "0c$odir" > "$NNN_PIPE"
else else
printf "jump to : " printf "jump to : "
read -r dir read -r dir
odir="$(zoxide query -- "$dir")" odir="$(zoxide query -- "$dir")"
printf "%s" "0c$odir" > "$NNN_PIPE" printf "%s" "0c$odir" > "$NNN_PIPE"
fi fi
else else
printf "No supported autojump script found. (jump/autojump/zoxide are suppor datafile="${_Z_DATA:-$HOME/.z}"
ted)" if type fzf >/dev/null 2>&1 && [ -f "$datafile" ]; then
read -r _ # Read the data from z's file instead of calling
# z so the data doesn't need to be processed twice
sel=$(awk -F "|" '{print $1}' "$datafile" | fzf | awk '{$1=$1};1')
# NOTE: Uncomment this line and comment out the line above if
# you want to see the weightings of the dir's in the fzf pane
# sel=$(awk -F "|" '{printf "%s %s\n", $2, $1}' "$datafile" | fzf | sed
's/^[0-9,.]* *//' | awk '{$1=$1};1')
printf "%s" "0c$sel" > "$NNN_PIPE"
else
printf "No supported autojump script [jump/autojump/zoxide/z (needs fzf)
] found"
read -r _
fi
fi fi
 End of changes. 4 change blocks. 
5 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)