gerw / vim-latex-suite

71 stars 16 forks source link

Fixed directory of tempfile while part-compiling (under windows at least... #13

Closed cristobaltapia closed 9 years ago

cristobaltapia commented 9 years ago

When compiling a part of a file under windows, the temp-file was placed one directory above of where it should have been. I fixed this by appending a '/' (slash) at the end of the command "expand('%:p:h')" that gives the name of the current directory. Now it is working as expected.

gerw commented 9 years ago

The current version works as expected. In Tex_GetTempName, (main.vim:561), a slash is inserted anyway, see line 563. Can you check why that does not work for you?

cristobaltapia commented 9 years ago

I will look at it again tomorrow on my work. I have tested it now in my computer running arch linux and it works OK.

cristobaltapia commented 9 years ago

So I don't understand exactly why, but the regex that is supposed to match the '/' or '\' at the end of the line ('\\\|/$') does not work in my computer. I changed it to '[\\\/]$' and it works. Strange.

gerw commented 9 years ago

Maybe the interpretation of the regexp depends on the magic setting :help magic?

cristobaltapia commented 9 years ago

I think there is nothing wrong with the magic setting. The problem is that the regexp '\\\|/$' only matches the '/' at the end of the line, while detecting any '\' (not only at the end of the line). Thus, as a path in windows will always have '\' (backslash) it will always return 1 and no slash will be appended. The last regexp I submitted is a small modification of the original and should work always.

gerw commented 9 years ago

Yes, that is the solution. Can you merge the three commits into a single one?

cristobaltapia commented 9 years ago

Sure! I had to make another pull request, because you can't send merged commits into the same branch in github.