Skip to content

Commit dc76917

Browse files
committedJul 15, 2022
Update rustfmt.toml & clippy.fish
1 parent 1574bd9 commit dc76917

File tree

7 files changed

+30
-14
lines changed

7 files changed

+30
-14
lines changed
 

‎.vscode/settings.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"idents",
1414
"itends",
1515
"macaddress",
16+
"mdns",
1617
"nonblocking",
1718
"paren",
1819
"plasticcard",

‎TODO.todo

+22-8
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,37 @@
1+
r3bl-cmdr
2+
3+
example handling:
4+
☐ create a simple way of asking user for which ex to run
5+
☐ use simple readline and then route the request to the correct ex
6+
☐ separate `sample_app` into: `ex_no_layout` & `ex_with_layout`
7+
☐ stub out `ex_with_editor`
8+
9+
separation of concerns:
10+
☐ What should the specificity of input event handling be?
11+
- Currently the `DefaultInputEventHandler` does not consume input events and it peeks at them
12+
- There isn't a way for apps to override any container defaults
13+
- Should this be inverted? Apps get first dibs input event & consume if they handle it?
14+
115
add layout engine:
2-
✔ merge `tw_area_test.rs` + `app_withuout_layout.rs` -> `app_with_layout.rs` @done(22-07-03 16:47)
16+
✔ merge `tw_area_test.rs` + `app_without_layout.rs` -> `app_with_layout.rs` @done(22-07-03 16:47)
317
✔ make sure to save `app_without_layout.rs` for future use w/ routing below @done(22-07-03 16:26)
418
✔ rename `tw_area.rs` to `tw_surface` and `TWArea` to `TWSurface` @done(22-07-04 20:27)
519
☐ paint state & use lolcat
6-
20+
721
test 2 col layout:
822
✔ refactor DEBUG & raw mode & TWCommand @done(22-07-04 20:06)
923
✔ make sure that the colors work as expected (Color::Red, Color::Rgb, etc) @done(22-07-03 19:43)
1024
✔ row calculation seems wrong (too much space on top of the rendered output) @done(22-07-04 15:10)
1125
✔ clean up decl macros w/ repetitions `tw_command.rs`, `file_logging.rs`, `decl_macros.rs` @done(22-07-04 20:23)
1226
✔ emit clear screen & reset color commands before rendering each frame (artifacts appear on resize) @done(22-07-04 21:00)
1327
✔ does margin (cols) work as expected? (different in vscode terminal vs real terminal) @done(22-07-07 13:41)
14-
☐ make sure that the attributes work as expected (dim, strikethru, etc)
28+
☐ make sure that the attributes work as expected (dim, strike through, etc)
1529
☐ handle situation when cursor is moved PAST the bounds of the window (< 0 or > max)
1630
- add row and col offset?
1731
- track cursor position?
1832
- Example: https://github.com/nazmulidris/cli-editor/blob/main/src/main.rs
1933

20-
performance & completness:
34+
performance & completeness:
2135
☐ stress test app w/ full screen repaint on mouse move
2236
☐ add all the remaining crossterm commands to `TWCommand`
2337

@@ -28,7 +42,7 @@ introduce first DSL (JSX-like syntax):
2842
☐ write DL tutorial on create DSL in Rust
2943
- based on: https://github.com/r3bl-org/r3bl-rs-utils/blob/main/macro/src/make_style/mod.rs
3044
- create tui category in DL
31-
- make sure to publicise this article on mailchimp, reddit, users.rust-lang.org
45+
- make sure to publicize this article on mailchimp, reddit, users.rust-lang.org
3246

3347
routing:
3448
☐ introduce routing concept to switch between apps (with + without layout)
@@ -67,6 +81,6 @@ mdns & p2p:
6781
- local service discovery
6882
- easy authentication (cloud auth provider login?)
6983

70-
flow editor:
71-
Ideate on how to impl this
72-
- 2+ col layout that allows text to be edited flowing LTR
84+
new stuff:
85+
flow editor
86+
☐ diagrams

‎clippy.fish

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# More info about cargo-watch: https://lib.rs/crates/cargo-watch
44

5+
cargo fix --allow-dirty --allow-staged
56
cargo fmt --all
67
RUST_BACKTRACE=1 cargo watch -x 'clippy --fix --allow-dirty --allow-staged' -c -q
78

‎rustfmt.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ color = "Always"
2525
empty_item_single_line = true
2626
normalize_doc_attributes = true
2727
trailing_semicolon = true
28-
wrap_comments = true
29-
format_code_in_doc_comments = true
3028
force_explicit_abi = true
3129
format_strings = true
30+
wrap_comments = false
31+
format_code_in_doc_comments = true

‎src/sample_app/app_no_layout.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use crossterm::event::*;
2020

2121
use crate::*;
2222

23-
/// Async trait object that implements the [Draw] trait.
23+
/// Async trait object that implements the [Render] trait.
2424
#[derive(Default, Debug, Clone, Copy)]
2525
pub struct AppNoLayout {
2626
pub lolcat: Lolcat,

‎src/sample_app/app_with_layout.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use crossterm::event::*;
2020

2121
use crate::*;
2222

23-
/// Async trait object that implements the [Draw] trait.
23+
/// Async trait object that implements the [Render] trait.
2424
#[derive(Default, Debug, Clone, Copy)]
2525
pub struct AppWithLayout {
2626
pub lolcat: Lolcat,

‎src/tui/terminal_window/main_event_loop.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ where
153153
A: Display + Default + Clone + Sync + Send,
154154
{
155155
fn new_box(
156-
shared_draw: &SharedRender<S, A>, shared_store: &SharedStore<S, A>, shared_window: &SharedWindow,
156+
shared_render: &SharedRender<S, A>, shared_store: &SharedStore<S, A>, shared_window: &SharedWindow,
157157
) -> Box<Self> {
158158
Box::new(TWSubscriber {
159-
shared_render: shared_draw.clone(),
159+
shared_render: shared_render.clone(),
160160
shared_store: shared_store.clone(),
161161
shared_window: shared_window.clone(),
162162
})

0 commit comments

Comments
 (0)
Please sign in to comment.