Skip to content
This repository has been archived by the owner on Mar 25, 2019. It is now read-only.

Commit

Permalink
escape special characters in filename
Browse files Browse the repository at this point in the history
  • Loading branch information
donRaphaco committed Feb 6, 2017
1 parent 07d023f commit d46fc70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ftplugin/tex.vim
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ if !exists('s:neotex_loaded')
let s:neotex_loaded = 1
endif

let b:neotex_jobexe='cd ' . expand('%:p:h') . ' && '
let b:neotex_jobexe=''

if get(g:, 'neotex_latexdiff', 0)
let b:neotex_jobexe .= 'latexdiff '
if exists('neotex_latexdiff_options')
let b:neotex_jobexe .= g:neotex_latexdiff_options . ' '
endif
let b:neotex_jobexe .= expand('%:p') . ' ' . s:neotex_buffer_tempname . ' > ' . s:neotex_preview_tempname . ' && '
let b:neotex_jobexe .= fnameescape(expand('%:t')) . ' ' . s:neotex_buffer_tempname . ' > ' . s:neotex_preview_tempname . ' && '
endif

let b:neotex_jobexe .= 'pdflatex -jobname=' . expand('%:t:r') . ' -interaction=nonstopmode '
let b:neotex_jobexe .= 'pdflatex -jobname=' . fnameescape(expand('%:t:r')) . ' -interaction=nonstopmode '
if exists('neotex_pdflatex_add_options')
let b:neotex_jobexe .= g:neotex_pdflatex_add_options . ' '
endif
Expand Down
5 changes: 3 additions & 2 deletions rplugin/python3/neotex.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def __init__(self, vim):
def init(self, args):
self.wait = False
self.delay = self.vim.vars.get('neotex_delay', 1.0)/1000.0
self.latexdiff = bool(self.vim.vars.get('neotex_latexdiff',0))
self.latexdiff = bool(self.vim.vars.get('neotex_latexdiff', 0))
self.tempname = args[0]
self.vim

Expand All @@ -36,4 +36,5 @@ def write(self):
exe = self.vim.eval('b:neotex_jobexe')
with open(self.tempname, 'w') as f:
f.write('\n'.join(buff))
self.vim.funcs.jobstart(exe)
self.vim.funcs.jobstart(['bash', '-c', exe],
{'cwd': self.vim.funcs.expand('%:p:h')})

0 comments on commit d46fc70

Please sign in to comment.