Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continuous mode can not work in Neovim #2291

Closed
RnYi opened this issue Jan 3, 2022 · 51 comments
Closed

Continuous mode can not work in Neovim #2291

RnYi opened this issue Jan 3, 2022 · 51 comments
Labels

Comments

@RnYi
Copy link

RnYi commented Jan 3, 2022

Description

  1. Cannot auto open sumatraPDF while in continuous mode. But it can work in vim.
  2. Multiple errors are reported when running some commands, such as VimtexCompile, VimtexClean.

Steps to reproduce

  1. nvim -u minimal.vim minimal.tex
  2. run :VimtexCompile

Expected behavior

Auto open sumatraPDF.

Actual behavior

latexmk succeed in compiling tex file and producing a pdf, but doesn't open sumatraPDF.

Do you use a latexmkrc file?

No

VimtexInfo

System info:
  OS:  ()
  Vim version: NVIM v0.7.0-dev+761-g0d7a97224
  Has clientserver: true
  Servername: \\.\pipe\nvim-12348-0

VimTeX project: mininal
  base: mininal.tex
  root: C:\Users\RanY\.vim
  tex: C:\Users\RanY\.vim\mininal.tex
  main parser: current file verified
  document class: minimal
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
  viewer: General
  qf method: LaTeX logfile
@RnYi RnYi added the bug label Jan 3, 2022
@clason
Copy link
Contributor

clason commented Jan 3, 2022

I think it would be rather helpful to add these "multiple errors" (and your minimal.vim!) to your bug report, otherwise it's hard to tell what's going on.

@lervag
Copy link
Owner

lervag commented Jan 3, 2022

What @clason said. Please add more details!

@RnYi
Copy link
Author

RnYi commented Jan 4, 2022

I think it would be rather helpful to add these "multiple errors" (and your minimal.vim!) to your bug report, otherwise it's hard to tell what's going on.

I strictly use the example of minimal.vim:

set nocompatible
let &runtimepath  = '~/.vim/bundle/vimtex,' . &runtimepath
let &runtimepath .= ',~/.vim/bundle/vimtex/after'
filetype plugin indent on
syntax enable

Run :VimtexCompile the second time, some errors are reported:
屏幕截图 2022-01-04 120349

@clason
Copy link
Contributor

clason commented Jan 4, 2022

This means you haven't actually configured Sumatra as your viewer! See :h vimtex-view-sumatrapdf.

@lervag
Copy link
Owner

lervag commented Jan 4, 2022

I believe I fixed the problem with the error message - please update and test.

@RnYi
Copy link
Author

RnYi commented Jan 4, 2022

This means you haven't actually configured Sumatra as your viewer! See :h vimtex-view-sumatrapdf.

I don't think so...I have sumatraPDF executable in path, and as I have said, vimtex works well in vim (open pdf automaticliy after finishing compiling), but not in neovim.

@RnYi
Copy link
Author

RnYi commented Jan 4, 2022

I believe I fixed the problem with the error message - please update and test.

Yes, errors go away. But sumatraPDF still not be automaticliy opened.

@lervag
Copy link
Owner

lervag commented Jan 4, 2022

I strictly use the example of minimal.vim:

set nocompatible
let &runtimepath  = '~/.vim/bundle/vimtex,' . &runtimepath
let &runtimepath .= ',~/.vim/bundle/vimtex/after'
filetype plugin indent on
syntax enable

I you use the above minimal.vim, then you did not setup SumatraPDF as explain in :help vimtex-view-sumatrapdf.

@RnYi
Copy link
Author

RnYi commented Jan 4, 2022

I strictly use the example of minimal.vim:

set nocompatible
let &runtimepath  = '~/.vim/bundle/vimtex,' . &runtimepath
let &runtimepath .= ',~/.vim/bundle/vimtex/after'
filetype plugin indent on
syntax enable

I you use the above minimal.vim, then you did not setup SumatraPDF as explain in :help vimtex-view-sumatrapdf.

As described in docs:

For convenience, the above configuration is used by default on Windows if
SumatraPDF is detected as executable.

And I also tried to setup by myself, this bug still exists.

@lervag
Copy link
Owner

lervag commented Jan 4, 2022

Hah, good point, sorry. :)

@lervag
Copy link
Owner

lervag commented Jan 4, 2022

Question: Does it work with Vim but not neovim?

@RnYi
Copy link
Author

RnYi commented Jan 4, 2022

Yes. And I just find another bug, quickfix also are not opened even though tex file has errors.

@lervag
Copy link
Owner

lervag commented Jan 4, 2022

Strange. I've pulled up a Windows VM and for me, everything works as expected. Can you explain in more detail how your system is configured?

@lervag
Copy link
Owner

lervag commented Jan 4, 2022

Which OS (including version).

@lervag
Copy link
Owner

lervag commented Jan 4, 2022

Did you read :help vimtex-faq-windows? Are you using Strawberry perl for latexmk? Are you somehow using special values of the shell option in Vim?

@RnYi
Copy link
Author

RnYi commented Jan 4, 2022

Strange. I've pulled up a Windows VM and for me, everything works as expected. Can you explain in more detail how your system is configured?

OS: Windows 10 21H1
SumatraPDF: portable v3.3.3, I create a symlink for the executable (SumatraPDF.exe -> SumatraPDF-3.3.3-64.exe), and add the dir to path.
texlive: installed with recently texlive.iso except for bundled editor and some languages.

@RnYi
Copy link
Author

RnYi commented Jan 4, 2022

vimtex-faq-windows

No, not using Strawberry perl, my shell keeps default value.

@lervag
Copy link
Owner

lervag commented Jan 4, 2022

Yes. And I just find another bug, quickfix also are not opened even though tex file has errors.

I believe the error is with the latexmk setup somehow.

Can you do this:

  1. Start the minimal setup with a minimal latex file.
  2. Do \ll to start compilation.
  3. Do \lo to open the compiler output - copy the output here.

No, not using Strawberry perl

How is latexmk installed? I do recommend installing strawberry perl...

@RnYi
Copy link
Author

RnYi commented Jan 4, 2022

Yes. And I just find another bug, quickfix also are not opened even though tex file has errors.

I believe the error is with the latexmk setup somehow.

Can you do this:

  1. Start the minimal setup with a minimal latex file.
  2. Do \ll to start compilation.
  3. Do \lo to open the compiler output - copy the output here.

No, not using Strawberry perl

How is latexmk installed? I do recommend installing strawberry perl...

my latexmk is installed by texlive. I installed straberry perl, compiler output below:

Rc files read:
  NONE
Latexmk: This is Latexmk, John Collins, 29 September 2020, version: 4.70b.
Not using a previewer
======= Need to update make_preview_continuous for target files
------------
Running 'echo vimtex_compiler_callback_compiling'
------------
vimtex_compiler_callback_compiling
Rule 'pdflatex': The following rules & subrules became out-of-date:
      'pdflatex'
------------
Run number 1 of rule 'pdflatex'
------------
Latexmk: applying rule 'pdflatex'...
------------
Running 'pdflatex  -file-line-error -synctex=1 -interaction=nonstopmode -recorder  "minimal.tex"'
------------
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/W32TeX) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./minimal.tex

LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-02-18>
 (d:/texlive/2021/texmf-dist/tex/latex/base/minimal.cls

Document Class: minimal 2001/05/25 Standard LaTeX minimal class
)
 (d:/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
)
 (./minimal.aux)
 [1
{d:/texlive/2021/texmf-var/fonts/map/pdftex/updmap/pdftex.map
}
]
 (./minimal.aux
)
 )<d:/texlive/2021/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb
>

Output written on minimal.pdf (1 page, 11767 bytes).
SyncTeX written on minimal.synctex.gz.

Transcript written on minimal.log.
Latexmk: Log file says output to 'minimal.pdf'
Rule 'pdflatex': File changes, etc:
   Changed files, or newly in use since previous run(s):
      'minimal.aux'
------------
Run number 2 of rule 'pdflatex'
------------
------------
Running 'pdflatex  -file-line-error -synctex=1 -interaction=nonstopmode -recorder  "minimal.tex"'
------------
Latexmk: Examining 'minimal.log'
=== TeX engine is 'pdfTeX'
Latexmk: applying rule 'pdflatex'...
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/W32TeX) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./minimal.tex

LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-02-18>
 (d:/texlive/2021/texmf-dist/tex/latex/base/minimal.cls

Document Class: minimal 2001/05/25 Standard LaTeX minimal class
)
 (d:/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
)
 (./minimal.aux)
 [1
{d:/texlive/2021/texmf-var/fonts/map/pdftex/updmap/pdftex.map
}
]
 (./minimal.aux
)
 )<d:/texlive/2021/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb
>

Output written on minimal.pdf (1 page, 11767 bytes).
SyncTeX written on minimal.synctex.gz.

Transcript written on minimal.log.
Latexmk: Log file says output to 'minimal.pdf'
Latexmk: Examining 'minimal.log'
=== TeX engine is 'pdfTeX'
Latexmk: All targets (minimal.pdf) are up-to-date
------------
Running 'echo vimtex_compiler_callback_success'
------------
vimtex_compiler_callback_success

@lervag
Copy link
Owner

lervag commented Jan 4, 2022

And it still does not work?

@RnYi
Copy link
Author

RnYi commented Jan 4, 2022

And it still does not work?

Eh, not work

@lervag
Copy link
Owner

lervag commented Jan 4, 2022

Do you get confirmation in Vim/neovim that the compilation was successful?

@lervag
Copy link
Owner

lervag commented Jan 4, 2022

I.e. after \ll you should first get something like "vimtex: compilation started" , then after some time "vimtex: compilation finished successfully".

@RnYi
Copy link
Author

RnYi commented Jan 4, 2022

I.e. after \ll you should first get something like "vimtex: compilation started" , then after some time "vimtex: compilation finished successfully".

Never saw such message in Neovim (I mean the confirmation about successful complilation). But I can see vimtex: compilation finished successfully in vim.

@lervag
Copy link
Owner

lervag commented Jan 4, 2022

I'm really confused here. I don't understand why it does not work.

Let's focus on Vim first, as it seems closer to work than neovim.

Now, with Vim:

  1. Ensure you are on the latest version of vimtex.
  2. Start the minimal example (with gvim or vim -u minimal.vim minimal.tex). Also explain specifically how you do this.
  3. Do \ll and report what happens.
  4. Show output of \li here (the earlier output is for neovim).

@clason
Copy link
Contributor

clason commented Jan 4, 2022

This sounds to me like the texlive binary path is not set in the environment of the started job. (The jobstart implementation is different between Vim and Neovim, so that is hardly surprising.)

I don't know anything about Windows so I unfortunately can't help troubleshoot this if :h vimtex-faq-windows isn't of help.

@RnYi
Copy link
Author

RnYi commented Jan 4, 2022

I'm really confused here. I don't understand why it does not work.

Let's focus on Vim first, as it seems closer to work than neovim.

Now, with Vim:

  1. Ensure you are on the latest version of vimtex.
  2. Start the minimal example (with gvim or vim -u minimal.vim minimal.tex). Also explain specifically how you do this.
  3. Do \ll and report what happens.
  4. Show output of \li here (the earlier output is for neovim).

Sorry for some Chinese characters in output, but may not affect you reading it
When I first run :VimtexInfo (after running :VimtexCompile and get info about successful complilation), have some errors,:
image

but they go away if rerun :VImtexInfo:

System info:
  OS:  ()
  Vim version: VIM 8.2 (1-3394)
  Has clientserver: true
  Servername: VIM

VimTeX project: minimal
  base: minimal.tex
  root: C:\Users\Richard\.vim
  tex: C:\Users\Richard\.vim\minimal.tex
  main parser: current file verified
  document class: minimal
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
    job: 
      jobid: process 15280 run
      output: C:\Users\Richard\AppData\Local\Temp\VDHA4DC.tmp
      cmd: set max_print_line=2000 & latexmk -verbose -file-line-error -synctex=1 -interaction=nonstopmode -pdf -pvc -view=none -e "$compiling_cmd = ($compiling_cmd ? $compiling_cmd . ' & ' : '') . 'echo vimtex_compiler_callback_compiling'" -e "$success_cmd = ($success_cmd ? $success_cmd . ' & ' : '') . 'echo vimtex_compiler_callback_success'" -e "$failure_cmd = ($failure_cmd ? $failure_cmd . ' & ' : '') . 'echo vimtex_compiler_callback_failure'" "minimal.tex"
      pid: 15280
  viewer: General
    job: 
      pid: 15212
      cmd: SumatraPDF -reuse-instance -forward-search "C:\Users\Richard\.vim\minimal.tex" 1 "C:\Users\Richard\.vim/minimal.pdf"
  qf method: LaTeX logfile

output of :VimtexCompileOutput :

Rc files read:
  NONE
Latexmk: This is Latexmk, John Collins, 29 September 2020, version: 4.70b.
======= Need to update make_preview_continuous for target files
Not using a previewer
------------
Running 'echo vimtex_compiler_callback_compiling'
------------
vimtex_compiler_callback_compiling
Latexmk: applying rule 'pdflatex'...
Rule 'pdflatex': The following rules & subrules became out-of-date:
      'pdflatex'
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'pdflatex  -file-line-error -synctex=1 -interaction=nonstopmode -recorder  "minimal.tex"'
------------
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/W32TeX) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./minimal.tex
LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-02-18> (d:/texlive/2021/texmf-dist/tex/latex/base/minimal.cls
Document Class: minimal 2001/05/25 Standard LaTeX minimal class
) (d:/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def) (./minimal.aux) [1{d:/texlive/2021/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./minimal.aux) )<d:/texlive/2021/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on minimal.pdf (1 page, 11767 bytes).
SyncTeX written on minimal.synctex.gz.

Transcript written on minimal.log.
Latexmk: Log file says output to 'minimal.pdf'
Latexmk: Examining 'minimal.log'
=== TeX engine is 'pdfTeX'
Latexmk: applying rule 'pdflatex'...
Rule 'pdflatex': File changes, etc:
   Changed files, or newly in use since previous run(s):
      'minimal.aux'
------------
Run number 2 of rule 'pdflatex'
------------
------------
Running 'pdflatex  -file-line-error -synctex=1 -interaction=nonstopmode -recorder  "minimal.tex"'
------------
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/W32TeX) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./minimal.tex
LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-02-18> (d:/texlive/2021/texmf-dist/tex/latex/base/minimal.cls
Document Class: minimal 2001/05/25 Standard LaTeX minimal class
) (d:/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def) (./minimal.aux) [1{d:/texlive/2021/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./minimal.aux) )<d:/texlive/2021/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on minimal.pdf (1 page, 11767 bytes).
SyncTeX written on minimal.synctex.gz.

Transcript written on minimal.log.
Latexmk: Log file says output to 'minimal.pdf'
Latexmk: Examining 'minimal.log'
=== TeX engine is 'pdfTeX'
Latexmk: All targets (minimal.pdf) are up-to-date
------------
Running 'echo vimtex_compiler_callback_success'
------------
vimtex_compiler_callback_success

@lervag
Copy link
Owner

lervag commented Jan 4, 2022

This sounds to me like the texlive binary path is not set in the environment of the started job.

Hmm.. how so?

@RnYi And the output of :VimtexInfo was?

@lervag
Copy link
Owner

lervag commented Jan 4, 2022

@RnYi: Can you do :VimtexClearCache all then try to reproduce the error above?

@lervag
Copy link
Owner

lervag commented Jan 4, 2022

Also, can you try to translate the chinese stuff in the error messages on the line with E712?

lervag added a commit that referenced this issue Jan 4, 2022
@RnYi
Copy link
Author

RnYi commented Jan 4, 2022

@RnYi: Can you do :VimtexClearCache all then try to reproduce the error above?

:VimtexCompile -> :VimtexInfo(ERROR) -> :VimtexInfo(SUCCESS) -> ':VimtexClearCache all -> :VimtexInfo(SUCCESS)

restart vim, then:
:VimtexCompile -> :VimtexInfo(ERROR)

Also, can you try to translate the chinese stuff in the error messages on the line with E712?

E712: Argument of extend() must be List or Dictionary
Error detected while processing function vimtex#info#open[2]..vimtex#scratch#new[2]...187[31]..189[4]..175

@lervag
Copy link
Owner

lervag commented Jan 4, 2022

I've pushed a minor update that should give a more useful error message here. Can you show me the output of the new error message?

@lervag
Copy link
Owner

lervag commented Jan 4, 2022

Sorry for some Chinese characters in output, but may not affect you reading it When I first run :VimtexInfo ... but they go away if rerun :VImtexInfo:

The error we're discussing above is not relevant to the issue, but it would still be nice to fix it.

Regarding the issue: the :VimtexInfo output indicates that things actually work with Vim.

VimTeX project: minimal
  viewer: General
    job: 
      cmd: SumatraPDF -reuse-instance -forward-search "C:\Users\Richard\.vim\minimal.tex" 1 "C:\Users\Richard\.vim/minimal.pdf"

The problem is that SumatraPDF as executed by VimTeX appears to not be executable. You can test that with :!SumatraPDF from within Vim. I believe this should be easily fixed with

let g:vimtex_view_general_viewer = 'SumatraPDF.exe'

Can you verify?

@RnYi
Copy link
Author

RnYi commented Jan 4, 2022

I've pushed a minor update that should give a more useful error message here. Can you show me the output of the new error message?

image

@lervag
Copy link
Owner

lervag commented Jan 4, 2022

Very strange. Are you capable of helping with the debugging by making some modifications to the code? The location that is relevant is here:

if getftime(self.path) > self.ftime
let self.ftime = getftime(self.path)
let l:data = json_decode(join(readfile(self.path)))
if type(l:data) == v:t_dict
call extend(self.data, l:data, 'keep')
else
call vimtex#log#warning(
\ 'Inconsistent cache data while reading: ' . self.name,
\ 'Decoded data type: ' . type(l:data)
\)
endif
endif

Could you do this code on your end:

  if getftime(self.path) > self.ftime
    echom self.path
    for line in readfile(self.path)
      echom line
    endfor
    "...

Then again do :VimtexInfo and show the output of the echom commands here?

@RnYi
Copy link
Author

RnYi commented Jan 4, 2022

Sorry for some Chinese characters in output, but may not affect you reading it When I first run :VimtexInfo ... but they go away if rerun :VImtexInfo:

The error we're discussing above is not relevant to the issue, but it would still be nice to fix it.

Regarding the issue: the :VimtexInfo output indicates that things actually work with Vim.

VimTeX project: minimal
  viewer: General
    job: 
      cmd: SumatraPDF -reuse-instance -forward-search "C:\Users\Richard\.vim\minimal.tex" 1 "C:\Users\Richard\.vim/minimal.pdf"

The problem is that SumatraPDF as executed by VimTeX appears to not be executable. You can test that with :!SumatraPDF from within Vim.

:!SumatraPDF succeed in both vim and neovim.

let g:vimtex_view_general_viewer = 'SumatraPDF.exe'

Yes, bug fixed

@lervag
Copy link
Owner

lervag commented Jan 4, 2022

Is it fixed for both Vim and neovim?

@lervag lervag closed this as completed Jan 4, 2022
@RnYi
Copy link
Author

RnYi commented Jan 4, 2022

Is it fixed for both Vim and neovim?

Yes. So is it time to fix the bug for neovim?😂
I mean that bug vimtex can not open sumatraPDF automaticliy

@lervag
Copy link
Owner

lervag commented Jan 4, 2022

Ok, so, if I undestand correctly you say:

  1. Things now work as expected on Vim.
  2. There are still problems on neovim.

If that's right: Then I would ask that we repeat the steps from above:

  1. Ensure you are on the latest version of vimtex.

  2. Start the minimal example (with nvim -u minimal.vim minimal.tex) - use the same setting that work on Vim. Also explain specifically how you do this.

  3. Do \ll and report what happens - e.g. output of \lo.

  4. Show output of \li here.

@RnYi
Copy link
Author

RnYi commented Jan 4, 2022

  1. Do \ll and report what happens - e.g. output of \lo.
VimTex: Compiler started in continuous mode

cmdline only shows this info, and latexmk indeed compiles the tex file. Not opening SumatraPDF automaticly.
output of :VimtexCompileOutput:

Rc files read:
  NONE
Latexmk: This is Latexmk, John Collins, 20 November 2021, version: 4.76.
Not using a previewer
======= Need to update make_preview_continuous for target files
------------
Running 'echo vimtex_compiler_callback_compiling'
------------
vimtex_compiler_callback_compiling
Rule 'pdflatex': File changes, etc:
   Changed files, or newly in use since previous run(s):
      'mininal.tex'
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'pdflatex  -file-line-error -synctex=1 -interaction=nonstopmode -recorder  "mininal.tex"'
------------
Latexmk: applying rule 'pdflatex'...
This is pdfTeX, Version 3.141592653-2.6-1.40.23 (TeX Live 2021/W32TeX) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./mininal.tex

LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2021-11-22>
 (c:/texlive/2021/texmf-dist/tex/latex/base/minimal.cls

Document Class: minimal 2001/05/25 Standard LaTeX minimal class
)
 (c:/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
)
 (./mininal.aux
)
 [1
{c:/texlive/2021/texmf-var/fonts/map/pdftex/updmap/pdftex.map
}
]
 (./mininal.aux
)
 )<c:/texlive/2021/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb
>

Output written on mininal.pdf (1 page, 12600 bytes).
SyncTeX written on mininal.synctex.gz.

Transcript written on mininal.log.
Latexmk: Log file says output to 'mininal.pdf'
Rule 'pdflatex': File changes, etc:
   Changed files, or newly in use since previous run(s):
      'mininal.aux'
------------
Run number 2 of rule 'pdflatex'
------------
------------
Running 'pdflatex  -file-line-error -synctex=1 -interaction=nonstopmode -recorder  "mininal.tex"'
------------
Latexmk: Examining 'mininal.log'
=== TeX engine is 'pdfTeX'
Latexmk: applying rule 'pdflatex'...
This is pdfTeX, Version 3.141592653-2.6-1.40.23 (TeX Live 2021/W32TeX) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./mininal.tex

LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2021-11-22>
 (c:/texlive/2021/texmf-dist/tex/latex/base/minimal.cls

Document Class: minimal 2001/05/25 Standard LaTeX minimal class
)
 (c:/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
)
 (./mininal.aux
)
 [1
{c:/texlive/2021/texmf-var/fonts/map/pdftex/updmap/pdftex.map
}
]
 (./mininal.aux)
 )<c:/texlive/2021/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb
>

Output written on mininal.pdf (1 page, 12600 bytes).
SyncTeX written on mininal.synctex.gz.

Transcript written on mininal.log.
Latexmk: Log file says output to 'mininal.pdf'
------------
Running 'echo vimtex_compiler_callback_success'
------------
Latexmk: Examining 'mininal.log'
=== TeX engine is 'pdfTeX'
Latexmk: All targets (mininal.pdf) are up-to-date
vimtex_compiler_callback_success
  1. Show output of \li here.
System info:
  OS: RANY-PC (Microsoft Windows 10 רҵ°æ)
  Vim version: NVIM v0.7.0-dev+761-g0d7a97224
  Has clientserver: true
  Servername: \\.\pipe\nvim-15520-0

VimTeX project: mininal
  base: mininal.tex
  root: C:\Users\RanY\.vim
  tex: C:\Users\RanY\.vim\mininal.tex
  main parser: current file verified
  document class: minimal
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
    job: 
      jobid: 5
      output: C:\Users\RanY\AppData\Local\Temp\nvim2hhBvm\0
      cmd: set max_print_line=2000 & latexmk -verbose -file-line-error -synctex=1 -interaction=nonstopmode -pdf -pvc -view=none -e "$compiling_cmd = ($compiling_cmd ? $compiling_cmd . ' ^& ' : '') . 'echo vimtex_compiler_callback_compiling'" -e "$success_cmd = ($success_cmd ? $success_cmd . ' ^& ' : '') . 'echo vimtex_compiler_callback_success'" -e "$failure_cmd = ($failure_cmd ? $failure_cmd . ' ^& ' : '') . 'echo vimtex_compiler_callback_failure'" "mininal.tex"
      pid: 6464
  viewer: General
  qf method: LaTeX logfile

@lervag
Copy link
Owner

lervag commented Jan 4, 2022

Well, for some reason that I currently don't understand, your neovim does not handle the callbacks. Or - it seems the latexmk process does not echo the output. Perhaps, for some reason, latexmk does not pass the command to a shell that understands "echo"? I don't know what happens here, to be honest.

@lervag
Copy link
Owner

lervag commented Jan 4, 2022

Can you explain how you've installed neovim and how you run the minimal example with neovim in more details?

@RnYi
Copy link
Author

RnYi commented Jan 5, 2022

Can you explain how you've installed neovim and how you run the minimal example with neovim in more details?

Just download neovim nightly from github, and extract it (now neovim's version is 0.7.0). I use windows terminal to powershell, enter .vim and run command nvim -u .\minimal.vim .\minimal.tex, content of minimal.vim has nothing special. After that, run :VimtexCompile. That's all. I wonder what version of neovim do you use, maybe some bugs have been introduced in neovim recently?

@RnYi
Copy link
Author

RnYi commented Jan 5, 2022

I tried neovim 0.6.1, problem still exists.

@lervag
Copy link
Owner

lervag commented Jan 5, 2022

windows terminal to powershell, ...

When you start neovim, can you report the output of these:

  • :echo &shell
  • :scriptnames

I sort of expect neovim to use powershell as the shell, which might explain the issue. Could you try with regular cmd.exe instead of windows terminal?

@RnYi
Copy link
Author

RnYi commented Jan 5, 2022

  • :echo &shell

It's cmd.exe

  • :scriptnames
1: ~\.vim\minimal.vim
  2: ~\AppData\Local\nvim-data\site\pack\packer\start\filetype.nvim\filetype.vim
  3: C:\ProgramFiles\Neovim\share\nvim\runtime\filetype.lua
  4: C:\ProgramFiles\Neovim\share\nvim\runtime\filetype.vim
  5: C:\ProgramFiles\Neovim\share\nvim\runtime\ftplugin.vim
  6: C:\ProgramFiles\Neovim\share\nvim\runtime\indent.vim
  7: C:\ProgramFiles\Neovim\share\nvim\runtime\syntax\syntax.vim
  8: C:\ProgramFiles\Neovim\share\nvim\runtime\syntax\synload.vim
  9: ~\.vim\bundle\vimtex\plugin\vimtex.vim
 10: C:\ProgramFiles\Neovim\share\nvim\runtime\plugin\gzip.vim
 11: C:\ProgramFiles\Neovim\share\nvim\runtime\plugin\health.vim
 12: C:\ProgramFiles\Neovim\share\nvim\runtime\plugin\man.vim
 13: C:\ProgramFiles\Neovim\share\nvim\runtime\plugin\matchit.vim
 14: C:\ProgramFiles\Neovim\share\nvim\runtime\pack\dist\opt\matchit\plugin\matchit.vim
 15: C:\ProgramFiles\Neovim\share\nvim\runtime\plugin\matchparen.vim
 16: C:\ProgramFiles\Neovim\share\nvim\runtime\plugin\netrwPlugin.vim
 17: C:\ProgramFiles\Neovim\share\nvim\runtime\plugin\rplugin.vim
 18: ~\AppData\Local\nvim-data/rplugin.vim
 19: C:\ProgramFiles\Neovim\share\nvim\runtime\plugin\shada.vim
 20: C:\ProgramFiles\Neovim\share\nvim\runtime\plugin\spellfile.vim
 21: C:\ProgramFiles\Neovim\share\nvim\runtime\plugin\tarPlugin.vim
 22: C:\ProgramFiles\Neovim\share\nvim\runtime\plugin\tohtml.vim
 23: C:\ProgramFiles\Neovim\share\nvim\runtime\plugin\tutor.vim
 24: C:\ProgramFiles\Neovim\share\nvim\runtime\plugin\zipPlugin.vim
 25: ~\AppData\Local\nvim-data\site\pack\packer\start\filetype.nvim\plugin\filetype.vim
 26: ~\AppData\Local\nvim-data\site\pack\packer\start\nvim-web-devicons\plugin\nvim-web-devicons.vim
 27: ~\AppData\Local\nvim-data\site\pack\packer\start\plenary.nvim\plugin\plenary.vim
 28: C:\ProgramFiles\Neovim\share\nvim\runtime\autoload\dist\ft.vim
 29: ~\.vim\bundle\vimtex\ftplugin\tex.vim
 30: ~\.vim\bundle\vimtex\autoload\vimtex.vim
 31: ~\.vim\bundle\vimtex\autoload\vimtex\options.vim
 32: ~\.vim\bundle\vimtex\autoload\vimtex\util.vim
 33: ~\.vim\bundle\vimtex\autoload\vimtex\state.vim
 34: ~\.vim\bundle\vimtex\autoload\vimtex\re.vim
 35: ~\.vim\bundle\vimtex\autoload\vimtex\parser.vim
 36: ~\.vim\bundle\vimtex\autoload\vimtex\parser\tex.vim
 37: ~\.vim\bundle\vimtex\autoload\vimtex\state\class.vim
 38: ~\.vim\bundle\vimtex\autoload\vimtex\cache.vim
 39: ~\.vim\bundle\vimtex\autoload\vimtex\paths.vim
 40: ~\.vim\bundle\vimtex\autoload\vimtex\parser\fls.vim
 41: ~\.vim\bundle\vimtex\autoload\vimtex\view.vim
 42: ~\.vim\bundle\vimtex\autoload\vimtex\view\general.vim
 43: ~\.vim\bundle\vimtex\autoload\vimtex\view\_template.vim
 44: ~\.vim\bundle\vimtex\autoload\vimtex\compiler.vim
 45: ~\.vim\bundle\vimtex\autoload\vimtex\compiler\latexmk.vim
 46: ~\.vim\bundle\vimtex\autoload\vimtex\compiler\_template.vim
 47: ~\.vim\bundle\vimtex\autoload\vimtex\qf.vim
 48: ~\.vim\bundle\vimtex\autoload\vimtex\qf\latexlog.vim
 49: ~\.vim\bundle\vimtex\autoload\vimtex\toc.vim
 50: ~\.vim\bundle\vimtex\autoload\vimtex\fold.vim
 51: ~\.vim\bundle\vimtex\autoload\vimtex\fold\envs.vim
 52: ~\.vim\bundle\vimtex\autoload\vimtex\fold\cmd_single_opt.vim
 53: ~\.vim\bundle\vimtex\autoload\vimtex\fold\markers.vim
 54: ~\.vim\bundle\vimtex\autoload\vimtex\fold\preamble.vim
 55: ~\.vim\bundle\vimtex\autoload\vimtex\fold\sections.vim
 56: ~\.vim\bundle\vimtex\autoload\vimtex\fold\cmd_addplot.vim
 57: ~\.vim\bundle\vimtex\autoload\vimtex\fold\env_options.vim
 58: ~\.vim\bundle\vimtex\autoload\vimtex\fold\cmd_multi.vim
 59: ~\.vim\bundle\vimtex\autoload\vimtex\fold\items.vim
 60: ~\.vim\bundle\vimtex\autoload\vimtex\fold\cmd_single.vim
 61: ~\.vim\bundle\vimtex\autoload\vimtex\context.vim
 62: ~\.vim\bundle\vimtex\autoload\vimtex\context\cite.vim
 63: ~\.vim\bundle\vimtex\autoload\vimtex\bib.vim
 64: ~\.vim\bundle\vimtex\autoload\vimtex\cmd.vim
 65: ~\.vim\bundle\vimtex\autoload\vimtex\complete.vim
 66: ~\.vim\bundle\vimtex\autoload\vimtex\debug.vim
 67: ~\.vim\bundle\vimtex\autoload\vimtex\delim.vim
 68: ~\.vim\bundle\vimtex\autoload\vimtex\doc.vim
 69: ~\.vim\bundle\vimtex\autoload\vimtex\echo.vim
 70: ~\.vim\bundle\vimtex\autoload\vimtex\env.vim
 71: ~\.vim\bundle\vimtex\autoload\vimtex\format.vim
 72: ~\.vim\bundle\vimtex\autoload\vimtex\fzf.vim
 73: ~\.vim\bundle\vimtex\autoload\vimtex\imaps.vim
 74: ~\.vim\bundle\vimtex\autoload\vimtex\include.vim
 75: ~\.vim\bundle\vimtex\autoload\vimtex\info.vim
 76: ~\.vim\bundle\vimtex\autoload\vimtex\jobs.vim
 77: ~\.vim\bundle\vimtex\autoload\vimtex\kpsewhich.vim
 78: ~\.vim\bundle\vimtex\autoload\vimtex\log.vim
 79: ~\.vim\bundle\vimtex\autoload\vimtex\matchparen.vim
 80: ~\.vim\bundle\vimtex\autoload\vimtex\syntax.vim
 81: ~\.vim\bundle\vimtex\autoload\vimtex\pos.vim
 82: ~\.vim\bundle\vimtex\autoload\vimtex\misc.vim
 83: ~\.vim\bundle\vimtex\autoload\vimtex\motion.vim
 84: ~\.vim\bundle\vimtex\autoload\vimtex\profile.vim
 85: ~\.vim\bundle\vimtex\autoload\vimtex\scratch.vim
 86: ~\.vim\bundle\vimtex\autoload\vimtex\text_obj.vim
 87: ~\.vim\bundle\vimtex\autoload\vimtex\ui.vim
 88: ~\.vim\bundle\vimtex\autoload\vimtex\text_obj\targets.vim
 89: C:\ProgramFiles\Neovim\share\nvim\runtime\ftplugin\tex.vim
 90: ~\.vim\bundle\vimtex\after\ftplugin\tex.vim
 91: ~\.vim\bundle\vimtex\indent\tex.vim
 92: C:\ProgramFiles\Neovim\share\nvim\runtime\indent\tex.vim
 93: ~\.vim\bundle\vimtex\syntax\tex.vim
 94: ~\.vim\bundle\vimtex\autoload\vimtex\syntax\core.vim
 95: ~\.vim\bundle\vimtex\autoload\vimtex\syntax\nested.vim
 96: ~\.vim\bundle\vimtex\autoload\vimtex\syntax\packages.vim
 97: ~\.vim\bundle\vimtex\autoload\vimtex\syntax\p\amsmath.vim
 98: C:\ProgramFiles\Neovim\share\nvim\runtime\syntax\tex.vim

I sort of expect neovim to use powershell as the shell, which might explain the issue. Could you try with regular cmd.exe instead of windows terminal?

Still Not Works in cmd.exe

@lervag
Copy link
Owner

lervag commented Jan 5, 2022

Well, isn't that weird... Can you try nvim --clean -u minimal.vim minimal.tex to avoid the packer packages? I don't think it matters, but just to be sure.

Next, I'll try to reproduce the problem in my VM: if I understand correctly, this should reproduce:

  • Download neovim and extract/install
  • Create minimal example
  • Start neovim from windows terminal with powershell or from cmd.exe

I'll test with my current latex setup - I've used MikTeX with Strawberry perl. But I'll wait until you've checked what I asked and until you confirm that my steps seem correct for reproducing.

@RnYi
Copy link
Author

RnYi commented Jan 5, 2022

Well, isn't that weird... Can you try nvim --clean -u minimal.vim minimal.tex to avoid the packer packages? I don't think it matters, but just to be sure.

doesn't work.

Next, I'll try to reproduce the problem in my VM: if I understand correctly, this should reproduce:

  • Download neovim and extract/install
  • Create minimal example
  • Start neovim from windows terminal with powershell or from cmd.exe

yes, you can go on :)

lervag added a commit that referenced this issue Jan 8, 2022
I don't see any particular problem with this change, and it fixes an
issue with neovim on Windows.

refer: #2291
@lervag
Copy link
Owner

lervag commented Jan 8, 2022

I believe the problem with neovim is now fixed. Can you update and test?

@RnYi
Copy link
Author

RnYi commented Jan 8, 2022

I believe the problem with neovim is now fixed. Can you update and test?

Yes, works well now, Thanks!

@lervag
Copy link
Owner

lervag commented Jan 8, 2022

Great, happy to hear it. I'll try to fix the next issue as well now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants