- fix: "collapse all" and "uncollapse all" doesn't work

This commit is contained in:
royqh1979 2021-11-13 17:41:16 +08:00
parent c4b61b8985
commit 7c0ee9857b
4 changed files with 28 additions and 8 deletions

13
NEWS.md
View File

@ -1,14 +1,17 @@
Version 0.8.7 For Dev-C++ 7 Beta
- enhancement: auto indent line to column 1 when enter '#' at beginning of line
- fix: when enter '{' or '}' at beginning of line, auto indent will remove all contents of the line
- fix: auto indent should be turned off when reformat code
- fix: auto indent should be turned off when replace in code
Version 0.8.8 For Dev-C++ 7 Beta
- enhancement: drag & drop text in the editor
- enhancement: auto calcuate caret line size basing on font size
- enhancement: shift+mouse wheel to scroll horizontally
- fix: greatly reduces paste time
- fix: auto indent shouldn't use preprocessor's indent to calculate
- fix: option "don't add leading zeros to line numbers" not work
- fix: "collapse all" and "uncollapse all" doesn't work
Version 0.8.7 For Dev-C++ 7 Beta
- enhancement: auto indent line to column 1 when enter '#' at beginning of line
- fix: when enter '{' or '}' at beginning of line, auto indent will remove all contents of the line
- fix: auto indent should be turned off when reformat code
- fix: auto indent should be turned off when replace in code
Version 0.8.6 For Dev-C++ 7 Beta
- enhancement: greatly reduces memory usage for symbol parsing ( memory needed for bits/stdc++.h reduced from 150m+ to 80m+)

View File

@ -3773,7 +3773,7 @@ void MainWindow::on_actionUnfoldAll_triggered()
{
Editor * editor = mEditorList->getEditor();
if (editor != NULL ) {
//editor->clearFolds();
editor->unCollpaseAll();
}
}
@ -3781,8 +3781,7 @@ void MainWindow::on_actionFoldAll_triggered()
{
Editor * editor = mEditorList->getEditor();
if (editor != NULL ) {
//editor->clearFolds();
//editor->foldAll();
editor->collapseAll();
}
}

View File

@ -1066,6 +1066,20 @@ void SynEdit::setCaretAndSelection(const BufferCoord &ptCaret, const BufferCoord
setBlockEnd(ptAfter);
}
void SynEdit::collapseAll()
{
for (int i = mAllFoldRanges.count()-1;i>=0;i--){
collapse(mAllFoldRanges[i]);
}
}
void SynEdit::unCollpaseAll()
{
for (int i = mAllFoldRanges.count()-1;i>=0;i--){
uncollapse(mAllFoldRanges[i]);
}
}
void SynEdit::processGutterClick(QMouseEvent *event)
{
int X = event->pos().x();
@ -5054,6 +5068,7 @@ int SynEdit::insertTextByNormalMode(const QString &Value)
bool bChangeScroll;
// int SpaceCount;
int Result = 0;
int startLine = mCaretY;
sLeftSide = lineText().mid(0, mCaretX - 1);
if (mCaretX - 1 > sLeftSide.length()) {
if (StringIsBlank(sLeftSide))
@ -5122,6 +5137,7 @@ int SynEdit::insertTextByNormalMode(const QString &Value)
internalSetCaretXY(BufferCoord{lineText().length()+1,caretY});
} else
internalSetCaretXY(BufferCoord{Str.length() - sRightSide.length()+1,caretY});
onLinesPutted(startLine-1,Result+1);
return Result;
}

View File

@ -219,6 +219,8 @@ public:
const BufferCoord& ptBefore,
const BufferCoord& ptAfter);
void collapseAll();
void unCollpaseAll();
void uncollapseAroundLine(int line);
PSynEditFoldRange foldHidesLine(int line);
void setSelLength(int Value);