diff --git a/komorebi/src/window_manager.rs b/komorebi/src/window_manager.rs index 7ae94794..72b4e508 100644 --- a/komorebi/src/window_manager.rs +++ b/komorebi/src/window_manager.rs @@ -1450,7 +1450,9 @@ impl WindowManager { anyhow!("this is not a valid direction from the current position") })?; - let adjusted_new_index = if new_idx > current_container_idx { + let adjusted_new_index = if new_idx > current_container_idx + && !matches!(workspace.layout(), Layout::Default(DefaultLayout::Grid)) + { new_idx - 1 } else { new_idx