- fix: selection calculation error when editing in column mode
This commit is contained in:
parent
4492db3874
commit
f412eedcb0
1
NEWS.md
1
NEWS.md
|
@ -1,6 +1,7 @@
|
|||
Red Panda C++ Version 1.0.8
|
||||
- enhancement: auto complete '#undef'
|
||||
- enhancement: redesign components for compiler commandline arguments processing
|
||||
- fix: selection calculation error when editing in column mode
|
||||
|
||||
Red Panda C++ Version 1.0.7
|
||||
- change: use Shift+Enter to break line
|
||||
|
|
|
@ -6625,12 +6625,18 @@ void SynEdit::setActiveSelectionMode(const SynSelectionMode &Value)
|
|||
|
||||
BufferCoord SynEdit::blockEnd() const
|
||||
{
|
||||
if (mActiveSelectionMode == SynSelectionMode::smColumn) {
|
||||
return BufferCoord{
|
||||
std::max(mBlockBegin.Char,mBlockEnd.Char),
|
||||
std::max(mBlockBegin.Line,mBlockEnd.Line),
|
||||
};
|
||||
}
|
||||
|
||||
if ((mBlockEnd.Line < mBlockBegin.Line)
|
||||
|| ((mBlockEnd.Line == mBlockBegin.Line) && (mBlockEnd.Char < mBlockBegin.Char)))
|
||||
return mBlockBegin;
|
||||
else
|
||||
return mBlockEnd;
|
||||
|
||||
}
|
||||
|
||||
void SynEdit::setBlockEnd(BufferCoord Value)
|
||||
|
@ -6717,6 +6723,12 @@ void SynEdit::setSelText(const QString &text)
|
|||
|
||||
BufferCoord SynEdit::blockBegin() const
|
||||
{
|
||||
if (mActiveSelectionMode == SynSelectionMode::smColumn) {
|
||||
return BufferCoord{
|
||||
std::min(mBlockBegin.Char,mBlockEnd.Char),
|
||||
std::min(mBlockBegin.Line,mBlockEnd.Line),
|
||||
};
|
||||
}
|
||||
if ((mBlockEnd.Line < mBlockBegin.Line)
|
||||
|| ((mBlockEnd.Line == mBlockBegin.Line) && (mBlockEnd.Char < mBlockBegin.Char)))
|
||||
return mBlockEnd;
|
||||
|
|
Loading…
Reference in New Issue