mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
Change ifs to exhaustive switches
This commit is contained in:
@ -2596,6 +2596,15 @@ pub fn selectOutput(self: *Screen, pin: Pin) ?Selection {
|
|||||||
while (it.next()) |p| {
|
while (it.next()) |p| {
|
||||||
it_prev = p;
|
it_prev = p;
|
||||||
const row = p.rowAndCell().row;
|
const row = p.rowAndCell().row;
|
||||||
|
switch (row.semantic_prompt) {
|
||||||
|
.command => break,
|
||||||
|
|
||||||
|
.unknown,
|
||||||
|
.prompt,
|
||||||
|
.prompt_continuation,
|
||||||
|
.input,
|
||||||
|
=> {},
|
||||||
|
}
|
||||||
if (row.semantic_prompt == .command) {
|
if (row.semantic_prompt == .command) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2606,8 +2615,14 @@ pub fn selectOutput(self: *Screen, pin: Pin) ?Selection {
|
|||||||
// yield the previous row.
|
// yield the previous row.
|
||||||
while (it.next()) |p| {
|
while (it.next()) |p| {
|
||||||
const row = p.rowAndCell().row;
|
const row = p.rowAndCell().row;
|
||||||
if (row.semantic_prompt != .command) {
|
switch (row.semantic_prompt) {
|
||||||
break :boundary it_prev;
|
.command => {},
|
||||||
|
|
||||||
|
.unknown,
|
||||||
|
.prompt,
|
||||||
|
.prompt_continuation,
|
||||||
|
.input,
|
||||||
|
=> break :boundary it_prev,
|
||||||
}
|
}
|
||||||
it_prev = p;
|
it_prev = p;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user