Skip to content

Commit

Permalink
cargo format
Browse files Browse the repository at this point in the history
  • Loading branch information
ynqa committed Aug 6, 2024
1 parent 4e9104a commit 2d774d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/jnv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub struct Jnv {

json_expand_depth: Option<usize>,
no_hint: bool,
clipboard: ClipboardContext
clipboard: ClipboardContext,
}

impl Jnv {
Expand Down Expand Up @@ -183,7 +183,7 @@ impl Jnv {
json_expand_depth,
no_hint,
input_stream,
clipboard: ClipboardProvider::new().unwrap()
clipboard: ClipboardProvider::new().unwrap(),
},
})
}
Expand All @@ -210,7 +210,12 @@ impl Jnv {
}

fn query_to_clipboard(&mut self) {
let query = self.filter_editor.after().texteditor.text_without_cursor().to_string();
let query = self
.filter_editor
.after()
.texteditor
.text_without_cursor()
.to_string();
let _ = self.clipboard.set_contents(query);

let clipboard_hint = String::from("Copied jq query to clipboard!");
Expand All @@ -221,7 +226,6 @@ impl Jnv {

self.update_hint_message(clipboard_hint, style);
}

}

impl promkit::Finalizer for Jnv {
Expand Down
4 changes: 3 additions & 1 deletion src/jnv/keymap.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use promkit::{
crossterm::event::{Event, KeyCode, KeyEvent, KeyEventKind, KeyEventState, KeyModifiers}, listbox::Listbox, text_editor, PromptSignal
crossterm::event::{Event, KeyCode, KeyEvent, KeyEventKind, KeyEventState, KeyModifiers},
listbox::Listbox,
text_editor, PromptSignal,
};

pub type Keymap = fn(&Event, &mut crate::jnv::Jnv) -> anyhow::Result<PromptSignal>;
Expand Down

0 comments on commit 2d774d3

Please sign in to comment.