Skip to content

Issue with symbolic links #29

@narcisse81

Description

@narcisse81

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions