Commit Graph

123 Commits

Author SHA1 Message Date
Harsh Shandilya f9157f13bb
refactor(editor): optimize terminal clearing logic
The terminal now attempts to clear line by line where possible
2022-08-07 18:21:24 +05:30
Harsh Shandilya 5bb39b0618
fix(editor): keep cursor hidden during refresh
Prevents a potentially annoying flicker
2022-08-07 18:19:18 +05:30
Harsh Shandilya a792bd2d1f
fix(editor): leave an empty line at the bottom
We'll use this for a simple status bar feature
2022-08-07 18:17:52 +05:30
Harsh Shandilya 189893a827
fix(editor): simplify `pressed_key` match expression 2022-08-07 18:15:56 +05:30
Harsh Shandilya 9402e2a358
refactor(terminal/editor): shuffle code around to better match scope 2022-08-07 18:15:04 +05:30
Harsh Shandilya 2f024d8171
feat(editor): add a leading column of tildes
Looks kinda like vim I guess?
2022-08-07 18:04:37 +05:30
Harsh Shandilya a9c540525d
feat(editor): add terminal to `Editor` struct 2022-08-07 18:04:37 +05:30
Harsh Shandilya d2bb3694f8
feat(terminal): add a way to get the terminal size 2022-08-07 18:04:37 +05:30
Harsh Shandilya e2180d92ec
feat(editor): print a goodbyte message and clear screen before exiting 2022-08-07 17:47:17 +05:30
Harsh Shandilya 5312007841
refactor(editor): DRY 2022-08-07 17:46:49 +05:30
Harsh Shandilya 6ab4bcf545
feat(editor): move cursor back to start after refresh 2022-08-07 17:31:23 +05:30
Harsh Shandilya 9afeaeeb15
feat(editor): refresh screen when starting editor 2022-08-07 17:30:25 +05:30
Harsh Shandilya f8a516fb4b
refactor(editor): use std `Result`
It is simpler to keep the `anyhow` bits in the main exec loop
2022-08-07 17:29:41 +05:30
Harsh Shandilya c54d8f77ef
feat(editor): make exit non-fatal 2022-08-07 17:24:32 +05:30
Harsh Shandilya 5413e7c903
refactor(editor): separate reading and evaluating keypresses 2022-08-07 17:21:46 +05:30
Harsh Shandilya 6a21a5aeb5
refactor: move editor code to its own module 2022-08-07 16:52:07 +05:30
Harsh Shandilya b60fa8c256
refactor: use `termion` to process keystrokes 2022-08-07 16:44:54 +05:30
Harsh Shandilya 546a24b63a
feat: make `Ctrl + q` the exit sequence 2022-08-07 16:37:41 +05:30
Harsh Shandilya 88f8a2b1c3
feat: check for control characters and print more info 2022-08-07 16:34:14 +05:30
Harsh Shandilya 40a382e71d
feat: add termion for terminal handling 2022-08-07 16:30:07 +05:30
Harsh Shandilya 9e52d4ad10
feat: add basic machinery to read input and quit 2022-08-07 16:27:42 +05:30
Harsh Shandilya e35b3a11f8
feat: add anyhow to capture errors 2022-08-07 16:27:07 +05:30
Harsh Shandilya 6ff5b04d1d
Initial commit 2022-08-07 16:24:32 +05:30