Aerijo / autocomplete-latex

A LaTeX autocomplete provider for Atom
MIT License
10 stars 2 forks source link

Nested snippet expansion not working #10

Closed Aerijo closed 4 years ago

Aerijo commented 6 years ago

Expanding the $ completion and then trying to use the \frac completions results in the cursor losing any placement rules after tabbing into the second brace pair. Pressing tab again will not bring you to outside the frac braces, rather just insert a tab inside the second pair.

werunom commented 6 years ago

I am observing this with $ itself. That is, after the autocompletion of $ to \(<cursor-here>\), the tab press does not take the cursor to outside the braces; instead I get \( <cursor>\).

Same with $$ autocompletions.

Aerijo commented 6 years ago

@werunom That was part of an attempt to fix it. It didn't work. I get some strange behaviour sometimes with the end placement, so I'll leave it until I understand it better.

In the mean time, you should be able to define a custom one as normal. The only acceptable prefixes are $ or $$, but I might make this configurable if it seems useful to have arbitrary letters following it (similar to how !... is used for magic comments and @... for citations).

On an entirely different note, have you got the file path completions working? I just want to make sure the instructions were clear enough.

werunom commented 6 years ago

Went through the instructions after reading the Readme update. Havent tried it though; I dont have autocomplete-paths installed yet. Can you give me sometime? Can try that and get back to you...

werunom commented 6 years ago

@Aerijo - tested couple of the features. Below are the findings...

  1. file path autocompletions work fine. I followed the instructions given. Not much of confusion there.
  2. Couldnt check the package name completion since tlmgr is not working in my laptop. Will debug that and will update you on that.
  3. but, magic comments are not being completed. For instance, I typed at the beginning of the file % !T and nothing happens. I tried % !TEX TS-...but again nothing. However, when I tried % !TEX root=, I got the file name autocompletion suggestions.

Hope it helps :) Let me know if you need me to look into something else...

Aerijo commented 6 years ago

@werunom

  1. Good.
  2. Good luck.
  3. The syntax I've set up for magic comments is !.... So !ro will suggest the !root prefix, which expands to % !TEX root =.
Aerijo commented 4 years ago

Nested snippets would be up to the snippets provider