Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with symbolic links #29

Open
narcisse81 opened this issue Feb 2, 2019 · 0 comments
Open

Issue with symbolic links #29

narcisse81 opened this issue Feb 2, 2019 · 0 comments

Comments

@narcisse81
Copy link

When opening a symbolic link on a file, vaffle actually opens the file resolved by the normalize-path function. And I don't think that it is really wise.
I would prefer to edit the link which is local.
To avoid troubles, I had to modify the vaffle#util#normalize_path function:

function! vaffle#util#normalize_path(path) abort
if a:path ==? '/'
return '/'
endif

let result = resolve(a:path)
if !isdirectory(result)
    let result = a:path
endif

" Remove trailing path separator
return (match(result, '\(/\|\\\)$') >= 0)
            \ ? fnamemodify(result, ':h')
            \ : result

endfunction

With this modification, it the result of the resolve function is a directory, the behavior is as in the original version. If it is a regular file, then one keeps the original path.

Best regards
Stephane

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant