<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Good to know. Thank you.<br><br><div dir="ltr">Sent from my iPhone</div><div dir="ltr"><br><blockquote type="cite">On Oct 14, 2019, at 2:54 AM, Allan Odgaard <mailinglist@textmate.org> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr">
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
<div style="font-family:sans-serif"><div style="white-space:normal"><p dir="auto">On 7 Oct 2019, at 16:31, Kyle Kirbatski wrote:</p>
<blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px"><p dir="auto">And try to code fold on the line "if ( !Array.isArraty(environment)) {“ then it ends up folding the entire function declaration.<br>
<br>
How can I make this work as expected? I have a sneaky suspicion that this is a fatal flaw with TextMate.</p>
</blockquote><p dir="auto">It’s a limitation of how foldings are defined, as foldable lines are determined by a regular expression match.</p>
<p dir="auto">So a line either starts a fold or stops a fold, it can’t do both, as the regular expression match is run against the full line, so TextMate wouldn’t know at what column the respective patterns think the folding should start/stop.</p>
<p dir="auto">The Language Server Protocol has a command/extension to request folding ranges from a language server, so if TextMate gets support for LSP, it could make use of this to get better ranges, assuming the language server for the respective language supports it, as TextMate itself has no problem folding your code as desired (you can fold manually by selecting the contents of the braces and press F1).</p>
</div>
</div>
<span></span><br><span>_______________________________________________</span><br><span>TextMate mailing list</span><br><span>TextMate@lists.macromates.com</span><br><span>https://lists.macromates.com/listinfo/textmate</span></div></blockquote></body></html>