vim-htmldjango_omnicomplete icon indicating copy to clipboard operation
vim-htmldjango_omnicomplete copied to clipboard

Windows paths.

Open Shtucer opened this issue 9 years ago • 5 comments

Backslashes in Windows paths makes suggestions unusebale. I've replaced backslashes in get_template_names(): word' : os.path.join(root,f).replace(d,'').replace("\\","/")

and get_staticfiles(): matches.append(dict(word=path.replace("\\","/"),info='')) and It's work... sort of.

Shtucer avatar Oct 23 '15 10:10 Shtucer

I think in get_template_names(pattern) we should change one line

d = d + ('/' if not d.endswith('/') else '')

to

d = d + (os.path.sep if not d.endswith(os.path.sep) else '')

And htmldjangocomplete(context, match):

    for cmpl in all:
        dictstr += '{'
        for x in cmpl: dictstr += '"%s":"%s",' % (x,cmpl[x].replace("\\","\\\\")) # Windows slashes must be escaped
        dictstr += '"icase":0},'

Shtucer avatar Nov 14 '15 15:11 Shtucer

Thanks. Again If you have time to set this up as a pull request (rather than copying it in the ticket) I'd appreciate it. Otherwise I'll get to it when I have time later this week.

mjbrownie avatar Nov 17 '15 03:11 mjbrownie

Hmm... how I can do this? I made a lot (or a few) changes: extract load_libs() to external file load_libs.py, python3, and so on....

Shtucer avatar Nov 23 '15 11:11 Shtucer

Sure I see your work has diverged on your fork. Don't worry if it is too difficult, but a method would be to publish a compatible branch on your forked repository. It depends on how advanced you are with git branching and remotes

#get the main repository git remote add mjbrownie https://github.com/mjbrownie/vim-htmldjango_omnicomplete.git git fetch mjbrownie #create a new branch based on the original master, git checkout -b fix_18_template_dirs mjbrownie/master ... perform fix commits ... #push to your published fork git push origin fix_18_template_dirs .. on the website ... follow pull request instructions.

#then go back to your own work git checkout master

mjbrownie avatar Nov 23 '15 23:11 mjbrownie

Explain. Thanks.

Shtucer avatar Nov 24 '15 13:11 Shtucer