SublimeText / LaTeXTools

LaTeX plugin for Sublime Text
https://latextools.readthedocs.io/
2k stars 362 forks source link

Leading `\` disappear while triggering snippets using Tab #1527

Open flcong opened 3 years ago

flcong commented 3 years ago

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

Kamik423 commented 3 years ago

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

It describes a fix:

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

flcong commented 3 years ago

Thank you!

xiongyu1988 commented 3 years ago

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

pdeffebach commented 3 years ago

Encountered this. Would love a release.

alexpetros commented 2 years ago

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

BiaoXJ commented 2 years ago

Thank you. The problem solved!

Kamik423 commented 2 years ago

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.

alunpope commented 2 years ago

Thanks!!!!

AnMnv commented 1 year ago

Thank You very much!

Okwizi commented 1 year ago

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_cwlcompletion.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.

liqizheng0328 commented 6 months ago

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_cwlcompletion.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

guigui245 commented 5 months ago

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 ]