ashthespy / Atom-LaTeX

The only LaTeX package you need for typesetting with Atom.
https://atom.io/packages/atom-latex
MIT License
22 stars 9 forks source link

Feature request: option to disable auto-completition #189

Open gilbertohasnofb opened 5 years ago

gilbertohasnofb commented 5 years ago

Feature request: when this package is enabled, it seems to override the characters set for auto-completition in the package bracket-matcher. For instance, I do not want automatically close any ' nor ` since I use those for quotation marks in Latex. The package bracket-matcher allows scoped settings for specific types of extension, but because this package seems to be overriding it that is not working for me either.

StructByLightning commented 5 years ago

Yeah, this is a pretty obnoxious bug. I almost posted an issue on the bracket-matcher page before realizing the problem was with atom-latex instead. I'm not sure why atom-latex is enforcing its own matching, but it should at least have a way to define which characters to match, especially since latex lets you define new characters. For example, I'm using two vertical bars || to denote code and that's not a default pair.

gilbertohasnofb commented 5 years ago

@James-Yu Would it be possible to let these options be enabled/disabled/customized by the users instead of being on by default? Another auto-completition option that is imposed by default with no option to toggle it off is to autoclose any \begin{environment} with an \end{environment}. I personally find that more often than not it is adding closures where I don't need them and it's a hassle to fight with the autocompletition.

axkibe commented 5 years ago

Yeah, I just tried to get atom here als alternativ LaTeX environment, this was a killer issue of that endeavor.

You can remove the annoying (non)brackets in the file ".atom/packages/atom-latex/settings/language-latex.cson"...

However, for this I guess it's too late, once a negative opinion is set, it's done.

gilbertohasnofb commented 5 years ago

@axkibe Thanks for the info, I see that that file overwrites my preferences for the bracket-matcher. Editing it did solve the annoying behaviour with the brackets. Now I just need some time to go through the rest of the code to spot where the annoying \begin{environment} and \end{environment} autocompletition code is defined.

ashthespy commented 5 years ago

The package bracket-matcher allows scoped settings for specific types of extension, but because this package seems to be overriding it that is not working for me either.

Yeah, this is a pretty obnoxious bug. I almost posted an issue on the bracket-matcher page before realizing the problem was with atom-latex instead.

Hmm, I didn't realise scoped settings for bracket-matcher doesn't really mean scoped settings, and just overrides the global settings. Any suggested workarounds? I don't have much time these days - so PR's are welcome! :-)

gilbertohasnofb commented 5 years ago

@ashthespy Possibly a simple, quick, and dirty way of fixing this would be to simply add a toggle in the configuration options of your package for enabling/disabling all autocompletitions for your package. This way, people who wants to use their own custom bracket-matcher settings can simply disable that toggle, otherwise everyone who is happy with your package remain happy. I would also suggest that this toggle would disable not only the bracket matching but also other things like the autocompletition of \end{environment} when typing \begin{environment} and hitting enter.

StructByLightning commented 5 years ago

End/begin autocompletion should be a separate toggle.

gilbertohasnofb commented 4 years ago

@ashthespy Apologies for bumping this, but is there any chance you would consider implementing this feature?

ashthespy commented 4 years ago

@gilbertohasnofb PR's are welcome - don't have the time right now to jump into this. In the ideal world, this should be an issue/handled over at bracket-matcher, so that these settings don't override your defaults..