Whenever I define a macro with `\newcommand{\macroname}{...}`, the symbol `macroname` is successfully added to the list of know symbols, however it is not autocompleted. That is, writing `\macro` does not show any suggestions. But if I write only `macro` (without the backslash), then`macroname` is suggested.
I managed to fix the problem by adding a backslash to the tag name in the function `createTag` on `tagmanager/ctags/latex.c`. However, I suppose this is not desired since the `` was explicitly removed from the tag on that function. And this fix has the ugly side effect that every macro will be preceded by a `` on the side menu, but I can live with that.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1000
Your problem is [here](https://github.com/geany/geany/blob/master/src/editor.c#L2297).
Adding hardcoded language specific stuff seems bad, and in this case wrong. @frlan any ideas why?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1000#issuecomment-210958870
I disagree. The line you mentioned indeed leads to a problem, namely that `\macroname\macroname` is treated as a single word, but that is a different problem.
In my opinion, the best solution for both problems would be to patch the geanylatex plugin to autocomplete the word `macro` with `macroname` only if it is preceded by a ``. Then removing the `` from `wordchars` where you mentioned would make geany correctly recognize `\macroname\macro` as `macro`, and the latex plugin would be able to autocomplete it.
If this solution is acceptable, I could implement it.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1000#issuecomment-211054166
On 18 April 2016 at 02:44, Marcelo Garlet Millani notifications@github.com wrote:
I disagree. The line you mentioned indeed leads to a problem, namely that \macroname\macroname is treated as a single word, but that is a different problem.
AFAICT when you type `\macr` the current code searches backwards to find the prefix to lookup in the symbols. What adding the backslash to wordchars does is to include the backslash as part of the symbol prefix, so it is never found in the symbols since they are stored without the backslash.
In my opinion, the best solution for both problems would be to patch the geanylatex plugin to autocomplete the word macro with macroname only if it is preceded by a . Then removing the \ from wordchars where you mentioned would make geany correctly recognize \macroname\macro as macro, and the latex plugin would be able to autocomplete it.
I havn't looked at the geanylatex plugin, but I don't think it does anything for autocomplete.
If this solution is acceptable, I could implement it.
— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/geany/geany/issues/1000#issuecomment-211054166
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1000#issuecomment-211131518
AFAICT when you type `\macr` the current code searches backwards to find the prefix to lookup in the symbols. What adding the backslash to wordchars does is to include the backslash as part of the symbol prefix, so it is never found in the symbols since they are stored without the backslash.
But the problem of autocompleting words not preceded by `` is unaffected. And since a LaTeX document normally has more text than macros, this can be quite annoying.
I havn't looked at the geanylatex plugin, but I don't think it does anything for autocomplete.
Well, it does have something for autocomplete [here](https://github.com/geany/geany-plugins/blob/master/geanylatex/src/geanylatex...), but it seems to be only for things like automatically inserting braces.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1000#issuecomment-211237976
Well, if all symbols have no `` and the prefix autocomplete uses has no `` then it will all work fine, like any other language :)
The geanylatex plugin is part of the geany-plugins project and each plugin has its own maintainer. Geany-plugins has a separate [repository](https://github.com/geany/geany-plugins) and you need to raise an issue there to discuss it with its maintainer.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1000#issuecomment-211246209
Maybe I wasn't very clear. All LaTeX macros are preceded by a ``. However, not everything is a macro. Consider, for example, the following LaTeX code:
```latex \newcommand{\macroname}{some \LaTeX code} We defined a new macro called \textbackslash\texttt{macroname} which expands to \macroname. ```
it is undesirable to receive autocomplete suggestions when writing the words `macro` or `macroname`, since they are not macros. However, when writing `\macroname` I would expect to have autocomplete available, since the symbol is known. The current behaviour does exactly the opposite. Furthermore, current word separation understands `\textbackslash\texttt` as a single word, and autocomplete for `\texttt` is then no longer possible (even if it were a known symbol).
Since the autocomplete feature for symbols is implemented in geany, and there is already language-specific code for LaTeX and other languages, isn't this a geany issue?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1000#issuecomment-211406684
github-comments@lists.geany.org