Skip to content

Commit

Permalink
fix: UpdateRemotePlugins not finding specs on Windows #565
Browse files Browse the repository at this point in the history
Specs were being found with a normalized path, but being requested
without normalization. We now normalize the path we responding to spec
requests.

fixes #564
  • Loading branch information
tanj authored Apr 14, 2024
1 parent 9f3e010 commit d6dc8cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pynvim/plugin/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging
import os
import os.path
import pathlib
import re
import sys
from functools import partial
Expand Down Expand Up @@ -173,7 +174,7 @@ def _load(self, plugins: Sequence[str]) -> None:
# self.nvim.err_write("host init _load\n", async_=True)
has_script = False
for path in plugins:
path = os.path.normpath(path) # normalize path
path = pathlib.Path(os.path.normpath(path)).as_posix() # normalize path
err = None
if path in self._loaded:
warn('{} is already loaded'.format(path))
Expand Down Expand Up @@ -276,6 +277,7 @@ def _copy_attributes(self, fn, fn2):

def _on_specs_request(self, path):
path = decode_if_bytes(path)
path = pathlib.Path(os.path.normpath(path)).as_posix() # normalize path
if path in self._load_errors:
self.nvim.out_write(self._load_errors[path] + '\n')
return self._specs.get(path, 0)
Expand Down

0 comments on commit d6dc8cf

Please sign in to comment.