mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 08:46:08 +03:00
gtk: use destructuring syntax
This commit is contained in:

committed by
Mitchell Hashimoto

parent
290b79ad62
commit
7cad9a253e
@ -269,7 +269,7 @@ pub fn closeSurface(self: *Window, surface: *Surface) void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn closeSurfaceInPaned(self: *Window, surface: *Surface, paned: *Paned, position: Position) void {
|
fn closeSurfaceInPaned(self: *Window, surface: *Surface, paned: *Paned, position: Position) void {
|
||||||
const sibling = switch (position) {
|
const sibling_child, const sibling_widget = switch (position) {
|
||||||
.start => .{
|
.start => .{
|
||||||
paned.child2,
|
paned.child2,
|
||||||
c.gtk_paned_get_end_child(paned.paned),
|
c.gtk_paned_get_end_child(paned.paned),
|
||||||
@ -279,9 +279,6 @@ fn closeSurfaceInPaned(self: *Window, surface: *Surface, paned: *Paned, position
|
|||||||
c.gtk_paned_get_start_child(paned.paned),
|
c.gtk_paned_get_start_child(paned.paned),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
// TODO: Use destructuring syntax once it doesn't break ZLS
|
|
||||||
const sibling_child = sibling[0];
|
|
||||||
const sibling_widget = sibling[1];
|
|
||||||
|
|
||||||
// Keep explicit reference to sibling's widget (gl_area, or Paned), so it's
|
// Keep explicit reference to sibling's widget (gl_area, or Paned), so it's
|
||||||
// not destroyed when we remove it from GtkPaned.
|
// not destroyed when we remove it from GtkPaned.
|
||||||
|
Reference in New Issue
Block a user