diff --git a/NEWS.md b/NEWS.md
index b554afd3..84ba4079 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,7 @@
+Red Panda C++ Version 1.1.6
+
+ - fix: block indent doesn't work
+
Red Panda C++ Version 1.1.5
- change: uncheck "hide unsupported files" in files view shouldn't gray out non-c files
diff --git a/RedPandaIDE/RedPandaIDE.pro b/RedPandaIDE/RedPandaIDE.pro
index 16f5a5f2..f140e839 100644
--- a/RedPandaIDE/RedPandaIDE.pro
+++ b/RedPandaIDE/RedPandaIDE.pro
@@ -10,7 +10,7 @@ isEmpty(APP_NAME) {
}
isEmpty(APP_VERSION) {
- APP_VERSION=1.1.5
+ APP_VERSION=1.1.6
}
macos: {
diff --git a/RedPandaIDE/mainwindow.ui b/RedPandaIDE/mainwindow.ui
index d9a09a5e..a271cda2 100644
--- a/RedPandaIDE/mainwindow.ui
+++ b/RedPandaIDE/mainwindow.ui
@@ -871,7 +871,7 @@
QTabWidget::South
- 2
+ 1
diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp
index 72ec0126..5a28ba38 100644
--- a/RedPandaIDE/qsynedit/SynEdit.cpp
+++ b/RedPandaIDE/qsynedit/SynEdit.cpp
@@ -2774,7 +2774,6 @@ void SynEdit::doBlockIndent()
QStringList strToInsert;
int e,x,i;
QString spaces;
- BufferCoord insertionPos;
oldCaretPos = caretXY();
@@ -2802,19 +2801,41 @@ void SynEdit::doBlockIndent()
} else {
spaces = "\t";
}
- for (i = BB.line; ibeginBlock();
mUndoList->addChange(SynChangeReason::Caret, oldCaretPos, oldCaretPos,QStringList(), activeSelectionMode());
mUndoList->addChange(SynChangeReason::Selection,mBlockBegin,mBlockEnd,QStringList(), activeSelectionMode());
- insertionPos.line = BB.line;
+ int ch;
if (mActiveSelectionMode == SynSelectionMode::Column)
- insertionPos.ch = std::min(BB.ch, BE.ch);
+ ch = std::min(BB.ch, BE.ch);
else
- insertionPos.ch = 1;
- insertBlock(insertionPos, strToInsert);
+ ch = 1;
+ for (i = BB.line; i<=e;i++) {
+ if (i>mDocument->count())
+ break;
+ QString line=mDocument->getString(i-1);
+ if (ch>line.length()) {
+ mUndoList->addChange(
+ SynChangeReason::Insert,
+ BufferCoord{line.length(), i},
+ BufferCoord{line.length()+spaces.length(), i},
+ QStringList(),
+ SynSelectionMode::Normal);
+ line+=spaces;
+ } else {
+ mUndoList->addChange(
+ SynChangeReason::Insert,
+ BufferCoord{ch, i},
+ BufferCoord{ch+spaces.length(), i},
+ QStringList(),
+ SynSelectionMode::Normal);
+ line = line.left(ch-1)+spaces+line.mid(ch-1);
+ }
+ properSetLine(i-1,line);
+ }
//adjust caret and selection
oldCaretPos.ch = x;
if (BB.ch > 1)
@@ -3255,12 +3276,6 @@ void SynEdit::doOnStatusChange(SynStatusChanges)
mStatusChanges = SynStatusChange::scNone;
}
-void SynEdit::insertBlock(const BufferCoord& startPos, const QStringList& blockText)
-{
- setCaretAndSelection(startPos, startPos, startPos);
- setSelTextPrimitiveEx(SynSelectionMode::Column, blockText);
-}
-
void SynEdit::updateScrollbars()
{
int nMaxScroll;
diff --git a/RedPandaIDE/qsynedit/SynEdit.h b/RedPandaIDE/qsynedit/SynEdit.h
index e6a9ecd6..7aedd4fe 100644
--- a/RedPandaIDE/qsynedit/SynEdit.h
+++ b/RedPandaIDE/qsynedit/SynEdit.h
@@ -509,7 +509,6 @@ private:
void internalSetCaretY(int Value);
void setStatusChanged(SynStatusChanges changes);
void doOnStatusChange(SynStatusChanges changes);
- void insertBlock(const BufferCoord& startPos, const QStringList& blockText);
void updateScrollbars();
void updateCaret();
void recalcCharExtent();
diff --git a/Red_Panda_CPP.pro b/Red_Panda_CPP.pro
index a83164ed..c5d3e37c 100644
--- a/Red_Panda_CPP.pro
+++ b/Red_Panda_CPP.pro
@@ -23,7 +23,7 @@ SUBDIRS += \
APP_NAME = RedPandaCPP
-APP_VERSION = 1.1.5
+APP_VERSION = 1.1.6
linux: {
isEmpty(PREFIX) {