mjbrownie / vim-htmldjango_omnicomplete

htmldjango filetype omnicomplete - completes template tags/filters/variables
26 stars 5 forks source link

Windows paths. #9

Open Shtucer opened 8 years ago

Shtucer commented 8 years ago

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 commented 8 years ago

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},'
mjbrownie commented 8 years ago

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.

Shtucer commented 8 years ago

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....

mjbrownie commented 8 years ago

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

Shtucer commented 8 years ago

Explain. Thanks.