From b034d27eb9579feec3a01520c7ece3b2286db62e Mon Sep 17 00:00:00 2001 From: "royqh1979@gmail.com" Date: Sat, 20 Nov 2021 08:12:10 +0800 Subject: [PATCH] - fix: option "Move caret to the first non-space char in the current line when press HOME key" dosen't work fine. --- NEWS.md | 1 + RedPandaIDE/qsynedit/SynEdit.cpp | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index 5462ca58..53727ccb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ Version 0.9.2 For Dev-C++ 7 Beta - fix: gutter of the disassembly code control in the cpu info dialog is grayed - fix: problem set & problem views not correctly hidden when disabled in the executor / problem set options - fix: executor / problem set options not correctly saved + - fix: option "Move caret to the first non-space char in the current line when press HOME key" dosen't work fine. Version 0.9.1 For Dev-C++ 7 Beta - enhancement: code completion suggestion for "__func__" variable diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp index fafc06e4..a5d404ea 100644 --- a/RedPandaIDE/qsynedit/SynEdit.cpp +++ b/RedPandaIDE/qsynedit/SynEdit.cpp @@ -4652,7 +4652,7 @@ void SynEdit::moveCaretToLineStart(bool isSelection) { int newX; // home key enhancement - if (mOptions.testFlag(SynEditorOption::eoEnhanceHomeKey) && (lineToRow(mCaretY) == displayY())) { + if (mOptions.testFlag(SynEditorOption::eoEnhanceHomeKey)) { QString s = mLines->getString(mCaretY - 1); int first_nonblank = 0; @@ -4660,11 +4660,10 @@ void SynEdit::moveCaretToLineStart(bool isSelection) while ((first_nonblank < vMaxX) && (s[first_nonblank] == ' ' || s[first_nonblank] == '\t')) { first_nonblank++; } - newX = mCaretX; - if (newX > first_nonblank) - newX = first_nonblank; + if (newX > first_nonblank+1) + newX = first_nonblank+1; else newX = 1; } else