Stems, hooks/flags, and beams not selected after paste or repeat

• Jul 11, 2017 - 15:57
S4 - Minor

2.0.3 /2.1 / Win 7/10

See the attached file.

1. Untick "Show invisible."
2. Select first two measures by clicking on a space in measure 1, then shift-clicking on a space in measure 2.
3. Press R to repeat.
4. Immediately press V.

Expected result: All notes in repeated section are hidden
Actual result: Stems and some flags are still visible.

6. Select the repeated section (measures 3-4) as in step 2.
7. Press V.

Result: All notes are made invisible as expected.

Attachment Size
selection_example.mscz 7.02 KB


When you press R to duplicate a section of music, the only things selected in the destination are the notes, not the chords. You would expect only the note heads to become invisible if they are the only things selected.

I agree that this is not desirable results. I would prefer the destination to be selected in its entirety like you are expecting. I can think of no downside to the entire destination being selected, you can still transpose it (use arrows to move notes up or down), which is the most likely thing you would want to do with it.

As a related aside, if you move to the next empty spot and press ctrl-v the originally selected area will be pasted with the entire area selected.

Title Selection rectangle changes after repeat (R) command Stems, flags, and beams not selected after paste or repeat

Same thing for paste. The selection rectangle is actually fine, and other elements in the range remain selected (eg, text, articulations) but stems, flags, and beams do not

Status (old) active needs info

Same in earlier 2.x releases, btw. And as far as I can tell, in 1.x as well, although without the "V" command or the Inspector, it's more difficult to ascertain what is and is not selected.

Problem appears to be that we update the selection before it has been laid out, and thus the stems etc have no been generated yet. The fact that we deal with selection pre-layout has been the source of other issues as well, see in particular #120356: Copy-paste an empty measure onto a measure located before a MM-rest causes corruption/crash. We kind of skirted around the issue for mmrests, but maybe we need to step back and rethink how we handle the selection after paste.

Status (old) needs info active

Didn't mean to change the status.

BTW, this reminds me, I'd love to see selection after up/down as well. Not finding an open issue for that, but: select region, press up to transpose, selection turns into list instead of remaining a range. I believe this one will turn out to be easy; the chord is still there from before the operation so it is already laid out, even if the layout is no longer current.

Does anyone see an official issue for the up/down issue?

FWIW, I tried a simple fix and it mostly works but runs into the same snag as here - with accidentals, which are regenerated on every transposition. So I can get the selection rectangle to remain in place after up & down, and stems etc remain selected, but the newly-generated accidentals are not, for the same reason. So a bigger picture solution to the issue of updating selection after a command is still needed, I think. Maybe we consider calling _selection.updateSelectedElements() from within endCmd() or something like that (for range selections, anyhow).

Title Stems, flags, and beams not selected after paste or repeat Stems, hooks, and beams not selected after paste or repeat
Reported version 2.1  
Regression No
Workaround No

(MuseScore seems to call them hooks, like e.g. in Inspector)

Title Stems, hooks, and beams not selected after paste or repeat Stems, hooks/flags, and beams not selected after paste or repeat

SMuFL calls them flags though