Skip to content

Commit

Permalink
Show cursor in input window #125 (#183)
Browse files Browse the repository at this point in the history
* tui-textareaが最低限動くようになった

* fix style

* Modelの値を比較できるように修正

* Delete Message::Backspace

* キー入力の二重管理をやめる

* Add update test

* update test

* refactor model

* add test

* delete comment

* handle event only when AppState::SelectingTarget

* delete comment

* fix
  • Loading branch information
kyu08 authored Jan 3, 2024
1 parent f45f8bc commit 8846d13
Show file tree
Hide file tree
Showing 7 changed files with 303 additions and 96 deletions.
24 changes: 24 additions & 0 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -992,3 +992,27 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
================================================================

tui-textarea
https://github.com/rhysd/tui-textarea
----------------------------------------------------------------
the MIT License
Copyright (c) 2022 rhysd

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE USE OR OTHER DEALINGS IN THE SOFTWARE.
================================================================
16 changes: 14 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ portable-pty = "0.8.1"
tui-term = "0.1.6"
ratatui = "0.25.0"
anyhow = "1.0.78"
tui-textarea = "0.4.0"
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ tools:
run:
@cargo run

.PHONY: run-ratatui
run-ratatui:
@RUST_BACKTRACE=full cargo run -- -r

.PHONY: build
build:
@cargo build
Expand Down
15 changes: 14 additions & 1 deletion src/models/makefile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use regex::Regex;
use std::path::{Path, PathBuf};

/// Makefile represents a Makefile.
#[derive(Clone)]
#[derive(Clone, Debug, PartialEq)]
pub struct Makefile {
pub path: PathBuf,
include_files: Vec<Makefile>,
Expand Down Expand Up @@ -96,6 +96,19 @@ impl Makefile {

(None, None)
}

#[cfg(test)]
pub fn new_for_test() -> Makefile {
Makefile {
path: Path::new("test").to_path_buf(),
include_files: vec![],
targets: Targets(vec![
"target0".to_string(),
"target1".to_string(),
"target2".to_string(),
]),
}
}
}

/// The path should be relative path from current directory where make command is executed.
Expand Down
Loading

0 comments on commit 8846d13

Please sign in to comment.