LaTeXTools icon indicating copy to clipboard operation
LaTeXTools copied to clipboard

Leading `\` disappear while triggering snippets using Tab

Open flcong opened this issue 4 years ago • 12 comments

I'm using Sublime Text 4107. When I trigger a snippet using Tab, the leading \ disappears, as shown below: 2021-06-16 22-43-23

flcong avatar Jun 17 '21 02:06 flcong

It looks to be this issue here: https://github.com/sublimehq/sublime_text/issues/4275

It describes a fix:

  • Go to Browse Packages Screen Shot 2021-06-17 at 12 56 40
  • Open LaTeXTools/latex_cwl_completion.py
  • Delete or comment out lines 308–312 https://github.com/SublimeText/LaTeXTools/blob/45376f12449e32c4ad769f5baa0a75c1fa72194d/latex_cwl_completions.py#L301-L312

That fixes it. I hope this packages gets this as an update soon.

Kamik423 avatar Jun 17 '21 10:06 Kamik423

Thank you!

flcong avatar Jun 17 '21 13:06 flcong

Thanks! that resolves the issue. Yes, hope this could be fixed soon.

xiongyu1988 avatar Jun 18 '21 04:06 xiongyu1988

Encountered this. Would love a release.

pdeffebach avatar Jul 07 '21 19:07 pdeffebach

That worked for me. Would love to know if the maintainers would accept a PR for this.

alexpetros avatar Aug 01 '21 21:08 alexpetros

Thank you. The problem solved!

BiaoXJ avatar Nov 22 '21 03:11 BiaoXJ

Is this actually fixed in the release version? I think closing would be preemptive. Other people will still have this issue and the repo should be updated.

Kamik423 avatar Dec 17 '21 13:12 Kamik423

Thanks!!!!

alunpope avatar Apr 23 '22 09:04 alunpope

Thank You very much!

AnMnv avatar Jul 29 '22 09:07 AnMnv

While the solution from @Kamik423 works, it does cause another problem for me...For some reason, the autocomplete feature is downgraded (almost non-existent). What I mean by this is that ST can't even correctly show the packages I have while calling them with \usepackage{}. Initially, I thought I didn't have some of these packages till I realized that commenting out the lines in the latex_cwl_completion.py file would cause this. Screenshots below... BEFORE COMMENTING THE LINES IN THE . PY Screenshot (19)

AFTER COMMENTING THE LINES IN THE .PY Screenshot (20)

On one hand, it's annoying to have the \ disappear after a autocomplete but it's also annoying when I have to write most of the code manually. I have reverted to uncommenting the lines in the .py file so that I can get the autocomplete feature back. If I get a fix that doesn't take away autocomplete, I will comment on this Issue. While I figure it out, I hope the dev team for Latextools can resolve the issue.

Okwizi avatar Oct 23 '22 19:10 Okwizi

While the solution from @Kamik423 works, it does cause another problem for me...For some reason, the autocomplete feature is downgraded (almost non-existent). What I mean by this is that ST can't even correctly show the packages I have while calling them with \usepackage{}. Initially, I thought I didn't have some of these packages till I realized that commenting out the lines in the latex_cwl_completion.py file would cause this. Screenshots below... BEFORE COMMENTING THE LINES IN THE . PY Screenshot (19)

AFTER COMMENTING THE LINES IN THE .PY Screenshot (20)

On one hand, it's annoying to have the \ disappear after a autocomplete but it's also annoying when I have to write most of the code manually. I have reverted to uncommenting the lines in the .py file so that I can get the autocomplete feature back. If I get a fix that doesn't take away autocomplete, I will comment on this Issue. While I figure it out, I hope the dev team for Latextools can resolve the issue.

I have the same question. Autocomplete function is invalid even I reintall cwl

liqizheng0328 avatar Jan 12 '24 07:01 liqizheng0328

Decrementing by 1 seems to do the trick. So replacing the lines in question by the following works for me. if is_prefixed: completions = [ (c[0], c[1][0:]) if c[1].startswith("\\") else c for c in completions ]

guigui245 avatar Jan 23 '24 21:01 guigui245