summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyohei Uto <im@kyoheiu.dev>2023-12-09 05:43:49 +0900
committerKyohei Uto <im@kyoheiu.dev>2023-12-09 05:43:49 +0900
commit6e479e840789f2abcfbdc57d2ea8462000c004a4 (patch)
treef8287ba7314c5c89a5bc7b2789ea0ccfa18aa677
parent92b105b5ba393b11791af2279fc206fbe152c2fa (diff)
parent5c0b7f832bd3afc978a3ef974122538905f7e33d (diff)
Merge branch 'develop' into ctrl-h
-rw-r--r--CHANGELOG.md5
-rw-r--r--Cargo.lock2
-rw-r--r--Cargo.toml2
-rw-r--r--README.md35
-rw-r--r--screenshots/screenshot.pngbin3141755 -> 154736 bytes
-rw-r--r--src/config.rs6
-rw-r--r--src/run.rs31
-rw-r--r--src/state.rs15
8 files changed, 46 insertions, 50 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 95ce6ae..0febc0a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,11 @@
## Unreleased
+## v2.10.2 (2023-11-26)
+
+### Fixed
+- Added a filter to every user input to reject `Keyup` events. This is required on the windows platform.
+
## v2.10.1 (2023-11-02)
### Fixed
diff --git a/Cargo.lock b/Cargo.lock
index 4bbd494..85a9308 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -330,7 +330,7 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
[[package]]
name = "felix"
-version = "2.10.1"
+version = "2.10.2"
dependencies = [
"bwrap",
"chrono",
diff --git a/Cargo.toml b/Cargo.toml
index 4f9801c..a85d504 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "felix"
-version = "2.10.1"
+version = "2.10.2"
authors = ["Kyohei Uto <im@kyoheiu.dev>"]
edition = "2021"
description = "tui file manager with vim-like key mapping"
diff --git a/README.md b/README.md
index 6b296d1..e9899e3 100644
--- a/README.md
+++ b/README.md
@@ -25,6 +25,12 @@ For more detailed document, visit https://kyoheiu.dev/felix.
## New release
+## v2.10.2 (2023-11-26)
+
+### Fixed
+- Added a filter to every user input to reject `Keyup` events. This is required on the windows platform.
+
+
## v2.10.1 (2023-11-02)
### Fixed
@@ -37,35 +43,6 @@ For more detailed document, visit https://kyoheiu.dev/felix.
- Add `has_bat` field to `State`.
- Add `FxError::InvalidPath` to handle invalid unicode in file path.
-## v2.9.0 (2023-10-22)
-
-### Added
-- Change color of untracked/changed files or directories containing such files. Default color is Red(1). You can change it in the config file.
- - Add `git2`.
-
-### Fixed
-- Explicitly ignore the key release events for Windows.
-
-## v2.8.1 (2023-08-25)
-
-### Fixed
-- Fix help text.
-
-## v2.8.0 (2023-08-25)
-
-### Added
-- `i{file name}<CR>` to create new file, and `I{dir name}<CR>` to create new directory.
-- If zoxide is installed, whenever changing directory inside felix, `zoxide add` will be executed to add the directory or increment its rank in the zoxide database.
- - For this, `State` now has a new field `has_zoxide`, which is checked at startup.
-
-### Changed
-- config's `color` is now optional: By this, all config fields are optional.
- - Remove warning message when you launch felix without the config file.
-- When opening file by default editor is failed, felix displays more accurate warning: `$EDITOR may not be set, or config file may be invalid.`.
-
-### Removed
-- Remove `syntect` and syntax highlighting in the preview area. This will improve build and start-up times, and resolve the handling of wide chars such as CJK.
-
For more details, see `CHANGELOG.md`.
<a id="status"></a>
diff --git a/screenshots/screenshot.png b/screenshots/screenshot.png
index e90dd63..a15bee8 100644
--- a/screenshots/screenshot.png
+++ b/screenshots/screenshot.png
Binary files differ
diff --git a/src/config.rs b/src/config.rs
index 1335b3e..de8e6d7 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -117,11 +117,7 @@ impl Default for Config {
fn read_config(p: &Path) -> Result<Config, FxError> {
let s = read_to_string(p)?;
- read_config_from_str(&s)
-}
-
-fn read_config_from_str(s: &str) -> Result<Config, FxError> {
- let deserialized: Config = serde_yaml::from_str(s)?;
+ let deserialized: Config = serde_yaml::from_str(&s)?;
Ok(deserialized)
}
diff --git a/src/run.rs b/src/run.rs
index ed09257..36c4a0c 100644
--- a/src/run.rs
+++ b/src/run.rs
@@ -390,7 +390,7 @@ fn _run(mut state: State, session_path: PathBuf) -> Result<(), FxError> {
show_cursor();
screen.flush()?;
- if let Event::Key(KeyEvent { code, .. }) = event::read()? {
+ if let Event::Key(KeyEvent { code, kind: KeyEventKind::Press, .. }) = event::read()? {
match code {
KeyCode::Char('g') => {
hide_cursor();
@@ -414,7 +414,7 @@ fn _run(mut state: State, session_path: PathBuf) -> Result<(), FxError> {
show_cursor();
screen.flush()?;
- if let Event::Key(KeyEvent { code, .. }) = event::read()? {
+ if let Event::Key(KeyEvent { code, kind: KeyEventKind::Press, .. }) = event::read()? {
match code {
KeyCode::Char('g') => {
hide_cursor();
@@ -630,7 +630,7 @@ fn _run(mut state: State, session_path: PathBuf) -> Result<(), FxError> {
let mut current_pos = 3;
'zoxide: loop {
if let Event::Key(KeyEvent {
- code, modifiers, ..
+ code, modifiers, kind: KeyEventKind::Press, ..
}) = event::read()?
{
match (code, modifiers) {
@@ -794,13 +794,14 @@ fn _run(mut state: State, session_path: PathBuf) -> Result<(), FxError> {
let mut current_char_pos = 0;
'insert: loop {
if let Event::Key(KeyEvent {
- code, modifiers, ..
+ code, modifiers,
+ kind: KeyEventKind::Press, ..
}) = event::read()?
{
match (code, modifiers) {
// <C-r> to put the item name(s) from register
(KeyCode::Char('r'), KeyModifiers::CONTROL) => {
- if let Event::Key(KeyEvent { code, .. }) =
+ if let Event::Key(KeyEvent { code, kind: KeyEventKind::Press, .. }) =
event::read()?
{
if let Some(reg) =
@@ -1072,7 +1073,7 @@ fn _run(mut state: State, session_path: PathBuf) -> Result<(), FxError> {
show_cursor();
screen.flush()?;
- if let Event::Key(KeyEvent { code, .. }) = event::read()? {
+ if let Event::Key(KeyEvent { code, kind: KeyEventKind::Press, .. }) = event::read()? {
match code {
KeyCode::Char('d') => {
if let Err(e) =
@@ -1178,7 +1179,7 @@ fn _run(mut state: State, session_path: PathBuf) -> Result<(), FxError> {
let mut current_char_pos = rename.len();
loop {
if let Event::Key(KeyEvent {
- code, modifiers, ..
+ code, modifiers, kind: KeyEventKind::Press, ..
}) = event::read()?
{
match (code, modifiers) {
@@ -1316,7 +1317,7 @@ fn _run(mut state: State, session_path: PathBuf) -> Result<(), FxError> {
let mut current_char_pos = 0;
loop {
if let Event::Key(KeyEvent {
- code, modifiers, ..
+ code, modifiers, kind: KeyEventKind::Press, ..
}) = event::read()?
{
match (code, modifiers) {
@@ -1523,7 +1524,7 @@ fn _run(mut state: State, session_path: PathBuf) -> Result<(), FxError> {
let mut current_pos = INITIAL_POS_COMMAND_LINE;
'reg: loop {
- if let Event::Key(KeyEvent { code, .. }) = event::read()? {
+ if let Event::Key(KeyEvent { code, kind: KeyEventKind::Press, .. }) = event::read()? {
match code {
KeyCode::Esc => {
go_to_info_line_and_reset();
@@ -1901,14 +1902,14 @@ fn _run(mut state: State, session_path: PathBuf) -> Result<(), FxError> {
let mut current_char_pos = 0;
'command: loop {
if let Event::Key(KeyEvent {
- code, modifiers, ..
+ code, modifiers, kind: KeyEventKind::Press, ..
}) = event::read()?
{
// <C-r> to put the item name(s) in register
if modifiers == KeyModifiers::CONTROL
&& code == KeyCode::Char('r')
{
- if let Event::Key(KeyEvent { code, .. }) =
+ if let Event::Key(KeyEvent { code, kind: KeyEventKind::Press, .. }) =
event::read()?
{
if let Some(reg) = state.registers.check_reg(&code)
@@ -2244,7 +2245,13 @@ fn _run(mut state: State, session_path: PathBuf) -> Result<(), FxError> {
show_cursor();
screen.flush()?;
- if let Event::Key(KeyEvent { code, .. }) = event::read()? {
+ let mut next_key:Event = event::read()?;
+ // ignore exactly one keypress Release after a Z is entered
+ if let Event::Key(KeyEvent { kind: KeyEventKind::Release, .. }) = next_key {
+ next_key = event::read()?;
+ }
+
+ if let Event::Key(KeyEvent { code, kind: KeyEventKind::Press, .. }) = next_key {
match code {
KeyCode::Char('Q') => {
if state.match_vim_exit_behavior
diff --git a/src/state.rs b/src/state.rs
index bbfd149..7cfecf6 100644
--- a/src/state.rs
+++ b/src/state.rs
@@ -12,6 +12,7 @@ use super::session::*;
use super::term::*;
use chrono::prelude::*;
+use crossterm::event::KeyEventKind;
use crossterm::event::{Event, KeyCode, KeyEvent};
use crossterm::style::Stylize;
use log::{error, info};
@@ -1398,7 +1399,12 @@ impl State {
let mut skip = 0;
loop {
- if let Event::Key(KeyEvent { code, .. }) = crossterm::event::read()? {
+ if let Event::Key(KeyEvent {
+ code,
+ kind: KeyEventKind::Press,
+ ..
+ }) = crossterm::event::read()?
+ {
match code {
KeyCode::Char('j') | KeyCode::Down => {
clear_all();
@@ -1432,7 +1438,12 @@ impl State {
print_warning(EMPTY_WARNING, self.layout.y);
screen.flush()?;
- if let Event::Key(KeyEvent { code, .. }) = crossterm::event::read()? {
+ if let Event::Key(KeyEvent {
+ code,
+ kind: KeyEventKind::Press,
+ ..
+ }) = crossterm::event::read()?
+ {
match code {
KeyCode::Char('y') | KeyCode::Char('Y') => {
print_info("EMPTY: Processing...", self.layout.y);