Skip to content

Commit

Permalink
fix reset folding margin if lexer does not use it
Browse files Browse the repository at this point in the history
  • Loading branch information
antonvw committed Oct 27, 2024
1 parent a8c6ffe commit 0cec611
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ex/ex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ bool wex::ex::marker_add(char marker, int line)

const int col(
lin == get_stc()->GetCurrentLine() ?
get_stc()->GetColumn(get_stc()->GetCurrentPos()) :
get_stc()->GetColumn(get_stc()->GetCurrentPos()) + 1 :
0);

m_marker_columns[marker] = col;
Expand Down
10 changes: 7 additions & 3 deletions src/syntax/lexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -815,11 +815,15 @@ bool wex::lexer::set(const lexer& lexer, bool fold)
m_stc->SetMarginWidth(
m_stc->margin_folding_number(),
config(_("stc.margin.Folding")).get(16));
}

if (fold)
if (fold)
{
m_stc->fold();
}
}
else
{
m_stc->fold();
m_stc->SetMarginWidth(m_stc->margin_folding_number(), 0);
}

return m_scintilla_lexer.empty() || ok;
Expand Down

0 comments on commit 0cec611

Please sign in to comment.