randy3k / LaTeXBox

A lightweight but deprecated LaTeX Plugin for Sublime Text 3
44 stars 8 forks source link

completion auto-suggestion seems not working #23

Closed yesvno closed 9 years ago

yesvno commented 9 years ago

As in the title, if I use the tex code in the screen shots, once I type in sec, no completion suggestions menu shows up unless I uncomment the second line.

I am using default latex syntax package at the same time. It seems that there is a conflict between the auto-complete function of latex-plus and that of latex. If I type "\sec", a latex-plus completion popup will appear. If I select the snippet provide by latex syntax package, it results in double slash as below:

\section{section name} % (fold) \label{sec:section_name}

% section section_name (end)

Could you find a way to resolve this conflict? BTW, it's an awesome plugin. Very light, but works for me in most of the times.

%%%%%

Below are the screen shots: 2014-11-04 8 05 43 2014-11-04 8 06 49

randy3k commented 9 years ago

Thanks for the report.

Firstly, to trigger LaTeX-Plus auto-completion, instead of sec, you should type \sec.

Secondly, to use the default LaTeX completion, you should do sec<tab>. I know, It may sounds confusing.

Lastly, you are getting auto-completion in the first picture because of a bug. In LaTeX-Plus, auto-completion window is triggered in the math mode, or after \. It seems that LaTeX-Plus doesn't correctly handle

\def\s{\[}

and the rest of the document becomes in math mode. A general remark is not to use \def but \new command, e.g.

\newcommand{\s}{\[}
yesvno commented 9 years ago

Thank you for the quick reply. I know the right ways to trigger the corresponding completion mechanisms. But it would be nice that latex-plus can implement the default latex completion snippets -- making \label{} automatically after \section etc, coz that's the only reason I am keep it enabled. I like the trigger philosophy that latex-plus uses for completion. Just a suggestion. :)

randy3k commented 9 years ago

Perhaps, one can port all the default snippets to latex-plus.

randy3k commented 9 years ago

I believe the new way of triggering auto completion has solved this issue.