Refactor codebase: improve formatting consistency, simplify message rendering, and optimize cursor and visual selection handling logic across panels.
This commit is contained in:
@@ -35,7 +35,12 @@ impl MessageFormatter {
|
||||
}
|
||||
|
||||
pub fn format_message(&self, message: &Message) -> Vec<String> {
|
||||
message.content.trim().lines().map(|s| s.to_string()).collect()
|
||||
message
|
||||
.content
|
||||
.trim()
|
||||
.lines()
|
||||
.map(|s| s.to_string())
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Extract thinking content from <think> tags, returning (content_without_think, thinking_content)
|
||||
|
||||
@@ -144,7 +144,8 @@ impl SessionController {
|
||||
|
||||
self.conversation.push_user_message(content);
|
||||
|
||||
self.send_request_with_current_conversation(parameters).await
|
||||
self.send_request_with_current_conversation(parameters)
|
||||
.await
|
||||
}
|
||||
|
||||
/// Send a request using the current conversation without adding a new user message
|
||||
|
||||
@@ -422,4 +422,4 @@ mod tests {
|
||||
assert_eq!(find_prev_word_boundary(line, 11), Some(6));
|
||||
assert_eq!(find_prev_word_boundary(line, 6), Some(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user