From de2cf2e8cd953dbede6ba6ecfa92c11bcc495153 Mon Sep 17 00:00:00 2001 From: blacknon Date: Sun, 9 Jun 2024 19:54:32 +0900 Subject: [PATCH 01/13] update. version 0.3.15 init --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/keymap.rs | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f9eeed9..0dec9e5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -921,7 +921,7 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hwatch" -version = "0.3.14" +version = "0.3.15" dependencies = [ "ansi-parser", "ansi_term", diff --git a/Cargo.toml b/Cargo.toml index b83b5a8..3e7d1b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ keywords = ["watch", "command", "monitoring"] license-file = "LICENSE" name = "hwatch" repository = "https://github.com/blacknon/hwatch" -version = "0.3.14" +version = "0.3.15" [dependencies] ansi-parser = "0.9.0" diff --git a/src/keymap.rs b/src/keymap.rs index 169dc91..7204295 100644 --- a/src/keymap.rs +++ b/src/keymap.rs @@ -203,6 +203,7 @@ impl<'de> Deserialize<'de> for Key { "plus" => KeyCode::Char('+'), "minus" => KeyCode::Char('-'), "hyphen" => KeyCode::Char('-'), + "equal" => KeyCode::Char('='), "tab" => KeyCode::Tab, c if c.len() == 1 => KeyCode::Char(c.chars().next().unwrap()), _ => { From 79ee019aa1e43ec8bf0fc4d5489ee2d2e24819a0 Mon Sep 17 00:00:00 2001 From: blacknon Date: Tue, 11 Jun 2024 23:52:30 +0900 Subject: [PATCH 02/13] update. --- README.md | 8 -------- src/main.rs | 9 +++++---- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index e275f27..4a53ed5 100644 --- a/README.md +++ b/README.md @@ -229,10 +229,6 @@ hwatch -n 3 -s 'bash -c "source ~/.bashrc"; {COMMAND}' command... hwatch -n 3 -s 'zsh -c "source ~/.zshrc"; {COMMAND}' command... ``` -

- -

- ### ANSI Color code If you want to see output colored with ANSI color code, enable color mode. @@ -244,10 +240,6 @@ Alternatively, you can enable / disable the color mode with the C key hwatch -n 3 -c command... ``` -

- -

- ### diff view To enable color mode, run hwatch with the `-d` option. diff --git a/src/main.rs b/src/main.rs index e5cc461..41b3ec5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,7 @@ // Use of this source code is governed by an MIT license // that can be found in the LICENSE file. -// v0.3.15 +// v0.3.16 // TODO(blacknon): Enterキーでfilter modeのキーワード移動をできるようにする // TODO(blacknon): filter modeのハイライト表示をどのoutput modeでもできるようにする(とりあえずcolor mode enable時はansi codeをパース前にいじる感じにすれば良さそう?) // TODO(blacknon): filter modeのハイライト表示の色を環境変数で定義できるようにする @@ -12,12 +12,13 @@ // TODO(blacknon): diff modeをさらに複数用意し、選択・切り替えできるdiffをオプションから指定できるようにする(watchをold-watchにして、モダンなwatchをデフォルトにしたり) // TODO(blacknon): Windowsのバイナリをパッケージマネジメントシステムでインストール可能になるよう、Releaseでうまいこと処理をする // TODO(blacknon): watchウィンドウの表示を折り返しだけではなく、横方向にスクロールして出力するモードも追加する -// TODO(blacknon): UTF-8以外のエンコードでも動作するよう対応する - -// v0.3.16 +// TODO(blacknon): UTF-8以外のエンコードでも動作するよう対応する(エンコード対応) // TODO(blacknon): https://github.com/blacknon/hwatch/issues/101 // - ログを読み込ませて、そのまま続きの処理を行わせる機能の追加 +// v0.3.17 +// TODO(blacknon): ... + // v1.0.0 // TODO(blacknon): vimのように内部コマンドを利用した表示切り替え・出力結果の編集機能を追加する // TODO(blacknon): 任意時点間のdiffが行えるようにする. From 9ac5ee446309777a5cfc413f97d83226932fc174 Mon Sep 17 00:00:00 2001 From: blacknon Date: Wed, 12 Jun 2024 15:52:07 +0900 Subject: [PATCH 03/13] update. bugfix #129 --- src/app.rs | 22 ++++++++++------------ src/event.rs | 2 +- src/main.rs | 4 ++++ src/view.rs | 14 +++++++++----- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/app.rs b/src/app.rs index 1c1b8d1..2f3e3df 100644 --- a/src/app.rs +++ b/src/app.rs @@ -2,7 +2,7 @@ // Use of this source code is governed by an MIT license // that can be found in the LICENSE file. -// TODO: historyの一個前、をdiffで取れるようにする(今は問答無用でVecの1個前のデータを取得しているから、ちょっと違う方法を取る) +// TODO: historyの一個前、をdiffで取れるようにする(今は問答無用でVecの1個前のデータを取得しているから、ちょっと違う方法を取る?) // module use crossbeam_channel::{Receiver, Sender}; @@ -203,7 +203,6 @@ impl<'a> App<'a> { tx: Sender, rx: Receiver, interval: Interval, - mouse_events: bool, ) -> Self { // method at create new view trail. Self { @@ -249,7 +248,7 @@ impl<'a> App<'a> { help_window: HelpWindow::new(default_keymap()), exit_window: ExitWindow::new(), - mouse_events, + mouse_events: false, printer: output::Printer::new(), @@ -311,14 +310,12 @@ impl<'a> App<'a> { } // - Ok(AppEvent::ToggleMouseEvents) => { + Ok(AppEvent::ChangeFlagMouseEvent) => { if self.mouse_events { execute!(terminal.backend_mut(), DisableMouseCapture)?; } else { execute!(terminal.backend_mut(), EnableMouseCapture)?; } - - self.mouse_events = !self.mouse_events; } // get exit event @@ -603,6 +600,12 @@ impl<'a> App<'a> { self.header_area.update(); } + /// + pub fn set_mouse_events(&mut self, mouse_events: bool) { + self.mouse_events = mouse_events; + self.tx.send(AppEvent::ChangeFlagMouseEvent).unwrap(); + } + /// fn increase_interval(&mut self) { let cur_interval = *self.interval.read().unwrap(); @@ -1036,7 +1039,7 @@ impl<'a> App<'a> { InputAction::ToggleColor => self.set_ansi_color(!self.ansi_color), // ToggleColor InputAction::ToggleLineNumber => self.set_line_number(!self.line_number), // ToggleLineNumber InputAction::ToggleReverse => self.set_reverse(!self.reverse), // ToggleReverse - InputAction::ToggleMouseSupport => self.toggle_mouse_events(), // ToggleMouseSupport + InputAction::ToggleMouseSupport => self.set_mouse_events(!self.mouse_events), // ToggleMouseSupport InputAction::ToggleViewPaneUI => self.show_ui(!self.show_header), // ToggleViewPaneUI InputAction::ToggleViewHistoryPane => self.show_history(!self.show_history), // ToggleViewHistory InputAction::ToggleBorder => self.set_border(!self.is_border), // ToggleBorder @@ -1273,11 +1276,6 @@ impl<'a> App<'a> { } } - /// - pub fn toggle_mouse_events(&mut self) { - let _ = self.tx.send(AppEvent::ToggleMouseEvents); - } - /// pub fn show_ui(&mut self, visible: bool) { self.show_header = visible; diff --git a/src/event.rs b/src/event.rs index 9d2357c..e60d92d 100644 --- a/src/event.rs +++ b/src/event.rs @@ -8,6 +8,6 @@ pub enum AppEvent { OutputUpdate(CommandResult), TerminalEvent(crossterm::event::Event), Redraw, - ToggleMouseEvents, + ChangeFlagMouseEvent, Exit, } diff --git a/src/main.rs b/src/main.rs index 41b3ec5..c48c2d3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,6 +2,10 @@ // Use of this source code is governed by an MIT license // that can be found in the LICENSE file. +// v0.3.15 +// TODO(blacknon): line/word diffでansi対応がうまくいかなくなっちゃったので、修正する +// TODO(blacknon): mouse flagがうまく動かないので、修正する + // v0.3.16 // TODO(blacknon): Enterキーでfilter modeのキーワード移動をできるようにする // TODO(blacknon): filter modeのハイライト表示をどのoutput modeでもできるようにする(とりあえずcolor mode enable時はansi codeをパース前にいじる感じにすれば良さそう?) diff --git a/src/view.rs b/src/view.rs index fe45136..3d22fab 100644 --- a/src/view.rs +++ b/src/view.rs @@ -5,7 +5,7 @@ use crossbeam_channel::{Receiver, Sender}; // module use crossterm::{ - event::{DisableMouseCapture, EnableMouseCapture}, + event::{DisableMouseCapture}, execute, terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, }; @@ -180,9 +180,9 @@ impl View { enable_raw_mode()?; let mut stdout = io::stdout(); execute!(stdout, EnterAlternateScreen)?; - if self.mouse_events { - execute!(stdout, EnableMouseCapture)?; - } + // if self.mouse_events { + // execute!(stdout, EnableMouseCapture)?; + // } let backend = CrosstermBackend::new(stdout); let mut terminal = Terminal::new(backend)?; let _ = terminal.clear(); @@ -195,7 +195,7 @@ impl View { } // Create App - let mut app = App::new(tx, rx, self.interval.clone(), self.mouse_events); + let mut app = App::new(tx, rx, self.interval.clone()); // set keymap app.set_keymap(self.keymap.clone()); @@ -203,6 +203,9 @@ impl View { // set after command app.set_after_command(self.after_command.clone()); + // set mouse events + app.set_mouse_events(self.mouse_events); + // set limit app.set_limit(self.limit); @@ -257,6 +260,7 @@ fn restore_terminal() { Ok(t) => t, _ => return, }; + let _ = execute!( terminal.backend_mut(), LeaveAlternateScreen, From 0af56608d80d16eff5a49963081cbafec1da0246 Mon Sep 17 00:00:00 2001 From: blacknon Date: Wed, 12 Jun 2024 23:47:49 +0900 Subject: [PATCH 04/13] update. #128 --- src/app.rs | 4 ++++ src/keymap.rs | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/app.rs b/src/app.rs index 1c1b8d1..c8f9983 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1041,6 +1041,10 @@ impl<'a> App<'a> { InputAction::ToggleViewHistoryPane => self.show_history(!self.show_history), // ToggleViewHistory InputAction::ToggleBorder => self.set_border(!self.is_border), // ToggleBorder InputAction::ToggleScrollBar => self.set_scroll_bar(!self.is_scroll_bar), // ToggleScrollBar + InputAction::ToggleBorderWithScrollBar => { + self.set_border(!self.is_border); + self.set_scroll_bar(!self.is_scroll_bar); + }, // ToggleBorderWithScrollBar InputAction::ToggleDiffMode => self.toggle_diff_mode(), // ToggleDiffMode InputAction::SetDiffModePlane => self.set_diff_mode(DiffMode::Disable), // SetDiffModePlane InputAction::SetDiffModeWatch => self.set_diff_mode(DiffMode::Watch), // SetDiffModeWatch diff --git a/src/keymap.rs b/src/keymap.rs index 7204295..59d1aff 100644 --- a/src/keymap.rs +++ b/src/keymap.rs @@ -34,7 +34,7 @@ impl Key { } } -const DEFAULT_KEYMAP: [&str; 36] = [ +const DEFAULT_KEYMAP: [&str; 35] = [ "up=up", // Up "down=down", // Down "pageup=page_up", // PageUp @@ -48,8 +48,7 @@ const DEFAULT_KEYMAP: [&str; 36] = [ "esc=reset", // Reset: ESC "ctrl-c=cancel", // Cancel: Ctrl + c "h=help", // Help: h - "b=toggle_border", // Toggle Border: b - "s=toggle_scroll_bar", // Toggle Scroll Bar: s + "b=toggle_border_with_scroll_bar", // Toggle Border: b "c=toggle_color", // Toggle Color: c "n=toggle_line_number", // Toggle Line Number: n "r=toggle_reverse", // Toggle Reverse: r @@ -404,6 +403,8 @@ pub enum InputAction { ToggleBorder, #[serde(rename = "toggle_scroll_bar")] ToggleScrollBar, + #[serde(rename = "toggle_border_with_scroll_bar")] + ToggleBorderWithScrollBar, // Diff Mode // ========== @@ -522,6 +523,7 @@ pub fn get_input_action_description(input_action: InputAction) -> String { // Border InputAction::ToggleBorder => "Toggle enable/disable border".to_string(), InputAction::ToggleScrollBar => "Toggle enable/disable scroll bar".to_string(), + InputAction::ToggleBorderWithScrollBar => "Toggle enable/disable border and scroll bar".to_string(), // Diff Mode InputAction::ToggleDiffMode => "Toggle diff mode".to_string(), From 41172cbba370dea30d63f7793841b877ad807e14 Mon Sep 17 00:00:00 2001 From: blacknon Date: Fri, 14 Jun 2024 16:09:34 +0900 Subject: [PATCH 05/13] update. #129. tested tmux. --- Cargo.lock | 920 ++++++++++++++++++++++++++++++---------------------- src/app.rs | 127 +++++--- src/view.rs | 17 +- 3 files changed, 624 insertions(+), 440 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0dec9e5..603c739 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -22,18 +22,18 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "android-tzdata" @@ -71,47 +71,48 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -119,76 +120,118 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.80" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "async-channel" -version = "1.6.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", - "event-listener", + "event-listener 2.5.3", "futures-core", ] +[[package]] +name = "async-channel" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + [[package]] name = "async-executor" -version = "1.4.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" +checksum = "c8828ec6e544c02b0d6691d21ed9f9218d0384a82542855073c2a3f58304aaf0" dependencies = [ "async-task", "concurrent-queue", - "fastrand 1.7.0", - "futures-lite", - "once_cell", + "fastrand 2.1.0", + "futures-lite 2.3.0", "slab", ] [[package]] name = "async-global-executor" -version = "2.1.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd8b508d585e01084059b60f06ade4cb7415cd2e4084b71dd1cb44e7d3fb9880" +checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ - "async-channel", + "async-channel 2.3.1", "async-executor", - "async-io", - "async-lock", + "async-io 2.3.3", + "async-lock 3.4.0", "blocking", - "futures-lite", + "futures-lite 2.3.0", "once_cell", ] [[package]] name = "async-io" -version = "1.7.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5e18f61464ae81cde0a23e713ae8fd299580c54d697a35820cfd0625b8b0e07" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ + "async-lock 2.8.0", + "autocfg", + "cfg-if", "concurrent-queue", - "futures-lite", - "libc", + "futures-lite 1.13.0", "log", - "once_cell", "parking", - "polling", + "polling 2.8.0", + "rustix 0.37.27", "slab", "socket2", "waker-fn", - "winapi", +] + +[[package]] +name = "async-io" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" +dependencies = [ + "async-lock 3.4.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.3.0", + "parking", + "polling 3.7.1", + "rustix 0.38.34", + "slab", + "tracing", + "windows-sys 0.52.0", ] [[package]] name = "async-lock" -version = "2.5.0" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener", + "event-listener 5.3.1", + "event-listener-strategy", + "pin-project-lite", ] [[package]] @@ -197,15 +240,15 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" dependencies = [ - "async-channel", + "async-channel 1.9.0", "async-global-executor", - "async-io", - "async-lock", + "async-io 1.13.0", + "async-lock 2.8.0", "crossbeam-utils", "futures-channel", "futures-core", "futures-io", - "futures-lite", + "futures-lite 1.13.0", "gloo-timers", "kv-log-macro", "log", @@ -219,9 +262,9 @@ dependencies = [ [[package]] name = "async-task" -version = "4.2.0" +version = "4.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30696a84d817107fc028e049980e09d5e140e8da8f1caeb17e8e950658a3cea9" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "atomic" @@ -231,15 +274,15 @@ checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" [[package]] name = "atomic-waker" -version = "1.0.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "base64" @@ -270,9 +313,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "block-buffer" @@ -285,16 +328,15 @@ dependencies = [ [[package]] name = "blocking" -version = "1.2.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6ccb65d468978a086b69884437ded69a90faab3bbe6e67f242173ea728acccc" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ - "async-channel", + "async-channel 2.3.1", "async-task", - "atomic-waker", - "fastrand 1.7.0", - "futures-lite", - "once_cell", + "futures-io", + "futures-lite 2.3.0", + "piper", ] [[package]] @@ -310,21 +352,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.10.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "cache-padded" -version = "1.2.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cassowary" @@ -343,9 +379,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.97" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" +checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" [[package]] name = "cfg-if" @@ -353,6 +389,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "chardetng" version = "0.1.17" @@ -366,50 +408,50 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.34" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-targets", + "windows-targets 0.52.5", ] [[package]] name = "clap" -version = "4.5.4" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.0", + "strsim 0.11.1", ] [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "compact_str" @@ -426,11 +468,11 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "1.2.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ - "cache-padded", + "crossbeam-utils", ] [[package]] @@ -492,18 +534,18 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crossterm" @@ -511,7 +553,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "crossterm_winapi", "libc", "mio", @@ -556,23 +598,13 @@ dependencies = [ "phf", ] -[[package]] -name = "ctor" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c" -dependencies = [ - "quote", - "syn 1.0.96", -] - [[package]] name = "ctrlc" -version = "3.4.2" +version = "3.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b467862cc8610ca6fc9a1532d7777cee0804e678ab45410897b9396495994a0b" +checksum = "672465ae37dc1bc6380a6547a8883d5dd397b0f1faaad4f265726cc7042a5345" dependencies = [ - "nix 0.27.1", + "nix 0.28.0", "windows-sys 0.52.0", ] @@ -623,9 +655,9 @@ dependencies = [ [[package]] name = "either" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "encoding_rs" @@ -638,9 +670,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -658,18 +690,39 @@ dependencies = [ [[package]] name = "euclid" -version = "0.22.9" +version = "0.22.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f253bc5c813ca05792837a0ff4b3a580336b224512d48f7eda1d7dd9210787" +checksum = "e0f0eb73b934648cd7a4a61f1b15391cd95dab0b4da6e2e66c2a072c144b4a20" dependencies = [ "num-traits", ] [[package]] name = "event-listener" -version = "2.5.2" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "5.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +dependencies = [ + "event-listener 5.3.1", + "pin-project-lite", +] [[package]] name = "fancy-regex" @@ -683,18 +736,18 @@ dependencies = [ [[package]] name = "fastrand" -version = "1.7.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" dependencies = [ "instant", ] [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "filedescriptor" @@ -785,11 +838,11 @@ checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ - "fastrand 1.7.0", + "fastrand 1.9.0", "futures-core", "futures-io", "memchr", @@ -798,6 +851,19 @@ dependencies = [ "waker-fn", ] +[[package]] +name = "futures-lite" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +dependencies = [ + "fastrand 2.1.0", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + [[package]] name = "futures-macro" version = "0.3.30" @@ -806,7 +872,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.66", ] [[package]] @@ -841,9 +907,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.5" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -851,9 +917,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -862,9 +928,9 @@ dependencies = [ [[package]] name = "gloo-timers" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb7d06c1c8cc2a29bee7ec961009a0b2caa0793ee4900c2ffb348734ba1c8f9" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" dependencies = [ "futures-channel", "futures-core", @@ -889,9 +955,9 @@ checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", @@ -909,9 +975,15 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -973,20 +1045,31 @@ dependencies = [ ] [[package]] -name = "indoc" -version = "2.0.4" +name = "instant" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", +] [[package]] -name = "instant" -version = "0.1.12" +name = "io-lifetimes" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "cfg-if", + "hermit-abi", + "libc", + "windows-sys 0.48.0", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.12.1" @@ -998,15 +1081,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.2" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.57" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -1034,32 +1117,37 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libredox" -version = "0.0.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "libc", - "redox_syscall 0.4.1", ] [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.7" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -1067,11 +1155,10 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" dependencies = [ - "cfg-if", "value-bag", ] @@ -1081,24 +1168,24 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] name = "mac_address" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4863ee94f19ed315bf3bc00299338d857d4b5bc856af375cc97d237382ad3856" +checksum = "8836fae9d0d4be2c8b4efcdd79e828a2faa058a90d005abf42f91cac5493a08e" dependencies = [ - "nix 0.23.2", + "nix 0.28.0", "winapi", ] [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memmem" @@ -1108,18 +1195,18 @@ checksum = "a64a92489e2744ce060c349162be1c5f33c6969234104dbd99ddb5feb08b8c15" [[package]] name = "memoffset" -version = "0.6.5" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" dependencies = [ "autocfg", ] [[package]] name = "memoffset" -version = "0.7.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ "autocfg", ] @@ -1141,27 +1228,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.3" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713d550d9b44d89174e066b7a6217ae06234c10cb47819a88290d2b353c31799" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", "wasi", - "windows-sys 0.36.1", -] - -[[package]] -name = "nix" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c" -dependencies = [ - "bitflags 1.3.2", - "cc", - "cfg-if", - "libc", - "memoffset 0.6.5", + "windows-sys 0.48.0", ] [[package]] @@ -1179,13 +1253,15 @@ dependencies = [ [[package]] name = "nix" -version = "0.27.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "cfg-if", + "cfg_aliases", "libc", + "memoffset 0.9.1", ] [[package]] @@ -1206,14 +1282,14 @@ checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ "proc-macro2", "quote", - "syn 1.0.96", + "syn 1.0.109", ] [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -1245,15 +1321,15 @@ dependencies = [ [[package]] name = "parking" -version = "2.0.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -1261,22 +1337,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.3" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.13", + "redox_syscall", "smallvec", - "windows-sys 0.36.1", + "windows-targets 0.52.5", ] [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pathdiff" @@ -1286,9 +1362,9 @@ checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" [[package]] name = "pest" -version = "2.7.8" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f8023d0fb78c8e03784ea1c7f3fa36e68a723138990b8d5a47d916b651e7a8" +checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" dependencies = [ "memchr", "thiserror", @@ -1297,9 +1373,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.8" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0d24f72393fd16ab6ac5738bc33cdb6a9aa73f8b902e8fe29cf4e67d7dd1026" +checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459" dependencies = [ "pest", "pest_generator", @@ -1307,22 +1383,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.8" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc17e2a6c7d0a492f0158d7a4bd66cc17280308bbaff78d5bef566dca35ab80" +checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.66", ] [[package]] name = "pest_meta" -version = "2.7.8" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "934cd7631c050f4674352a6e835d5f6711ffbfb9345c2fc0107155ac495ae293" +checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd" dependencies = [ "once_cell", "pest", @@ -1369,7 +1445,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.66", ] [[package]] @@ -1383,9 +1459,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -1393,24 +1469,53 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" +dependencies = [ + "atomic-waker", + "fastrand 2.1.0", + "futures-io", +] + [[package]] name = "polling" -version = "2.2.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685404d509889fade3e86fe3a5803bca2ec09b0c0778d5ada6ec8bf7a8de5259" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ + "autocfg", + "bitflags 1.3.2", "cfg-if", + "concurrent-queue", "libc", "log", - "wepoll-ffi", - "winapi", + "pin-project-lite", + "windows-sys 0.48.0", +] + +[[package]] +name = "polling" +version = "3.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6a007746f34ed64099e88783b0ae369eaa3da6392868ba262e2af9b8fbaea1" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi", + "pin-project-lite", + "rustix 0.38.34", + "tracing", + "windows-sys 0.52.0", ] [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" dependencies = [ "unicode-ident", ] @@ -1423,9 +1528,9 @@ checksum = "acbb3ede7a8f9a8ab89e714637f2cf40001b58f21340d4242b2f11533e65fa8d" [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1447,47 +1552,38 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "ratatui" -version = "0.26.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcb12f8fbf6c62614b0d56eb352af54f6a22410c3b079eb53ee93c7b97dd31d8" +checksum = "f44c9e68fd46eda15c646fbb85e1040b657a58cdc8c98db1d97a55930d991eef" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "cassowary", "compact_str", "crossterm", - "indoc", "itertools", "lru", "paste", "stability", "strum", "unicode-segmentation", + "unicode-truncate", "unicode-width", ] [[package]] name = "redox_syscall" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", ] [[package]] name = "redox_users" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", "libredox", @@ -1496,13 +1592,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.3" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", + "regex-automata 0.4.7", "regex-syntax", ] @@ -1514,9 +1610,9 @@ checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", @@ -1525,9 +1621,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rust-ini" @@ -1550,34 +1646,48 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.31" +version = "0.37.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "errno", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.14", "windows-sys 0.52.0", ] [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ryu" -version = "1.0.10" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" @@ -1605,29 +1715,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.197" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.66", ] [[package]] name = "serde_json" -version = "1.0.114" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -1674,9 +1784,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -1700,21 +1810,24 @@ checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.6" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] [[package]] name = "smallvec" -version = "1.8.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.4.4" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -1722,12 +1835,12 @@ dependencies = [ [[package]] name = "stability" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd1b177894da2a2d9120208c3386066af06a488255caabc5de8ddca22dbc3ce" +checksum = "2ff9eaf853dec4c8802325d8b6d3dffa86cc707fd7a1a4cdbf416e13b061787a" dependencies = [ "quote", - "syn 1.0.96", + "syn 2.0.66", ] [[package]] @@ -1750,37 +1863,37 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strsim" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "723b93e8addf9aa965ebe2d11da6d7540fa2283fcea14b3371ff055f7ba13f5f" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.26.1" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3417fc93d76740d974a01654a09777cb500428cc874ca9f45edfe0c4d4cd18" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ "heck", "proc-macro2", "quote", "rustversion", - "syn 2.0.52", + "syn 2.0.66", ] [[package]] name = "syn" -version = "1.0.96" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", @@ -1789,9 +1902,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.52" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -1805,8 +1918,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "fastrand 2.0.1", - "rustix", + "fastrand 2.1.0", + "rustix 0.38.34", "windows-sys 0.52.0", ] @@ -1840,7 +1953,7 @@ checksum = "5a75313e21da5d4406ea31402035b3b97aa74c04356bdfafa5d1043ab4e551d1" dependencies = [ "anyhow", "base64", - "bitflags 2.4.2", + "bitflags 2.5.0", "fancy-regex", "filedescriptor", "finl_unicode", @@ -1878,22 +1991,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.66", ] [[package]] @@ -1905,11 +2018,27 @@ dependencies = [ "crunchy", ] +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" + [[package]] name = "typenum" -version = "1.15.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" @@ -1919,33 +2048,43 @@ checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" [[package]] name = "unicode-ident" -version = "1.0.0" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-segmentation" -version = "1.10.1" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" + +[[package]] +name = "unicode-truncate" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "5a5fbabedabe362c618c714dbefda9927b5afc8e2a8102f47f081089a9019226" +dependencies = [ + "itertools", + "unicode-width", +] [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ "atomic", "getrandom", @@ -1953,13 +2092,9 @@ dependencies = [ [[package]] name = "value-bag" -version = "1.0.0-alpha.9" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55" -dependencies = [ - "ctor", - "version_check", -] +checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" [[package]] name = "version_check" @@ -1978,9 +2113,9 @@ dependencies = [ [[package]] name = "waker-fn" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" [[package]] name = "wasi" @@ -1990,9 +2125,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.80" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2000,24 +2135,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.80" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", - "syn 1.0.96", + "syn 2.0.66", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.30" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f741de44b75e14c35df886aff5f1eb73aa114fa5d4d00dcd37b5e01259bf3b2" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -2027,9 +2162,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.80" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2037,42 +2172,33 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.80" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 1.0.96", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.80" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.57" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", ] -[[package]] -name = "wepoll-ffi" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" -dependencies = [ - "cc", -] - [[package]] name = "wezterm-bidi" version = "0.2.3" @@ -2130,7 +2256,7 @@ checksum = "0c9f5ef318442d07b3d071f9f43ea40b80992f87faee14bb4d017b6991c307f0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.96", + "syn 1.0.109", ] [[package]] @@ -2173,20 +2299,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets", + "windows-targets 0.52.5", ] [[package]] name = "windows-sys" -version = "0.36.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", + "windows-targets 0.48.5", ] [[package]] @@ -2195,112 +2317,146 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets", + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" -version = "0.36.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" -version = "0.36.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" -version = "0.36.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" -version = "0.36.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" -version = "0.36.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.66", ] diff --git a/src/app.rs b/src/app.rs index 2f3e3df..d86f867 100644 --- a/src/app.rs +++ b/src/app.rs @@ -8,7 +8,7 @@ use crossbeam_channel::{Receiver, Sender}; use crossterm::{ event::{ - DisableMouseCapture, EnableMouseCapture, Event, KeyCode, KeyEventKind, MouseButton, MouseEvent, MouseEventKind + DisableMouseCapture, EnableMouseCapture, Event, KeyCode, KeyEventKind, MouseButton, MouseEvent, MouseEventKind, }, execute, }; @@ -312,9 +312,9 @@ impl<'a> App<'a> { // Ok(AppEvent::ChangeFlagMouseEvent) => { if self.mouse_events { - execute!(terminal.backend_mut(), DisableMouseCapture)?; - } else { execute!(terminal.backend_mut(), EnableMouseCapture)?; + } else { + execute!(terminal.backend_mut(), DisableMouseCapture)?; } } @@ -972,31 +972,75 @@ impl<'a> App<'a> { /// fn get_normal_input_key(&mut self, terminal_event: crossterm::event::Event) { // if exit window - if self.window == ActiveWindow::Exit { - // match key event - match terminal_event { - Event::Key(key) => { - if key.kind == KeyEventKind::Press { - match key.code { - KeyCode::Char('y') => { - self.exit(); - return; - }, - KeyCode::Char('n') => { - self.window = ActiveWindow::Normal; - return; - }, - KeyCode::Char('h') => { - self.window = ActiveWindow::Help; - return; - }, - // default - _ => {} + match self.window { + ActiveWindow::Exit => { + // match key event + match terminal_event { + Event::Key(key) => { + if key.kind == KeyEventKind::Press { + match key.code { + KeyCode::Char('y') => { + self.exit(); + return; + }, + KeyCode::Char('n') => { + self.window = ActiveWindow::Normal; + return; + }, + KeyCode::Char('h') => { + self.window = ActiveWindow::Help; + return; + }, + // default + _ => {} + } } + }, + _ => {}, + } + }, + ActiveWindow::Help => { + if let Event::Mouse(mouse) = terminal_event { + match mouse.kind { + MouseEventKind::ScrollUp => { + self.mouse_scroll_up(); + return; + }, + MouseEventKind::ScrollDown => { + self.mouse_scroll_down(); + return; + }, + + MouseEventKind::Down(MouseButton::Left) => { + self.mouse_click_left(mouse.column, mouse.row); + return; + }, + // default + _ => {} } - }, - _ => {}, - } + } + }, + ActiveWindow::Normal => { + if let Event::Mouse(mouse) = terminal_event { + match mouse.kind { + MouseEventKind::ScrollUp => { + self.mouse_scroll_up(); + return; + }, + MouseEventKind::ScrollDown => { + self.mouse_scroll_down(); + return; + }, + + MouseEventKind::Down(MouseButton::Left) => { + self.mouse_click_left(mouse.column, mouse.row); + return; + }, + // default + _ => {} + } + } + }, } if let Some(event_content) = self.keymap.get(&terminal_event) { @@ -1063,29 +1107,6 @@ impl<'a> App<'a> { // default _ => {} } - - // match mouse event - match terminal_event { - Event::Mouse(MouseEvent { - kind: MouseEventKind::ScrollUp, - .. - }) => self.mouse_scroll_up(), - - Event::Mouse(MouseEvent { - kind: MouseEventKind::ScrollDown, - .. - }) => self.mouse_scroll_down(), - - Event::Mouse(MouseEvent { - kind: MouseEventKind::Down(MouseButton::Left), - column, row, - .. - }) => self.mouse_click_left(column, row), - - // default - _ => {} - } - } ActiveWindow::Help => { match action { @@ -1621,7 +1642,9 @@ impl<'a> App<'a> { ActiveWindow::Help => { self.help_window.scroll_down(2); }, - _ => {}, + ActiveWindow::Exit => { + println!("exit"); + }, } } @@ -1642,7 +1665,9 @@ impl<'a> App<'a> { ActiveWindow::Help => { self.help_window.scroll_down(2); }, - _ => {}, + ActiveWindow::Exit => { + println!("exit"); + }, } } diff --git a/src/view.rs b/src/view.rs index 3d22fab..8486577 100644 --- a/src/view.rs +++ b/src/view.rs @@ -2,10 +2,11 @@ // Use of this source code is governed by an MIT license // that can be found in the LICENSE file. -use crossbeam_channel::{Receiver, Sender}; // module +use crossbeam_channel::{Receiver, Sender}; +use std::time::Duration; use crossterm::{ - event::{DisableMouseCapture}, + event::{DisableMouseCapture, EnableMouseCapture}, execute, terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, }; @@ -177,12 +178,12 @@ impl View { // Exit code for SIGTERM (signal 15), not quite right if another signal is the cause. std::process::exit(128 + 15) })?; + enable_raw_mode()?; + let mut stdout = io::stdout(); execute!(stdout, EnterAlternateScreen)?; - // if self.mouse_events { - // execute!(stdout, EnableMouseCapture)?; - // } + let backend = CrosstermBackend::new(stdout); let mut terminal = Terminal::new(backend)?; let _ = terminal.clear(); @@ -270,7 +271,9 @@ fn restore_terminal() { } fn send_input(tx: Sender) -> io::Result<()> { - let event = crossterm::event::read().expect("failed to read crossterm event"); - let _ = tx.send(AppEvent::TerminalEvent(event)); + if crossterm::event::poll(Duration::from_millis(100))? { + let event = crossterm::event::read()?; + let _ = tx.send(AppEvent::TerminalEvent(event)); + } Ok(()) } From 1cfbbad59129fb4ad51d35c9f96b4732f60c8e2c Mon Sep 17 00:00:00 2001 From: blacknon Date: Sun, 16 Jun 2024 22:13:33 +0900 Subject: [PATCH 06/13] update. #129. For now, I can specify the mouse operations using the keymap. Refactor required. --- src/app.rs | 166 +++++++++++++++++------------ src/help.rs | 2 +- src/keymap.rs | 285 ++++++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 347 insertions(+), 106 deletions(-) diff --git a/src/app.rs b/src/app.rs index d86f867..da4e0a2 100644 --- a/src/app.rs +++ b/src/app.rs @@ -8,10 +8,11 @@ use crossbeam_channel::{Receiver, Sender}; use crossterm::{ event::{ - DisableMouseCapture, EnableMouseCapture, Event, KeyCode, KeyEventKind, MouseButton, MouseEvent, MouseEventKind, + DisableMouseCapture, EnableMouseCapture, Event, KeyCode, KeyEventKind, MouseButton, MouseEventKind, MouseEvent, KeyModifiers, }, execute, }; +use heapless::binary_heap::Kind; use regex::Regex; use std::{ collections::HashMap, @@ -26,7 +27,7 @@ use tui::{ use std::thread; // local module -use crate::common::{logging_result, DiffMode, OutputMode}; +use crate::{common::{logging_result, DiffMode, OutputMode}, keymap::InputEventContents}; use crate::event::AppEvent; use crate::exec::{exec_after_command, CommandResult}; use crate::exit::ExitWindow; @@ -423,6 +424,28 @@ impl<'a> App<'a> { } } + /// + fn get_input_action(&self, terminal_event: &crossterm::event::Event) -> Option<&InputEventContents> { + match terminal_event { + &Event::Key(_) => { + return self.keymap.get(terminal_event); + }, + &Event::Mouse(mouse) => { + let mouse_event = MouseEvent { + kind: mouse.kind, + column: 0, + row: 0, + modifiers: KeyModifiers::empty(), + }; + return self.keymap.get(&Event::Mouse(mouse_event)); + + }, + _ => { + return None; + } + } + } + /// Set the history to be output to WatchArea. fn set_output_data(&mut self, num: usize) { // Switch the result depending on the output mode. @@ -999,51 +1022,10 @@ impl<'a> App<'a> { _ => {}, } }, - ActiveWindow::Help => { - if let Event::Mouse(mouse) = terminal_event { - match mouse.kind { - MouseEventKind::ScrollUp => { - self.mouse_scroll_up(); - return; - }, - MouseEventKind::ScrollDown => { - self.mouse_scroll_down(); - return; - }, - - MouseEventKind::Down(MouseButton::Left) => { - self.mouse_click_left(mouse.column, mouse.row); - return; - }, - // default - _ => {} - } - } - }, - ActiveWindow::Normal => { - if let Event::Mouse(mouse) = terminal_event { - match mouse.kind { - MouseEventKind::ScrollUp => { - self.mouse_scroll_up(); - return; - }, - MouseEventKind::ScrollDown => { - self.mouse_scroll_down(); - return; - }, - - MouseEventKind::Down(MouseButton::Left) => { - self.mouse_click_left(mouse.column, mouse.row); - return; - }, - // default - _ => {} - } - } - }, + _ => {}, } - if let Some(event_content) = self.keymap.get(&terminal_event) { + if let Some(event_content) = self.get_input_action(&terminal_event) { let action = event_content.action; match self.window { ActiveWindow::Normal => { @@ -1104,6 +1086,33 @@ impl<'a> App<'a> { InputAction::ChangeFilterMode => self.set_input_mode(InputMode::Filter), // Change Filter Mode(plane text). InputAction::ChangeRegexFilterMode => self.set_input_mode(InputMode::RegexFilter), // Change Filter Mode(regex text). + // MouseScrollDown + InputAction::MouseScrollDown => { + if let Event::Mouse(mouse) = terminal_event { + self.mouse_scroll_down(mouse.column, mouse.row) + } else { + self.mouse_scroll_down(0, 0) + } + }, + + // MouseScrollUp + InputAction::MouseScrollUp => { + if let Event::Mouse(mouse) = terminal_event { + self.mouse_scroll_up(mouse.column, mouse.row) + } else { + self.mouse_scroll_up(0, 0) + } + }, + + // MouseButtonLeft + InputAction::MouseButtonLeft => { + if let Event::Mouse(mouse) = terminal_event { + self.mouse_click_left(mouse.column, mouse.row) + } else { + self.mouse_click_left(0, 0) + } + }, + // default _ => {} } @@ -1618,7 +1627,6 @@ impl<'a> App<'a> { if is_history_area { let headline_count = self.history_area.area.y; self.history_area.click_row(row - headline_count); - // self.history_area.previous(1); let selected = self.history_area.get_state_select(); self.set_output_data(selected); @@ -1626,18 +1634,33 @@ impl<'a> App<'a> { } /// Mouse wheel always scroll up 2 lines. - fn mouse_scroll_up(&mut self) { + fn mouse_scroll_up(&mut self, column: u16, row: u16) { match self.window { - ActiveWindow::Normal => match self.area { - ActiveArea::Watch => { - self.watch_area.scroll_up(2); - }, - ActiveArea::History => { - self.history_area.next(2); + ActiveWindow::Normal => { + if column == 0 && row == 0 { + match self.area { + ActiveArea::Watch => { + self.watch_area.scroll_up(2); + }, + ActiveArea::History => { + self.history_area.next(2); - let selected = self.history_area.get_state_select(); - self.set_output_data(selected); + let selected = self.history_area.get_state_select(); + self.set_output_data(selected); + } + } + } else { + let is_history_area = check_in_area(self.history_area.area, column, row); + if is_history_area { + self.history_area.next(2); + + let selected = self.history_area.get_state_select(); + self.set_output_data(selected); + } else { + self.watch_area.scroll_up(2); + } } + }, ActiveWindow::Help => { self.help_window.scroll_down(2); @@ -1649,17 +1672,31 @@ impl<'a> App<'a> { } /// Mouse wheel always scroll down 2 lines. - fn mouse_scroll_down(&mut self) { + fn mouse_scroll_down(&mut self, column: u16, row: u16) { match self.window { - ActiveWindow::Normal => match self.area { - ActiveArea::Watch => { - self.watch_area.scroll_down(2); - }, - ActiveArea::History => { - self.history_area.previous(2); + ActiveWindow::Normal => { + if column == 0 && row == 0 { + match self.area { + ActiveArea::Watch => { + self.watch_area.scroll_down(2); + }, + ActiveArea::History => { + self.history_area.previous(2); - let selected = self.history_area.get_state_select(); - self.set_output_data(selected); + let selected = self.history_area.get_state_select(); + self.set_output_data(selected); + } + } + } else { + let is_history_area = check_in_area(self.history_area.area, column, row); + if is_history_area { + self.history_area.previous(2); + + let selected = self.history_area.get_state_select(); + self.set_output_data(selected); + } else { + self.watch_area.scroll_down(2); + } } }, ActiveWindow::Help => { @@ -1671,6 +1708,7 @@ impl<'a> App<'a> { } } + /// fn exit(&mut self) { self.tx.send(AppEvent::Exit) .expect("send error hwatch exit."); diff --git a/src/help.rs b/src/help.rs index d9b09cf..602f9f2 100644 --- a/src/help.rs +++ b/src/help.rs @@ -159,7 +159,7 @@ fn gen_help_text<'a>(keymap: Keymap) -> Vec> { let mut keydata_list = vec![]; for (_, input_event_content) in &keymap { - let key = input_event_content.key.to_str(); + let key = input_event_content.input.to_str(); let description = get_input_action_description(input_event_content.action); keydata_list.push(KeyData { key: key, description: description, action: input_event_content.action}); diff --git a/src/keymap.rs b/src/keymap.rs index 7204295..18da4dd 100644 --- a/src/keymap.rs +++ b/src/keymap.rs @@ -3,10 +3,10 @@ // that can be found in the LICENSE file. use std::{collections::HashMap, fmt::Debug}; -use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers, KeyEventKind, KeyEventState}; +use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers, KeyEventKind, KeyEventState, MouseEvent, MouseButton, MouseEventKind}; use serde::de::Error as DeError; use serde::ser::Error as SerError; -use serde::{Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de}; use config::{Config, ConfigError, FileFormat}; use crate::errors::HwatchError; @@ -17,24 +17,68 @@ pub struct Key { modifiers: KeyModifiers, } -impl Key { +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, PartialOrd)] +pub struct Mouse { + action: MouseEventKind, +} + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, PartialOrd)] +enum InputType { + Key(Key), + Mouse(Mouse), +} + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, PartialOrd)] +pub struct Input { + input: InputType +} + +impl Input { pub fn to_str(&self) -> String { - let modifiers = self - .modifiers - .iter() - .filter_map(modifier_to_string) - .collect::>() - .join("-"); - let code = keycode_to_string(self.code).unwrap(); - if modifiers.is_empty() { - code - } else { - format!("{}-{}", modifiers, code) - } + let result = match &self.input { + // keyboard + InputType::Key(key) => { + let modifiers = key + .modifiers + .iter() + .filter_map(modifier_to_string) + .collect::>() + .join("-"); + let code = keycode_to_string(key.code).unwrap(); + if modifiers.is_empty() { + code + } else { + format!("{}-{}", modifiers, code) + } + }, + + // mouse + InputType::Mouse(mouse) => { + let action = match mouse.action { + // MouseButton + MouseEventKind::Down(MouseButton::Left) => "button_down_left", + MouseEventKind::Down(MouseButton::Right) => "button_down_right", + MouseEventKind::Up(MouseButton::Left) => "button_up_left", + MouseEventKind::Up(MouseButton::Right) => "button_up_right", + + // MouseScroll + MouseEventKind::ScrollUp => "scroll_up", + MouseEventKind::ScrollDown => "scroll_down", + MouseEventKind::ScrollLeft => "scroll_left", + MouseEventKind::ScrollRight => "scroll_right", + + _ => "other", + }; + + format!("mouse-{}", action) + }, + }; + + return result } } -const DEFAULT_KEYMAP: [&str; 36] = [ +const DEFAULT_KEYMAP: [&str; 39] = [ "up=up", // Up "down=down", // Down "pageup=page_up", // PageUp @@ -71,8 +115,23 @@ const DEFAULT_KEYMAP: [&str; 36] = [ "minus=interval_minus", // Interval Minus: - "/=change_filter_mode", // Change Filter Mode: / "*=change_regex_filter_mode", // Change Regex Filter Mode: * + "mouse-scroll_up=mouse_scroll_up", // Mouse Scroll Up: Mouse Scroll Up + "mouse-scroll_down=mouse_scroll_down", // Mouse Scroll Down: Mouse Scroll Down + "mouse-button_down_left=mouse_button_left", // Mouse Button Left: Mouse Button Left ]; +impl Serialize for Input { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match &self.input { + InputType::Key(key) => key.serialize(serializer), + InputType::Mouse(mouse) => mouse.serialize(serializer), + } + } +} + impl Serialize for Key { fn serialize(&self, serializer: S) -> Result where @@ -96,6 +155,32 @@ impl Serialize for Key { } } +impl Serialize for Mouse { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + let action = match self.action { + // MouseButton + MouseEventKind::Down(MouseButton::Left) => "button_down_left", + MouseEventKind::Down(MouseButton::Right) => "button_down_right", + MouseEventKind::Up(MouseButton::Left) => "button_up_left", + MouseEventKind::Up(MouseButton::Right) => "button_up_right", + + // MouseScroll + MouseEventKind::ScrollUp => "scroll_up", + MouseEventKind::ScrollDown => "scroll_down", + MouseEventKind::ScrollLeft => "scroll_left", + MouseEventKind::ScrollRight => "scroll_right", + + _ => "other", + }; + + let formatted = format!("mouse-{}", action); + serializer.serialize_str(&formatted) + } +} + fn modifier_to_string<'a>(modifier: KeyModifiers) -> Option<&'a str> { match modifier { KeyModifiers::SHIFT => Some("shift"), @@ -143,6 +228,34 @@ fn keycode_to_string(code: KeyCode) -> Option { } } +impl<'de> Deserialize<'de> for Input { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value: String = Deserialize::deserialize(deserializer)?; + let tokens = value.split('-').collect::>(); + let input = match tokens[0] { + "mouse" => { + let mouse = Mouse::deserialize(de::value::StrDeserializer::::new(&value))?; + Input { + input: InputType::Mouse(mouse), + } + }, + _ => { + let key = Key::deserialize(de::value::StrDeserializer::::new(&value))?; + Input { + input: InputType::Key(key), + } + }, + }; + + Ok(input) + } +} + + + impl<'de> Deserialize<'de> for Key { fn deserialize(deserializer: D) -> Result where @@ -214,6 +327,57 @@ impl<'de> Deserialize<'de> for Key { } } +impl<'de> Deserialize<'de> for Mouse { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value: String = Deserialize::deserialize(deserializer)?; + let tokens = value.split('-').collect::>(); + let last = tokens + .last() + .ok_or(HwatchError::ConfigError) + .map_err(D::Error::custom)?; + + let action = match last.to_ascii_lowercase().as_ref() { + "button_down_left" => MouseEventKind::Down(MouseButton::Left), + "button_down_right" => MouseEventKind::Down(MouseButton::Right), + "button_up_left" => MouseEventKind::Up(MouseButton::Left), + "button_up_right" => MouseEventKind::Up(MouseButton::Right), + "scroll_up" => MouseEventKind::ScrollUp, + "scroll_down" => MouseEventKind::ScrollDown, + "scroll_left" => MouseEventKind::ScrollLeft, + "scroll_right" => MouseEventKind::ScrollRight, + _ => { + return Err(D::Error::custom(HwatchError::ConfigError)); + } + }; + + Ok(Mouse {action}) + } +} + +impl From for Input { + fn from(value: MouseEvent) -> Self { + Self { + input: InputType::Mouse(Mouse { + action: value.kind, + }), + } + } +} + +impl From for Input { + fn from(value: KeyEvent) -> Self { + Self { + input: InputType::Key(Key { + code: value.code, + modifiers: value.modifiers, + }), + } + } +} + impl From for Key { fn from(value: KeyEvent) -> Self { Self { @@ -225,7 +389,7 @@ impl From for Key { #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, PartialOrd)] pub struct InputEventContents { - pub key: Key, + pub input: Input, pub action: InputAction, } @@ -251,27 +415,42 @@ fn create_keymap(mut keymap: Keymap, keymap_options: Vec<&str>) -> Result>()?; - - for (k, a) in keys { - // Create KeyEvent - let key_event = KeyEvent { - code: k.code, - modifiers: k.modifiers, - kind: KeyEventKind::Press, - state: KeyEventState::NONE, - }; - - // Insert InputEventContents - keymap.insert( - Event::Key(key_event), - InputEventContents { - key: k, - action: a, + let inputs = config + .try_deserialize::>()?; + + for (k, a) in inputs { + match k.input { + InputType::Key(key) => { + let key_event = KeyEvent { + code: key.code, + modifiers: key.modifiers, + kind: KeyEventKind::Press, + state: KeyEventState::NONE, + }; + keymap.insert( + Event::Key(key_event), + InputEventContents { + input: k, + action: a, + }, + ); }, - ); + InputType::Mouse(mouse) => { + let mouse_event = MouseEvent { + kind: mouse.action, + column: 0, + row: 0, + modifiers: KeyModifiers::empty(), + }; + keymap.insert( + Event::Mouse(mouse_event), + InputEventContents { + input: k, + action: a, + }, + ); + }, + } } Ok(keymap) @@ -442,15 +621,31 @@ pub enum InputAction { #[serde(rename = "interval_minus")] IntervalMinus, - // Command + // Command/Filter // ========== #[serde(rename = "change_filter_mode")] ChangeFilterMode, #[serde(rename = "change_regex_filter_mode")] ChangeRegexFilterMode, - // Input + // Mouse // ========== + #[serde(rename = "mouse_scroll_up")] + MouseScrollUp, + #[serde(rename = "mouse_scroll_down")] + MouseScrollDown, + #[serde(rename = "mouse_button_left")] + MouseButtonLeft, + #[serde(rename = "mouse_button_right")] + MouseButtonRight, + #[serde(rename = "mouse_move_left")] + MouseMoveLeft, + #[serde(rename = "mouse_move_right")] + MouseMoveRight, + #[serde(rename = "mouse_move_up")] + MouseMoveUp, + #[serde(rename = "mouse_move_down")] + MouseMoveDown, } pub fn get_input_action_description(input_action: InputAction) -> String { @@ -544,11 +739,19 @@ pub fn get_input_action_description(input_action: InputAction) -> String { InputAction::IntervalPlus => "Interval +0.5sec".to_string(), InputAction::IntervalMinus => "Interval -0.5sec".to_string(), - // Command + // Command/Filter InputAction::ChangeFilterMode => "Change filter mode".to_string(), InputAction::ChangeRegexFilterMode => "Change regex filter mode".to_string(), - // Input + // Mouse + InputAction::MouseScrollUp => "Mouse Scroll Up".to_string(), + InputAction::MouseScrollDown => "Mouse Scroll Down".to_string(), + InputAction::MouseButtonLeft => "Mouse Button Left".to_string(), + InputAction::MouseButtonRight => "Mouse Button Right".to_string(), + InputAction::MouseMoveLeft => "Mouse Move Left".to_string(), + InputAction::MouseMoveRight => "Mouse Move Right".to_string(), + InputAction::MouseMoveUp => "Mouse Move Up".to_string(), + InputAction::MouseMoveDown => "Mouse Move Down".to_string(), } } From 16ea945ab2021d990057650461df1975ca9c51ab Mon Sep 17 00:00:00 2001 From: blacknon Date: Mon, 17 Jun 2024 00:22:55 +0900 Subject: [PATCH 07/13] update keymap --- src/app.rs | 29 +++++++++++++++++++++-------- src/keymap.rs | 8 ++++++++ src/view.rs | 13 +++---------- 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/src/app.rs b/src/app.rs index da4e0a2..4a9b8c4 100644 --- a/src/app.rs +++ b/src/app.rs @@ -8,11 +8,10 @@ use crossbeam_channel::{Receiver, Sender}; use crossterm::{ event::{ - DisableMouseCapture, EnableMouseCapture, Event, KeyCode, KeyEventKind, MouseButton, MouseEventKind, MouseEvent, KeyModifiers, + DisableMouseCapture, EnableMouseCapture, Event, KeyCode, KeyEventKind, MouseEvent, KeyModifiers, }, execute, }; -use heapless::binary_heap::Kind; use regex::Regex; use std::{ collections::HashMap, @@ -1136,6 +1135,24 @@ impl<'a> App<'a> { }, InputAction::Cancel => self.toggle_window(), // Cancel (Close help window with Cancel.) + // MouseScrollDown + InputAction::MouseScrollDown => { + if let Event::Mouse(mouse) = terminal_event { + self.mouse_scroll_down(mouse.column, mouse.row) + } else { + self.mouse_scroll_down(0, 0) + } + }, + + // MouseScrollUp + InputAction::MouseScrollUp => { + if let Event::Mouse(mouse) = terminal_event { + self.mouse_scroll_up(mouse.column, mouse.row) + } else { + self.mouse_scroll_up(0, 0) + } + }, + // default _ => {} } @@ -1665,9 +1682,7 @@ impl<'a> App<'a> { ActiveWindow::Help => { self.help_window.scroll_down(2); }, - ActiveWindow::Exit => { - println!("exit"); - }, + _ => {}, } } @@ -1702,9 +1717,7 @@ impl<'a> App<'a> { ActiveWindow::Help => { self.help_window.scroll_down(2); }, - ActiveWindow::Exit => { - println!("exit"); - }, + _ => {}, } } diff --git a/src/keymap.rs b/src/keymap.rs index 18da4dd..c54503a 100644 --- a/src/keymap.rs +++ b/src/keymap.rs @@ -465,6 +465,11 @@ pub fn default_keymap() -> Keymap { #[derive(Clone, Copy, Debug, Deserialize, Serialize, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum InputAction { + // None + // ========== + #[serde(rename = "none")] + None, + // Up // ========== #[serde(rename = "up")] @@ -650,6 +655,9 @@ pub enum InputAction { pub fn get_input_action_description(input_action: InputAction) -> String { match input_action { + // None + InputAction::None => "No action".to_string(), + // Up InputAction::Up => "Move up".to_string(), InputAction::WatchPaneUp => "Move up in watch pane".to_string(), diff --git a/src/view.rs b/src/view.rs index 8486577..2f9de4b 100644 --- a/src/view.rs +++ b/src/view.rs @@ -6,7 +6,7 @@ use crossbeam_channel::{Receiver, Sender}; use std::time::Duration; use crossterm::{ - event::{DisableMouseCapture, EnableMouseCapture}, + event::DisableMouseCapture, execute, terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, }; @@ -171,14 +171,6 @@ impl View { rx: Receiver, ) -> Result<(), Box> { // Setup Terminal - ctrlc::set_handler(|| { - // Runs on SIGINT, SIGTERM (kill), SIGHUP - restore_terminal(); - - // Exit code for SIGTERM (signal 15), not quite right if another signal is the cause. - std::process::exit(128 + 15) - })?; - enable_raw_mode()?; let mut stdout = io::stdout(); @@ -244,8 +236,9 @@ impl View { // Run App let res = app.run(&mut terminal); - restore_terminal(); + // exit app and restore terminal + restore_terminal(); if let Err(err) = res { println!("{err:?}") } From df8c098acd926572eee1262f8d925c67e738b1da Mon Sep 17 00:00:00 2001 From: blacknon Date: Mon, 17 Jun 2024 04:15:42 +0900 Subject: [PATCH 08/13] update. #127. --- src/app.rs | 7 ++++++- src/exit.rs | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/app.rs b/src/app.rs index be3332b..75ba2ad 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1005,6 +1005,10 @@ impl<'a> App<'a> { self.exit(); return; }, + KeyCode::Char('q') => { + self.exit(); + return; + }, KeyCode::Char('n') => { self.window = ActiveWindow::Normal; return; @@ -1164,7 +1168,8 @@ impl<'a> App<'a> { ActiveWindow::Exit => { match action { InputAction::Quit => self.exit(), // Quit - InputAction::Cancel => self.window = ActiveWindow::Normal, // Cancel + InputAction::Cancel => self.exit(), // Cancel + InputAction::Reset => self.window = ActiveWindow::Normal, // Reset _ => {} } } diff --git a/src/exit.rs b/src/exit.rs index 892c266..245cd12 100644 --- a/src/exit.rs +++ b/src/exit.rs @@ -24,7 +24,9 @@ pub struct ExitWindow<'a> { impl<'a> ExitWindow<'a> { pub fn new() -> Self { let text = vec![ - Line::from(" Exit hwatch? (Y/N)"), + Line::from(" Exit hwatch?"), + Line::from(" Press 'Y' or 'Q' : Quit."), + Line::from(" Press 'N' or 'Esc': Stay."), ]; Self { @@ -39,7 +41,7 @@ impl<'a> ExitWindow<'a> { // TODO: 枠を含めて3行にする let size = f.size(); - self.area = centered_rect_with_size(4, 32, size); + self.area = centered_rect_with_size(5, 32, size); // create block. let block = Paragraph::new(self.text.clone()) From ab33147f2914693a4ac8846684b7c7d05f2851bd Mon Sep 17 00:00:00 2001 From: blacknon Date: Tue, 18 Jun 2024 14:52:10 +0900 Subject: [PATCH 09/13] update. debug ansi color --- src/history.rs | 8 ++++---- src/output.rs | 5 +---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/history.rs b/src/history.rs index c81bb29..009f49e 100644 --- a/src/history.rs +++ b/src/history.rs @@ -30,10 +30,10 @@ pub struct History { #[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd)] pub struct HistorySummary { - pub line_add: u16, - pub line_rem: u16, - pub char_add: u16, - pub char_rem: u16, + pub line_add: u64, + pub line_rem: u64, + pub char_add: u64, + pub char_rem: u64, } impl HistorySummary { diff --git a/src/output.rs b/src/output.rs index 23779d0..3a99827 100644 --- a/src/output.rs +++ b/src/output.rs @@ -845,10 +845,6 @@ impl Printer { result_str_elements.push(str_line_style.paint(format!("{line_header}").to_string()).to_string()); for (emphasized, value) in change.iter_strings_lossy() { let mut line_data = value.to_string(); - if self.is_color { - line_data = get_ansi_strip_str(&value); - } - if self.is_word_highlight && emphasized { // word highlight // line push result_line_spans.push( @@ -885,6 +881,7 @@ impl Printer { } }, _ => { + line_data = ansi::get_ansi_strip_str(&value); let color_strip_data = get_ansi_strip_str(&line_data).trim_end_matches('\n').to_string(); result_line_spans.push(Span::styled(format!("{line_data}"), tui_line_style)); result_str_elements.push(str_line_style.paint(format!("{color_strip_data}").to_string()).to_string()); From 7d67f8bb90c895817529cf9ef727b17e4968a4c0 Mon Sep 17 00:00:00 2001 From: blacknon Date: Tue, 18 Jun 2024 17:00:49 +0900 Subject: [PATCH 10/13] update. mouse click debug. --- src/history.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/history.rs b/src/history.rs index 009f49e..01a305a 100644 --- a/src/history.rs +++ b/src/history.rs @@ -380,7 +380,18 @@ impl HistoryArea { /// pub fn click_row(&mut self, row: u16) { let first_row = self.state.offset(); - let select_num = row as usize; + + let select_num: usize; + if self.summary { + if row == 0 { + select_num = row as usize; + } else { + select_num = ((row - 1) / 3 + 1) as usize; + } + } else { + select_num = row as usize; + } + if select_num < self.data.len() { self.state.select(Some(select_num + first_row)); } From d9b52ff512e0236a6b0eb13cfebfccfb683a3673 Mon Sep 17 00:00:00 2001 From: blacknon Date: Tue, 18 Jun 2024 19:15:09 +0900 Subject: [PATCH 11/13] update. mouse click debug. --- src/history.rs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/history.rs b/src/history.rs index 01a305a..5b7d2ca 100644 --- a/src/history.rs +++ b/src/history.rs @@ -381,15 +381,27 @@ impl HistoryArea { pub fn click_row(&mut self, row: u16) { let first_row = self.state.offset(); - let select_num: usize; + let mut select_num: usize; + + let border_row_num: usize = if self.border { 1 } else { 0 }; + if self.summary { - if row == 0 { - select_num = row as usize; + if row == (0 + border_row_num as u16) { + select_num = row as usize - border_row_num; + } else if row < border_row_num as u16 { + select_num = 0; } else { - select_num = ((row - 1) / 3 + 1) as usize; + if first_row == 0 { + select_num = ((row - 1 - border_row_num as u16) / 3 + 1) as usize; + } else { + select_num = ((row - border_row_num as u16) / 3) as usize; + } } } else { select_num = row as usize; + if row > 0 { + select_num -= border_row_num; + } } if select_num < self.data.len() { From f0f5c015bfc262a99be205d8246020f3024782ee Mon Sep 17 00:00:00 2001 From: blacknon Date: Tue, 18 Jun 2024 23:57:02 +0900 Subject: [PATCH 12/13] update. mouse scroll size change --- src/app.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app.rs b/src/app.rs index 75ba2ad..1d238c7 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1669,7 +1669,7 @@ impl<'a> App<'a> { self.watch_area.scroll_up(2); }, ActiveArea::History => { - self.history_area.next(2); + self.history_area.next(1); let selected = self.history_area.get_state_select(); self.set_output_data(selected); @@ -1678,7 +1678,7 @@ impl<'a> App<'a> { } else { let is_history_area = check_in_area(self.history_area.area, column, row); if is_history_area { - self.history_area.next(2); + self.history_area.next(1); let selected = self.history_area.get_state_select(); self.set_output_data(selected); @@ -1705,7 +1705,7 @@ impl<'a> App<'a> { self.watch_area.scroll_down(2); }, ActiveArea::History => { - self.history_area.previous(2); + self.history_area.previous(1); let selected = self.history_area.get_state_select(); self.set_output_data(selected); @@ -1714,7 +1714,7 @@ impl<'a> App<'a> { } else { let is_history_area = check_in_area(self.history_area.area, column, row); if is_history_area { - self.history_area.previous(2); + self.history_area.previous(1); let selected = self.history_area.get_state_select(); self.set_output_data(selected); From cf22e130006a0f48b18d993640b9d844b5a30ec1 Mon Sep 17 00:00:00 2001 From: blacknon Date: Wed, 19 Jun 2024 01:16:50 +0900 Subject: [PATCH 13/13] update. --- src/main.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index c48c2d3..41b3ec5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,10 +2,6 @@ // Use of this source code is governed by an MIT license // that can be found in the LICENSE file. -// v0.3.15 -// TODO(blacknon): line/word diffでansi対応がうまくいかなくなっちゃったので、修正する -// TODO(blacknon): mouse flagがうまく動かないので、修正する - // v0.3.16 // TODO(blacknon): Enterキーでfilter modeのキーワード移動をできるようにする // TODO(blacknon): filter modeのハイライト表示をどのoutput modeでもできるようにする(とりあえずcolor mode enable時はansi codeをパース前にいじる感じにすれば良さそう?)