mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-19 23:21:15 -03:00
input: extract function for enqueuing query response
This commit is contained in:
@@ -1142,9 +1142,7 @@ fn parse_csi(&mut self, buffer: &mut Vec<u8>) -> Option<KeyEvent> {
|
||||
};
|
||||
FLOG!(reader, "Received cursor position report y:", y, "x:", x);
|
||||
let cursor_pos = ViewportPosition { x, y };
|
||||
self.push_front(CharEvent::QueryResult(QueryResultEvent::Response(
|
||||
QueryResponse::CursorPosition(cursor_pos),
|
||||
)));
|
||||
self.push_query_response(QueryResponse::CursorPosition(cursor_pos));
|
||||
return None;
|
||||
}
|
||||
b'S' => masked_key(function_key(4)),
|
||||
@@ -1196,9 +1194,7 @@ fn parse_csi(&mut self, buffer: &mut Vec<u8>) -> Option<KeyEvent> {
|
||||
},
|
||||
b'c' if private_mode == Some(b'?') => {
|
||||
FLOG!(reader, "Received Primary Device Attribute response");
|
||||
self.push_front(CharEvent::QueryResult(QueryResultEvent::Response(
|
||||
QueryResponse::PrimaryDeviceAttribute,
|
||||
)));
|
||||
self.push_query_response(QueryResponse::PrimaryDeviceAttribute);
|
||||
return None;
|
||||
}
|
||||
b'u' => {
|
||||
@@ -1501,6 +1497,10 @@ fn push_front(&mut self, ch: CharEvent) {
|
||||
self.get_input_data_mut().queue.push_front(ch);
|
||||
}
|
||||
|
||||
fn push_query_response(&mut self, response: QueryResponse) {
|
||||
self.push_front(CharEvent::QueryResult(QueryResultEvent::Response(response)));
|
||||
}
|
||||
|
||||
/// Find the first sequence of non-char events, and promote them to the front.
|
||||
fn promote_interruptions_to_front(&mut self) {
|
||||
// Find the first sequence of non-char events.
|
||||
|
||||
Reference in New Issue
Block a user