Skip to content

Commit

Permalink
feat: showing cursor on uri pane
Browse files Browse the repository at this point in the history
  • Loading branch information
wllfaria committed May 26, 2024
1 parent 3d0eb8c commit 56f6977
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tui/src/pages/collection_viewer/collection_viewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ impl<'ae> CollectionViewer<'ae> {
}

impl Page for CollectionViewer<'_> {
#[tracing::instrument(skip_all, target = "api_explorer")]
#[tracing::instrument(skip_all)]
fn draw(&mut self, frame: &mut Frame, size: Rect) -> anyhow::Result<()> {
self.draw_background(size, frame);

Expand Down Expand Up @@ -892,6 +892,19 @@ impl Page for CollectionViewer<'_> {
frame.set_cursor(col_with_offset, row_with_offset);
}

if self.focused_pane.eq(&PaneFocus::ReqUri) {
if let Some(request) = self.selected_request.as_ref() {
frame.set_cursor(
self.layout
.req_uri
.x
.add(request.borrow().uri.len() as u16)
.add(1),
self.layout.req_uri.y.add(1),
)
}
}

Ok(())
}

Expand Down

0 comments on commit 56f6977

Please sign in to comment.