Fix preview of paths starting with ~/#892
Fix preview of paths starting with ~/#892junegunn merged 2 commits intojunegunn:masterfrom ptzz:master
Conversation
|
Thanks. |
|
On zsh when converting FILE this operation adds an extra backslash after the $HOME: Causing history preview to, instead of failing because it doesn't know about ~ in single quotes, fail because it doesn't know why there's a backtick in the middle: Setting shell in vim doesn't seem to help. attached, minimal testing vimrc: let vimDir = '$HOME/.vim'
let &runtimepath.=','.vimDir
set nocompatible
call plug#begin('~/.vim/bundle')
" fzf -- quick jump to file, tag and such
Plug 'junegunn/fzf', { 'dir': '~/.fzf' }
Plug 'junegunn/fzf.vim'
call plug#end()"}}}
" History preview with colorings and such
command! -bang -nargs=* History
\ call fzf#vim#history(fzf#vim#with_preview(), <bang>0
\ )
nnoremap <c-p> :History<cr>Updating the line to FILE="${FILE/#\~/$HOME/}"seems to fix, and testing manually on the shell doesn't seem to break it either, but I do not know for sure. |
|
Seeing the history, I think if ensuring we only substitute FILE="${FILE/#\~\//$HOME/}"
# or
FILE="${FILE/#\~\//$HOME//}"
# since multiple slashes are ignored |
It's a bash script. |
I feel stupid. But now I am out of ideas about why it behaves this way. I wonder if there's some obscure env var that changes the substitution rules, since while this (now) is obviously not a bash/zsh thing, the issue remains that I am getting an extra |
|
Does this correctly print bash version? |
|
Thanks to @junegunn for helping out and pointing out the key to the problem! (Your reply showed up while I was typing, so this came out kinda weird. Seems like I went the right direction though! :) |
Fixes outstanding comments in #774 and #890.