Commit Graph

15 Commits (43a3338491b3f6c409606ebfaab3a38c96455144)

Author SHA1 Message Date
Islam Sharabash 22a624e560 Equalize splits based on children oriented in the same direction
This changes equalization so it only counts children oriented in the
same direction.

This makes splits a bit more aesthetic, and replicates how split
equalization works in neovim.
2025-06-28 09:01:41 +02:00
Mitchell Hashimoto e4cd90b8a0
macos: set explicit identity for split tree view based on structure
Fixes #7546

SwiftUI uses type and structure to identify views, which can lead
to issues with tree like structures where the shape and type is the same
but the content changes. This was causing #7546.

To fix this, we need to add explicit identity to the split tree view
so that SwiftUI can differentiate when it needs to redraw the view.

We don't want to blindly add Hashable to SplitTree because we don't want
to take into account all the fields. Instead, we add an explicit
"structural identity" to the SplitTreeView that can be used by SwiftUI.
2025-06-08 20:11:58 -07:00
Mitchell Hashimoto 104cc2adfe
macos: basic undo close window, not very robust yet 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto 045c84acb7
macos: split directional navigation should use distance to leaf
Fixes regression from #7523

I messed two things up around spatial navigation in the split tree
that this commit fixes:

  1. The distance in the spatial tree only used a single dimension
     that we were navigating. This commit now uses 2D euclidean
     distance from the top-left corners of nodes. This handles the case
     where the nodes are directly above or below each other better.

  2. The spatial slots include split containers because they are layout
     elements. But we should only navigate to leaf nodes. This was
     causing the wrong navigatin to happen in some scenarios.
2025-06-05 13:43:07 -07:00
Mitchell Hashimoto 69c3c359cb
macos: resize split keybind handling 2025-06-05 07:05:13 -07:00
Mitchell Hashimoto 5299f10e13
macos: unzoom on new split and focus change 2025-06-05 07:05:13 -07:00
Mitchell Hashimoto 22819f8a29
macos: transfer doesBorderTop 2025-06-05 07:05:12 -07:00
Mitchell Hashimoto b7c01b5b4a
macos: spatial focus navigation 2025-06-05 07:05:12 -07:00
Mitchell Hashimoto ec7fd94d0f
macos: equalize splits works with new tree 2025-06-05 07:05:12 -07:00
Mitchell Hashimoto 7dcfebcd5d
macos: isSplit guarding on focus split directions works 2025-06-05 07:05:12 -07:00
Mitchell Hashimoto 0fb58298a7
macos: focus split previous/next 2025-06-05 07:05:11 -07:00
Mitchell Hashimoto d1dce1e372
macos: restoration for new split tree 2025-06-05 07:05:11 -07:00
Mitchell Hashimoto 33d94521ea
macos: setup sequence for SplitTree 2025-06-05 07:05:11 -07:00
Mitchell Hashimoto e3bc3422dc
macos: handle split resizing 2025-06-05 07:05:11 -07:00
Mitchell Hashimoto 1707159441
new SplitTree 2025-06-05 07:05:11 -07:00