Skip to content

Autocompletion using '\' instead of '/' in paths (Windows 10) #2954

Closed
@Lucho32-byte

Description

@Lucho32-byte

Description

I'm currently using a Windows 10 Laptop (No WSL) but the autocompletion for the following path sources appears to be using backslash "\" instead of "/":

  • [include]
  • [input]
  • [includepdf]
  • [includestandalone]

imagen
imagen
imagen
imagen

However, [graphics] source seems to be working fine
imagen

Currently as a workaround I've just modified the lines 478, 483, 504 and 525 from the file vimtex/autoload/vimtex/complete.vim with the function substitute to patch this behaviour:

          \ 'word': substitute(fnamemodify(x, ':r'), '\\', '/', 'g'),
          " or
          \ 'word': substitute(x, '\\', '/', 'g'),

Steps to reproduce

  1. Minimal folder structure
~\test/..
images
  └ stuff.pdf
 src
  │ firstsection.tex
  └ secondsection.tex
  main.tex
  1. Minimal latex file
\documentclass[a4paper, 10pt]{article}
\begin{document}

% The problem's with the following commands
\input{}
\include{}
\includepdf{}
\includestandalone{}

% This works fine
\includegraphics{}

\end{document}

Expected behavior

Autocompletion should use the '/' syntax for paths.

Actual behavior

Instead, autocompletion is using the traditional Windows '\' syntax.

Do you use a latexmkrc file?

No

VimtexInfo

System info:
  OS: LAPTOP-H90H219I (Microsoft Windows 10 Home Single Language)
  Vim version: NVIM v0.9.5
  Has clientserver: true
  Servername: \\.\pipe\nvim.32700.0

VimTeX project: main
  base: main.tex
  root: C:\Users\LUIS\test
  tex: C:\Users\LUIS\test/main.tex
  main parser: fallback current file
  document class: 
  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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions