diff --git a/ChangeLog b/ChangeLog index de4e925f..f5cf09e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ V0.6.0 * Added a workaround for an old Qt bug, because of which, QTimer may not work after resuming from suspend or hibernation. * Give focus to text-edit/side-pane with Escape. * Don't let custom shortcuts be read from global config files. + * Yet smarter Shift+Enter with alphabetical lists. V0.5.1 --------- diff --git a/NEWS b/NEWS index 04327767..78ad34ee 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,5 @@ Latest version: - 6 Mar 2020, V0.6.0 + 10 Mar 2020, V0.6.0 See "ChangeLog" for changes. diff --git a/feathernotes/textedit.cpp b/feathernotes/textedit.cpp index 8b5bcddb..83dbfedb 100644 --- a/feathernotes/textedit.cpp +++ b/feathernotes/textedit.cpp @@ -244,22 +244,27 @@ void TextEdit::keyPressEvent (QKeyEvent *event) /* still check if a letter or number follows */ if (i < curBlockPos) { - if (blockText.at (i).isLetter()) + QChar c = blockText.at (i); + if (c.isLetter()) { if (i + 1 < curBlockPos && !prefix.isEmpty() && !prefix.at (prefix.size() - 1).isSpace() && blockText.at (i + 1).isSpace()) { // non-letter and non-space character -> singlle letter -> space prefix = blockText.left (i + 2); + QChar cc = QChar (c.unicode() + 1); + if (cc.isLetter()) prefix.replace (c, cc); } else if (i + 2 < curBlockPos && !blockText.at (i + 1).isLetterOrNumber() && !blockText.at (i + 1).isSpace() && blockText.at (i + 2).isSpace()) { // singlle letter -> non-letter and non-space character -> space prefix = blockText.left (i + 3); + QChar cc = QChar (c.unicode() + 1); + if (cc.isLetter()) prefix.replace (c, cc); } } - else if (blockText.at (i).isNumber()) + else if (c.isNumber()) { // making lists with numbers QString num; while (i < curBlockPos)