<p>Fixes issue <a href="https://github.com/geany/geany/issues/1000" class="issue-link js-issue-link" data-url="https://github.com/geany/geany/issues/1000" data-id="148883952" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">#1000</a> . Geany now correctly autocompletes LaTeX macros.<br>
The difference in behaviour can be illustrated with the following document:</p>

<div class="highlight highlight-text-tex"><pre><span class="pl-c1">\newcommand</span>{<span class="pl-c1">\macroname</span>}{}
<span class="pl-c">% The following occurrences of \macro are now autocompleted to \macroname</span>
<span class="pl-c1">\macro</span> 
<span class="pl-c1">\alpha\macro</span>
<span class="pl-c">% The following is no longer autocompleted to macroname</span>
macro
<span class="pl-c">% Example with @</span>
<span class="pl-c1">\newcommand</span>{<span class="pl-c1">\@anothermacro</span>}{}
<span class="pl-c">% Gets autocompleted</span>
<span class="pl-c1">\@another</span></pre></div>

<p>The tests were updated to accept this behaviour (since macro tags now start with <code>\</code>).<br>
This also identifies macros defined with <code>\let</code>, <code>\newlength</code> and environments defined with <code>\renewenvironment</code>.</p>

<p>Finally, <code>@</code> can be used sometimes in a macro name and mostly any character can be used in a label. I added <code>:@</code> to wordchars so that they can be used in autocomplete.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/geany/geany/pull/1011'>https://github.com/geany/geany/pull/1011</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>'\' is included in macro tag.</li>
  <li>Updated copyright.</li>
  <li>Made indentation consistent with the rest of the project.</li>
  <li>Correctly separates LaTeX words.</li>
  <li>Environments can be defined with \renewenvironment as well.</li>
  <li>Correctly add macro tags.</li>
  <li>Macros can also be defined with \let</li>
  <li>Removed my copyright since I don't even know if I could add it.</li>
  <li>Updated tests to include \ in macros.</li>
  <li>Recognizes new lengths as macros.</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1011/files#diff-0">src/editor.c</a>
    (31)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1011/files#diff-1">tagmanager/ctags/latex.c</a>
    (338)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1011/files#diff-2">tests/ctags/3526726.tex.tags</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1011/files#diff-3">tests/ctags/bug2886870.tex.tags</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1011/files#diff-4">tests/ctags/intro_orig.tex.tags</a>
    (6)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/geany/geany/pull/1011.patch'>https://github.com/geany/geany/pull/1011.patch</a></li>
  <li><a href='https://github.com/geany/geany/pull/1011.diff'>https://github.com/geany/geany/pull/1011.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly or <a href="https://github.com/geany/geany/pull/1011">view it on GitHub</a><img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ5WTHgvE2P-IjFeS3IenTgvLCLTgks5p70lPgaJpZM4IQ2OS.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/pull/1011"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>