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

Plugin mistakenly identifies files with the same name in different directories as identical #18

Open
clinta opened this issue Feb 21, 2018 · 3 comments
Labels

Comments

@clinta
Copy link

clinta commented Feb 21, 2018

I tried working around this with set titlestring=%{expand(\"%:p:h\")} in my vimrc, but this did not solve the issue.

@gioele gioele added the bug label Jul 25, 2018
@djvs
Copy link

djvs commented Oct 17, 2018

Same problem.

@djvs
Copy link

djvs commented Oct 17, 2018

I got it working with:

set titlestring=vi\:\ %-25.55F\ %a%r%m titlelen=70

Good enough for me.

@jflorian
Copy link

jflorian commented May 23, 2019

Seems like any solution for this is going to need to use readlink -f FILENAME (on Linux) to handle this case correctly. Consider the following:

gvim ../foo
cd ..
gvim foo

Here we have two different names given to gvim, but for the same file. Using readlink -f to get the canonical path will ensure the equality test is accurate. Granted $SUBJECT is about two different files and I'm describing two references to the same file, but I believe it still applies and simplifies how the fix should work.

It appears from testing that vim's fnamemodify function does yield the canonical path when given the :p option. So that makes a good platform-agnostic solution here.

jflorian pushed a commit to jflorian/vim-autoswap that referenced this issue May 23, 2019
This resolves issue gioele#18, at least for Linux.  The window matching (via
wmctrl) had the following problems:

- it was not case sensitive, yet Linux file systems generally are

- it matched only the base name, ignoring the path which led to false
matches

Signed-off-by: John Florian <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants