<p dir="auto">I'm doing some customization work on an OpenCart site and I noticed that the syntax highlighting in <code class="notranslate">admin/model/catalog/product.php</code> is all messed up.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/5471922/3343789/f36ac0a0-f8a3-11e3-8a82-0df981984c8d.png"><img src="https://cloud.githubusercontent.com/assets/5471922/3343789/f36ac0a0-f8a3-11e3-8a82-0df981984c8d.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Somewhere around the <code class="notranslate">subtract</code> field, Atom's highlighter gets stuck in "string" mode. This continues to line 137, where the code turns a uniform gray, and then it returns to normal on line 139.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/5471922/3343849/9610bbb6-f8a4-11e3-8f1c-19f82765a7dc.png"><img src="https://cloud.githubusercontent.com/assets/5471922/3343849/9610bbb6-f8a4-11e3-8f1c-19f82765a7dc.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Komodo Edit parses the same file correctly:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/5471922/3344001/17e676a2-f8a6-11e3-95e9-4c771656afe0.png"><img src="https://cloud.githubusercontent.com/assets/5471922/3344001/17e676a2-f8a6-11e3-95e9-4c771656afe0.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Atom 0.105.0, OS X 10.9.3.</p>
<p dir="auto">Consider a series of quoted strings in an array in ruby:</p>
<div class="highlight highlight-source-ruby notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="states = ['AL', 'AK', 'AZ', 'AR', 'CO', 'DE', 'FL', 'GA', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', 'RI', 'SC', 'SD', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY']"><pre class="notranslate"><span class="pl-s1">states</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-s">'AL'</span><span class="pl-kos">,</span> <span class="pl-s">'AK'</span><span class="pl-kos">,</span> <span class="pl-s">'AZ'</span><span class="pl-kos">,</span> <span class="pl-s">'AR'</span><span class="pl-kos">,</span> <span class="pl-s">'CO'</span><span class="pl-kos">,</span> <span class="pl-s">'DE'</span><span class="pl-kos">,</span> <span class="pl-s">'FL'</span><span class="pl-kos">,</span> <span class="pl-s">'GA'</span><span class="pl-kos">,</span> <span class="pl-s">'HI'</span><span class="pl-kos">,</span> <span class="pl-s">'ID'</span><span class="pl-kos">,</span> <span class="pl-s">'IL'</span><span class="pl-kos">,</span> <span class="pl-s">'IN'</span><span class="pl-kos">,</span> <span class="pl-s">'IA'</span><span class="pl-kos">,</span> <span class="pl-s">'KS'</span><span class="pl-kos">,</span> <span class="pl-s">'KY'</span><span class="pl-kos">,</span> <span class="pl-s">'LA'</span><span class="pl-kos">,</span> <span class="pl-s">'ME'</span><span class="pl-kos">,</span> <span class="pl-s">'MD'</span><span class="pl-kos">,</span> <span class="pl-s">'MI'</span><span class="pl-kos">,</span> <span class="pl-s">'MN'</span><span class="pl-kos">,</span> <span class="pl-s">'MS'</span><span class="pl-kos">,</span> <span class="pl-s">'MO'</span><span class="pl-kos">,</span> <span class="pl-s">'MT'</span><span class="pl-kos">,</span> <span class="pl-s">'NE'</span><span class="pl-kos">,</span> <span class="pl-s">'NV'</span><span class="pl-kos">,</span> <span class="pl-s">'NH'</span><span class="pl-kos">,</span> <span class="pl-s">'NJ'</span><span class="pl-kos">,</span> <span class="pl-s">'NM'</span><span class="pl-kos">,</span> <span class="pl-s">'NY'</span><span class="pl-kos">,</span> <span class="pl-s">'NC'</span><span class="pl-kos">,</span> <span class="pl-s">'ND'</span><span class="pl-kos">,</span> <span class="pl-s">'OH'</span><span class="pl-kos">,</span> <span class="pl-s">'OK'</span><span class="pl-kos">,</span> <span class="pl-s">'OR'</span><span class="pl-kos">,</span> <span class="pl-s">'RI'</span><span class="pl-kos">,</span> <span class="pl-s">'SC'</span><span class="pl-kos">,</span> <span class="pl-s">'SD'</span><span class="pl-kos">,</span> <span class="pl-s">'TX'</span><span class="pl-kos">,</span> <span class="pl-s">'UT'</span><span class="pl-kos">,</span> <span class="pl-s">'VT'</span><span class="pl-kos">,</span> <span class="pl-s">'VA'</span><span class="pl-kos">,</span> <span class="pl-s">'WA'</span><span class="pl-kos">,</span> <span class="pl-s">'WV'</span><span class="pl-kos">,</span> <span class="pl-s">'WI'</span><span class="pl-kos">,</span> <span class="pl-s">'WY'</span><span class="pl-kos">]</span></pre></div>
<p dir="auto">In atom, if this list stopped at <code class="notranslate">MI</code> syntax highlighting would resume as normal. However, it acts as if the rest of the file has a single quote at the top:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/49549/2928565/eb0b968c-d77e-11e3-934c-1b7c165ada03.gif"><img src="https://cloud.githubusercontent.com/assets/49549/2928565/eb0b968c-d77e-11e3-934c-1b7c165ada03.gif" alt="quote-bug" data-animated-image="" style="max-width: 100%;"></a></p>
<p dir="auto">I'm using the <a href="https://atom.io/themes/tomorrow" rel="nofollow">Tomorrow theme</a> but it shows up in others as well. This also happens in python, but the quote limit is one less and only the rest of the line is unquoted. Same with C, although again the quote limit changes. Very odd.</p>