Closed dpo closed 5 years ago
Bump. Can anyone reproduce this? I opened a Discourse discussion here, which may contain leads to resolve the problem: https://discuss.atom.io/t/autocomplete-reference-duplicates-label-in-latex-documents/62015
Thanks!
@dpo I typed out a response back then but apparently dind't hit comment!
I too have the same issue, but after a (not through) investigation pinned the blame on the upstream Atom's own autocomplete-plus
package that we use via the provider API.
At the time, I skimmed through the autocomplete-plus
issues but didn't find anything striking. I will investigate more, and maybe open up an issue in their repo for guidance.
EDIT: I might have found the issue, give me a few hours to get home and fix it :-)
Great news! Thanks!
@dpo It does look like an issue with the nonWordCharacters
- but will take some more investigation. Will keep you posted.
@dpo Try adding :
to the Extra Word Characters
setting found under autocomplte-plus
package settings. That should fix the issue. I wonder if there a more specific way to solve this.
I have tried that already. It doesn't fix the problem for me. Does it fix it for you?
Yep - just to confirm - this is not the editor Non Word Characters
.
Before:
After:
EDIT: looking at the gif, looks like this might break the suggestions - I see a few repeats. I will look into in in more detail soon!
Well, unfortunately, that doesn't work for me. I'm not sure what's happening.
I tried your suggestion on two computers (both macOS), and it didn't fix the issue on either. Perhaps things are different on other platforms?!
The issue is being tracked in upstream in autocomplete-plus
as the from our side we are(99.99%) setting the right parameters for replacement.
I tried your suggestion on two computers (both macOS), and it didn't fix the issue on either. Perhaps things are different on other platforms?!
The workaround I mentioned also requires bumping up the provider version to 4.0.0
in package.json
- but I would rather wait for something from the autocomplete-plus
guys before pushing the workaround as a fix.
Great, thank you!
Just wondering if there are any news here.
Not sure if this is the same issue, but when typing \includegraphics{some/path}
I get the same (wrong) behavior. This is quite annoying...
It's quite irritating I agree, but don't have the time to debug upstream issues at the moment. So unless there is some action over at atom/autocomplete-plus#1020 not much I can do for now.
@dpo @BambOoxX Managed to fix this with the following patch
diff --git a/package.json b/package.json
index 7f0fbec..fe7b306 100644
--- a/package.json
+++ b/package.json
@@ -18,7 +18,7 @@
"providedServices": {
"autocomplete.provider": {
"versions": {
- "2.0.0": "provide"
+ "4.0.0": "provide"
}
}
},
diff --git a/settings/language-latex.cson b/settings/language-latex.cson
index 9645e98..3c4ebf2 100644
--- a/settings/language-latex.cson
+++ b/settings/language-latex.cson
@@ -4,6 +4,8 @@
'tabLength': 2
'softWrap': true
'commentStart': '% '
+ 'autocomplete-plus':
+ 'extraWordCharacters': ':_/'
'bracket-matcher':
'autocompleteCharacters': [
'$$',
Should find its way into the next release - don't want to push two on the same day ;-)
Oh please, please please ;-). That bug bothers me every single day.
I have labels with multiple :
and -
characters, e.g., alg:my-algorithm
. If I type alg:my
and hit TAB
, the name is now completed correctly. Thank you!
However, if I type alg:my-
and hit TAB
, the same problem as before occurs; the entire label is pasted after what I typed. I tried adding -
to the list of extra non-word characters in settings/language-latex.cson
but no success... Any ideas?
@dpo Sorry my notifications are whack these days, but for your case try:
# This works
'extraWordCharacters': '-:_/'
# This doesn't ¯\_(ツ)_/¯
'extraWordCharacters': ':_/-'
Finally!!! Thank you!!!
Ps: perhaps there should be a setting for extraWordCharacters
?!
For a little while now I've been observing the following autocomplete behavior. I set my labels in the form
eq:my-equation
for equations,fig:my-figure
for figures, etc.If I type
\eqref{
, the autocomplete dropdown shows up, I then typeeq
(without typing a colon), select a label, hit tab, and I get the correct completion.However, if I type
eq:
with a colon and select the label I'm interested in (sayeq:my-equation
), the completion ends up being\eqref{eq:eq:my-equation}
instead of just\eqref{eq:my-equation}
.The moment I type
:
, the autocomplete pulldown visibly shifts to the right, so it seems like something is happening.Has anyone else observed this? I only have official autocomplete packages installed and no other autocomplete package related to LaTeX.
Thanks!