From 4ce3d1403fff14343fa558a7b857c88b56902315 Mon Sep 17 00:00:00 2001 From: "J.G" Date: Tue, 1 Oct 2024 20:56:59 +0000 Subject: [PATCH] Fix: Regression from #605 and also allow for [prev measure/system] in note-entry even when input state has no ChordRest --- libmscore/cmd.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libmscore/cmd.cpp b/libmscore/cmd.cpp index 4cd13966133d5..ae45a15e466a4 100644 --- a/libmscore/cmd.cpp +++ b/libmscore/cmd.cpp @@ -2370,8 +2370,8 @@ Element* Score::move(const QString& cmd) cr = selection().cr(); if (cr && (cr->isGrace() || cmd == "next-chord" || cmd == "prev-chord")) ; - else - cr = inputState().cr(); + else cr = inputState().cr() ? inputState().cr() : cr; + } else if (selection().activeCR()) cr = selection().activeCR(); @@ -2512,8 +2512,9 @@ Element* Score::move(const QString& cmd) // selection "cursor" // find previous chordrest, which might be a grace note // this may override note input cursor - el = noteEntryPos ? el : prevChordRest(cr); - + if (auto pcr = prevChordRest(cr)) { + el = (noteEntryPos && !pcr->isGrace()) ? el : pcr; + } // Skip gap rests if we're not in note entry mode... while (!noteEntryMode() && el && el->isRest() && toRest(el)->isGap()) el = prevChordRest(toChordRest(el));