You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Highlighting fails in windows because the file system paths contain backslashes.
When you match the path from g:coveragepy_session_map against the absolute path of the current buffer, it will always return 0 because of the way backslashes behave in regex patterns.
To fix this, I changed the pattern like this: let path_pattern = '\M' . substitute(path, '\\', '\\\\', 'g')
Doubling the backslashes will make the pattern work as expected.
I only tested on Windows, but I don't see any reason why it wouldn't work on *nix systems as well.
The text was updated successfully, but these errors were encountered:
I tried but it does not work, fnameescape does not escape backslashes. I had to do it explicitly w/ escape, and I also enabled very nomagic mode in the path pattern. See the pull request #21 .
Could you provide of examples of what you are seeing as inputs, how those don't get escaped and what is the correct outcome for those inputs? I do see that fnameescape() correctly escapes backslashes, but I guess my example is not what you are seeing:
Highlighting fails in windows because the file system paths contain backslashes.
When you match the path from
g:coveragepy_session_map
against the absolute path of the current buffer, it will always return 0 because of the way backslashes behave in regex patterns.To fix this, I changed the pattern like this:
let path_pattern = '\M' . substitute(path, '\\', '\\\\', 'g')
Doubling the backslashes will make the pattern work as expected.
I only tested on Windows, but I don't see any reason why it wouldn't work on *nix systems as well.
The text was updated successfully, but these errors were encountered: