@@ -2043,7 +2043,7 @@ static Tie* createAndAddTie(Note* startNote, Note* endNote)
20432043void Score::cmdAddTie (bool addToChord)
20442044{
20452045 const std::vector<Note*> noteList = cmdTieNoteList (selection (), noteEntryMode ());
2046-
2046+ std::vector<EngravingItem*> toSelect;
20472047 if (noteList.empty ()) {
20482048 LOGD (" no notes selected" );
20492049 return ;
@@ -2138,10 +2138,12 @@ void Score::cmdAddTie(bool addToChord)
21382138 }
21392139 }
21402140 }
2141+ toSelect.push_back (n);
21412142 }
21422143 if (lastAddedChord) {
21432144 nextInputPos (lastAddedChord, false );
21442145 }
2146+ score ()->select (toSelect, SelectType::ADD);
21452147 endCmd ();
21462148}
21472149
@@ -2161,7 +2163,6 @@ Tie* Score::cmdToggleTie()
21612163 std::vector<Note*> tieNoteList (noteList.size ());
21622164 Chord* chord = noteList.front ()->chord ();
21632165 bool someHaveExistingNextNoteToTieTo = false ;
2164- bool allHaveExistingNextNoteToTieTo = true ;
21652166
21662167 for (size_t i = 0 ; i < noteList.size (); ++i) {
21672168 Note* n = noteList[i];
@@ -2175,22 +2176,14 @@ Tie* Score::cmdToggleTie()
21752176 tieNoteList[i] = tieNote;
21762177 if (tieNote) {
21772178 someHaveExistingNextNoteToTieTo = true ;
2178- } else {
2179- allHaveExistingNextNoteToTieTo = false ;
21802179 }
21812180 }
21822181 }
21832182
21842183 const bool shouldTieListSelection = noteList.size () >= 2 && !chord;
21852184
2186- if (chord /* i.e. all notes are in the same chord */ && !allHaveExistingNextNoteToTieTo) {
2187- cmdAddTie ();
2188- if (noteList.size () >= 2 ) {
2189- Chord* c = chord->next ();
2190- for (Note* cn : c->notes ()) {
2191- score ()->select (cn, SelectType::ADD);
2192- }
2193- }
2185+ if (chord) { /* i.e. all notes are in the same chord */
2186+ cmdAddTie (true );
21942187 return nullptr ;
21952188 }
21962189
0 commit comments