Skip to content

Commit

Permalink
cargo fmt, fix gif link
Browse files Browse the repository at this point in the history
  • Loading branch information
DevinR528 committed Feb 16, 2020
1 parent 50094fa commit e186a7d
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "forget"
version = "0.1.0"
version = "1.0.0"
authors = ["Devin R <[email protected]>"]
license = "MIT/Apache-2.0"
description = "Command line todo in Rust."
Expand All @@ -9,6 +9,7 @@ keywords = ["todo", "cli", "productivity", "console", "terminal"]
categories = ["development-tools", "text-editors"]
edition = "2018"
readme = "README.md"
exclude = [ "resources" ]

[badges]
travis-ci = { repository = "DevinR528/forget" }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ a command can be run when the item is selected (press Enter while highlighted) t
process and will not affect the UI. `forget` is a multi-threaded application the UI event loop and input loop
each run on a separate thread as well as any command spawned, everything is cleaned up when the main thread exits.

![forget-demo](https://github.com/DevinR528/forget/resources/forget-demo.gif)
![forget-demo](https://github.com/DevinR528/forget/blob/master/resources/forget-demo.gif)

# Install
```bash
Expand Down
20 changes: 9 additions & 11 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,21 +417,19 @@ impl App {
self.edit_todo = !flag;

if self.edit_todo {
self.add_todo.task = self.sticky_note.items
self.add_todo.task = self
.sticky_note
.items
.get(self.tabs.index)
.map(|n| {
n.list.get_selected()
.map(|t| t.task.clone())
})
.map(|n| n.list.get_selected().map(|t| t.task.clone()))
.flatten()
.unwrap_or_default();

self.add_todo.cmd = self.sticky_note.items

self.add_todo.cmd = self
.sticky_note
.items
.get(self.tabs.index)
.map(|n| {
n.list.get_selected()
.map(|t| t.cmd.clone())
})
.map(|n| n.list.get_selected().map(|t| t.cmd.clone()))
.flatten()
.unwrap_or_default();
}
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ thread_local! { pub static APP: ListState<Remind> = ListState {
},
Todo {
date: Local::now(),
task: "You can add a Todo by hitting ctrl-j".into(),
task: "You can add a Todo by hitting ctrl-n".into(),
cmd: String::new(),
completed: false
},
Expand Down
7 changes: 6 additions & 1 deletion src/ux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,12 @@ where
.wrap(true)
.render(f, chunks[1]);
} else {
let note = &app.sticky_note.items.get(app.tabs.index).map(|n| n.note.clone()).unwrap_or_default();
let note = &app
.sticky_note
.items
.get(app.tabs.index)
.map(|n| n.note.clone())
.unwrap_or_default();
let text = Text::styled(note, Style::default().fg(Color::Green));
Paragraph::new(vec![text].iter())
.block(
Expand Down

0 comments on commit e186a7d

Please sign in to comment.