Closed OpenWaygate closed 3 years ago
A possible quick and dirty fix is to comment out lines 308 to 312 in Packages/LaTeXTools/latex_cwl_completions.py
:
# autocompleting with slash already on line
# this is necessary to work around a short-coming in ST where having a
# keyed entry appears to interfere with it recognising that there is a
# \ already on the line
#
# NB this may not work if there are other punctuation marks in the
# completion
if is_prefixed:
completions = [
(c[0], c[1][1:]) if c[1].startswith("\\") else c
for c in completions
]
It could be that ST4 has fixed the short-coming mentioned in the comments.
@WeixuanZ Thank you very much, it works!
Thanks, it works well!
Great! It works for me too. Thanks a lot!
Has anyone considered making a pull request out of this "fix" ?
This issue is resolved with the beta release, see the README on how to install it.
EDIT: I had a problem when trying to write e.g. $\dfrac$
. As soon as I typed r
in $\dfr$
, it got replaced with $dfr$
. It happened whenever I was writing between dollar signs and there was no space before the last $
.
Here are the steps I took to solve this: it happened even when disabling LaTeXTools and LaTeXYZ and it happened only on one machine. So the problem came from another package.
I opened the Console (Ctrl+`) and typed
sublime.log_commands(True)`, then triggered the undesired behavior:
command: latexyz_insert_snippet {"contents": "\\$$0\\$", "create_fields": true}
command: insert_snippet {"contents": "\\$$0\\$"}
command: auto_complete {"disable_auto_insert": true, "next_completion_if_showing": false}
command: auto_complete {"disable_auto_insert": true, "next_completion_if_showing": false}
command: afn_delete_prefixed_slash
command: auto_complete {"disable_auto_insert": true, "next_completion_if_showing": false}
command: auto_complete {"disable_auto_insert": true, "next_completion_if_showing": false}
I found that "afn" referred to the package "AutoFileName"! I right clicked on my $\dfrac$
and went to "Tools > Developer > Show Scope Name" to copy paste the scope and added to my User settings:
// AutoFileName
// BlackList specific scopes
"afn_blacklist_scopes":["string.regexp.js",
"meta.environment.math.inline.dollar.latex",
"string.other.math.latex",
"punctuation.definition.string.end.latex"],
Hope this helps someone!
However, after comment out lines 308-312, autocomplete function is invalid. (with sublime text 4, macos 14.0 m2 chips). thanks!
Just want to say thank you, this problem has been bugging me for over a year and today I was determined to figure it out.
Thanks for also showing your steps so I am better at debugging
The prefix
\
disappears whether I commentPreferences
->Settings
or not.Installed package: