diff --git a/share/completions/scp.fish b/share/completions/scp.fish index d8de37b3f..c003512d6 100644 --- a/share/completions/scp.fish +++ b/share/completions/scp.fish @@ -47,13 +47,15 @@ complete -c scp -d "Local Path" -n "not string match @ -- (commandline -ct)" complete -c scp -d "Remote Path" -f -n "commandline -ct | string match -e ':'" -a ' (__scp_remote_target):( if not set -q __fish_scp_sftp - set -l tmp (__fish_mktemp_relative fish-scp) - if scp -P(__scp2ssh_port_number) -o "BatchMode yes" -q -O $tmp (__scp_remote_target):/dev/null + if set -l tmp (__fish_mktemp_relative fish-scp) + and scp -P(__scp2ssh_port_number) -o "BatchMode yes" -q -O $tmp (__scp_remote_target):/dev/null set -g __fish_scp_sftp true else set -g __fish_scp_sftp false end - rm $tmp + if set -q tmp[1] + rm $tmp + end end if $__fish_scp_sftp command ssh -p(__scp2ssh_port_number) -o "BatchMode yes" (__scp_remote_target) command\ ls\ -dp\ (__scp_remote_path_prefix)\* 2>/dev/null diff --git a/share/functions/__fish_data_with_directory.fish b/share/functions/__fish_data_with_directory.fish index d87c86808..5390b5965 100644 --- a/share/functions/__fish_data_with_directory.fish +++ b/share/functions/__fish_data_with_directory.fish @@ -9,6 +9,7 @@ function __fish_data_with_directory set directory_ref $__fish_data_dir/$relative_directory else set temp (__fish_mktemp_relative -d fish-data) + or return if set -l paths (status list-files $relative_directory | string match -r \ "^$(string escape --style=regex $relative_directory)/(?:$file_regex)\$") diff --git a/share/functions/edit_command_buffer.fish b/share/functions/edit_command_buffer.fish index 6d4177d21..fade32598 100644 --- a/share/functions/edit_command_buffer.fish +++ b/share/functions/edit_command_buffer.fish @@ -44,12 +44,14 @@ function edit_command_buffer --description 'Edit the command buffer in an extern break end set cursor_from_editor (__fish_mktemp_relative fish-edit_command_buffer) + or return set -a editor +$line "+norm! $col|" $f \ '+au VimLeave * ++once call writefile([printf("%s %s %s", shellescape(bufname()), line("."), col("."))], "'$cursor_from_editor'")' case emacs emacsclient gedit set -a editor +$line:$col $f case kak set cursor_from_editor (__fish_mktemp_relative fish-edit_command_buffer) + or return set -a editor +$line:$col $f -e " hook -always -once global ClientClose %val{client} %{ echo -to-file $cursor_from_editor -quoting shell \