Skip to content

Commit

Permalink
Only reorder within the same folder
Browse files Browse the repository at this point in the history
  • Loading branch information
TrueDoctor committed Aug 11, 2021
1 parent c16c70d commit 14f1eac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion editor/src/document/document_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ impl MessageHandler<DocumentMessage, &InputPreprocessor> for DocumentMessageHand
1 => selected_layers.last(),
_ => unreachable!(),
} {
let all_layer_paths:Vec<_> = all_layer_paths.iter().filter(|layer|layer.len() == pivot.len()).collect();
let all_layer_paths:Vec<_> = all_layer_paths.iter().filter(|layer|layer.starts_with(&pivot[0..pivot.len()-1]) && pivot.len() == layer.len()).collect();
if let Some(pos) = all_layer_paths.iter().position(|path| *path == pivot) {
let max = all_layer_paths.len() as i64 - 1;
let insert_pos = (pos as i64 + relative_position as i64).clamp(0, max) as usize;
Expand Down

0 comments on commit 14f1eac

Please sign in to comment.