From 6ae68b793c3b1e7918b9b4e271505811a66cfe77 Mon Sep 17 00:00:00 2001 From: Arvin Verain Date: Thu, 23 Oct 2025 11:23:57 +0800 Subject: [PATCH] fix: Remove unneeded checks --- kitty/screen.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kitty/screen.c b/kitty/screen.c index 8f21ba3b6..0f20a9eab 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -4403,7 +4403,7 @@ find_cmd_output(Screen *self, OutputOffset *oo, index_type start_screen_y, unsig found_prompt = true; // change direction to downwards to find command output direction = 1; - } else if (line && line->attrs.prompt_kind == OUTPUT_START && !range_line_is_continued(self, y1)) { + } else if (line && line->attrs.prompt_kind == OUTPUT_START) { found_output = true; start = y1; found_prompt = true; direction = 1; @@ -4417,13 +4417,13 @@ find_cmd_output(Screen *self, OutputOffset *oo, index_type start_screen_y, unsig // find upwards: find prompt after the output, and the first output while (y1 >= upward_limit) { line = checked_range_line(self, y1); - if (line && line->attrs.prompt_kind == PROMPT_START && !range_line_is_continued(self, y1)) { + if (line && line->attrs.prompt_kind == PROMPT_START) { if (direction == 0) { found_prompt = true; break; } found_next_prompt = true; end = y1; - } else if (line && line->attrs.prompt_kind == OUTPUT_START && !range_line_is_continued(self, y1)) { + } else if (line && line->attrs.prompt_kind == OUTPUT_START) { found_output = true; start = y1; found_prompt = true; break; @@ -4449,12 +4449,12 @@ find_cmd_output(Screen *self, OutputOffset *oo, index_type start_screen_y, unsig break; } found_prompt = true; - } else if (found_prompt && !found_output) { + } else if (!found_output) { // skip fetching wrapped prompt lines while (range_line_is_continued(self, y2)) { y2++; } - } else if (found_output && !found_next_prompt) { + } else if (!found_next_prompt) { found_next_prompt = true; end = y2; break; } @@ -4532,7 +4532,7 @@ cmd_output(Screen *self, PyObject *args) { bool reached_upper_limit = false; while (!found && !reached_upper_limit) { line = checked_range_line(self, y); - if (!line || (line->attrs.prompt_kind == OUTPUT_START && !range_line_is_continued(self, y))) { + if (!line || (line->attrs.prompt_kind == OUTPUT_START)) { int start = line ? y : y + 1; reached_upper_limit = !line; int y2 = start; unsigned int num_lines = 0; bool found_content = false;