diff: Synchronize tree with hunk focus
1ab5730446c87d574e5f2e19b229593cfe9dd0a4
1 parent
5bea479d
crates/diff/src/viewer.rs
+2 -2
| 1110 | 1110 | self.state |
|
| 1111 | 1111 | .scroll |
|
| 1112 | 1112 | .set_offset(row, self.scroll_rows(visible_rows), visible_rows); |
|
| 1113 | 1113 | } |
|
| 1114 | 1114 | ||
| 1115 | - | /// Updates the file-tree cursor to the visible diff file. |
|
| 1115 | + | /// Updates the file-tree cursor to the focused or visible diff file. |
|
| 1116 | 1116 | fn sync_file_tree(&mut self) { |
|
| 1117 | - | if let Some(file) = self.visible_file() { |
|
| 1117 | + | if let Some(file) = self.active_file() { |
|
| 1118 | 1118 | self.file_tree.select_file(file); |
|
| 1119 | 1119 | } |
|
| 1120 | 1120 | } |
|
| 1121 | 1121 | ||
| 1122 | 1122 | /// Renders the current frame into `buf`. |
a.rs
+0 -0
image.png
+0 -0
a.rs
+0 -0
b.rs
+0 -0
a.rs
+0 -0
a.rs
+0 -0
a.rs
+0 -0
a.rs
+0 -0
b.rs
+0 -0
crates/diff/tests/golden/sticky_header_before_next_file_64x5.txt
+0 -0
src/a.rs
+0 -0
src/b.rs
+0 -0
README.md
+0 -0
src/app/a.rs
+0 -0
src/lib/b.rs
+0 -0
README.md
+0 -0
a.rs
+0 -0
b.rs
+0 -0
assets/css/style.css
+0 -0
assets/css/style.css
+0 -0
first.rs
+0 -0
second.rs
+0 -0
a.rs
+0 -0
a.rs
+0 -0
a.rs
+0 -0
a.rs
+0 -0
a.rs
+0 -0
b.rs
+0 -0
a.rs\n",
+0 -0
new.rs\n",
+0 -0
a\n\
+0 -0