- fix: errors in the calculation of cut limit

This commit is contained in:
Roy Qu 2022-06-01 20:52:35 +08:00
parent 85f3a04bcf
commit c295649280
2 changed files with 5 additions and 2 deletions

View File

@ -5,6 +5,7 @@ Red Panda C++ Version 1.0.10
- fix: #define followed by tab not correctly parsed - fix: #define followed by tab not correctly parsed
- enhancement: don't auto add () when completing C++ io manipulators ( std::endl, std::fixed, etc.) - enhancement: don't auto add () when completing C++ io manipulators ( std::endl, std::fixed, etc.)
- fix: can't goto to definition of std::endl - fix: can't goto to definition of std::endl
- fix: errors in the calculation of cut limit
Red Panda C++ Version 1.0.9 Red Panda C++ Version 1.0.9
- fix: selection in column mode not correctly drawn when has wide chars in it - fix: selection in column mode not correctly drawn when has wide chars in it

View File

@ -1305,12 +1305,14 @@ void Editor::copyToClipboard()
void Editor::cutToClipboard() void Editor::cutToClipboard()
{ {
if (pSettings->editor().copySizeLimit()) { if (pSettings->editor().copySizeLimit()) {
if (document()->count() > pSettings->editor().copyLineLimits()) { int startLine = blockBegin().Line;
int endLine = blockEnd().Line;
if ((endLine-startLine+1) > pSettings->editor().copyLineLimits()) {
QMessageBox::critical(pMainWindow,tr("Error"), QMessageBox::critical(pMainWindow,tr("Error"),
tr("The text to be cut exceeds count limit!")); tr("The text to be cut exceeds count limit!"));
return; return;
} }
if (document()->getTextLength() > pSettings->editor().copyCharLimits() * 1000) { if ((selText().length()) > pSettings->editor().copyCharLimits() * 1000) {
QMessageBox::critical(pMainWindow,tr("Error"), QMessageBox::critical(pMainWindow,tr("Error"),
tr("The text to be cut exceeds character limit!")); tr("The text to be cut exceeds character limit!"));
return; return;