Skip to content

Commit 90dcfab

Browse files
committed
Only reorder within the same folder
1 parent c16c70d commit 90dcfab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

editor/src/document/document_file.rs

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

0 commit comments

Comments
 (0)