~sirver/ultisnips/github_mirror

Viewing all changes in revision 1063.

  • Committer: GitHub
  • Author(s): David Briscoe
  • Date: 2022-02-17 13:29:13 UTC
  • Revision ID: git-v1:ca21d30c7a72e0e18ad95f25ded5a5f820052685
Resolve paths to avoid duplicates in UltiSnipsEdit (#1440)

Use realpath to get the actual path so symlink directories are counted
as equal and excluded from the set of output.

When dotfiles are symlinked:

> dir c:\users\idbrii\.vim
...
2020-12-08  04:01 PM    <SYMLINKD>     .vim [C:\dotfiles\vim]

`:UltiSnipsEdit!` outputs:

    1: C:\Users\idbrii/.vim/bundle/david-snippets/UltiSnips/fugitive.snippets
  * 2: c:\dotfiles\vim\bundle\david-snippets\ultisnips\all.snippets
  * 3: c:\dotfiles\vim\bundle\david-snippets\ultisnips\all\shebang.snippets
  * 4: c:\dotfiles\vim\bundle\snippets\ultisnips\all.snippets
  * 5: c:\dotfiles\vim\bundle\project\ultisnips\all.snippets
  * 6: c:\users\idbrii\.vim\bundle\david-snippets\ultisnips\all.snippets
  * 7: c:\users\idbrii\.vim\bundle\david-snippets\ultisnips\all\shebang.snippets
    8: c:\users\idbrii\.vim\ultisnips\all.snippets
    9: c:\users\idbrii\.vim\ultisnips\fugitive.snippets

2,6 and 3,7 are duplicates.

This fixes the same issue on linux with similar symlink setup:
  $ ls -l ~/.vim
  lrwxrwxrwx 1 idbrii idbrii 49 Jan 24  2021 /home/idbrii/.vim -> /home/idbrii/dotfiles/vim

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: