ScintillaOrg / lexilla

A library of language lexers for use with Scintilla
https://www.scintilla.org/Lexilla.html
Other
179 stars 64 forks source link

Folding incorrect for Python scripts in ASP HTML #235

Open nyamatongwe opened 5 months ago

nyamatongwe commented 5 months ago

The following ASP example ends with a negative fold level.

<%@language=python%>
<%
pass
%>

Script line 2 <% increments the fold level to base+1. Python folding is based on indentation so is base for line 3 pass. Line 4 %> decrements the fold level to base-1.

The example is the simplest case but all Python scripts show this problem.

For this scheme to work, the fold level from Python indentation and the fold level from tag nesting should be calculated independently then added together.

This problem occurs for both server-side (ASP) and client-side Python scripts. There are other forms of server-side Python but folding is specifically disabled for Mako. Client-side Python has never been popular so doesn't need to be fixed.

python.asp.txt