Use only SC_IV_LOOKFORWARD for Python like folding.
Code folding block for Nim, VB and YAML includes tailing empty or whitespace only lines, it's better for these lexers to use SC_IV_LOOKBOTH. Close #5821
This commit is contained in:
parent
9539a892eb
commit
3f114a557a
@ -1235,8 +1235,11 @@ void ScintillaEditView::setLexer(int lexerID, LangType langType, int whichList)
|
|||||||
|
|
||||||
if (svp._indentGuideLineShow)
|
if (svp._indentGuideLineShow)
|
||||||
{
|
{
|
||||||
auto currentIndentMode = execute(SCI_GETINDENTATIONGUIDES);
|
const auto currentIndentMode = execute(SCI_GETINDENTATIONGUIDES);
|
||||||
int docIndentMode = isFoldIndentationBased() ? SC_IV_LOOKFORWARD : SC_IV_LOOKBOTH;
|
// Python like indentation, excludes lexers (Nim, VB, YAML, etc.)
|
||||||
|
// that includes tailing empty or whitespace only lines in folding block.
|
||||||
|
const bool pythonLike = (lexerID == SCLEX_PYTHON || lexerID == SCLEX_COFFEESCRIPT || lexerID == SCLEX_HASKELL);
|
||||||
|
const int docIndentMode = pythonLike ? SC_IV_LOOKFORWARD : SC_IV_LOOKBOTH;
|
||||||
if (currentIndentMode != docIndentMode)
|
if (currentIndentMode != docIndentMode)
|
||||||
execute(SCI_SETINDENTATIONGUIDES, docIndentMode);
|
execute(SCI_SETINDENTATIONGUIDES, docIndentMode);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user