Skip to content

Commit c16c70d

Browse files
committed
Skip folders on a different indentation level during reorder
1 parent 34e1bb1 commit c16c70d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

editor/src/document/document_file.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,8 @@ impl MessageHandler<DocumentMessage, &InputPreprocessor> for DocumentMessageHand
408408
1 => selected_layers.last(),
409409
_ => unreachable!(),
410410
} {
411-
if let Some(pos) = all_layer_paths.iter().position(|path| path == pivot) {
411+
let all_layer_paths:Vec<_> = all_layer_paths.iter().filter(|layer|layer.len() == pivot.len()).collect();
412+
if let Some(pos) = all_layer_paths.iter().position(|path| *path == pivot) {
412413
let max = all_layer_paths.len() as i64 - 1;
413414
let insert_pos = (pos as i64 + relative_position as i64).clamp(0, max) as usize;
414415
let insert = all_layer_paths.get(insert_pos);

0 commit comments

Comments
 (0)