Commit Graph

52 Commits

Author SHA1 Message Date
Harsh Shandilya 71d2d8a2ab fix: avoid `should-implement-trait` Clippy warning 2023-02-16 14:28:01 +00:00
Harsh Shandilya 5ea1f8299f
refactor: address Clippy warnings 2022-11-16 01:44:02 +05:30
Harsh Shandilya 09d6343874
refactor(document): rewrite `if` comparison to use `std::cmp` 2022-11-15 20:32:33 +05:30
Harsh Shandilya f46a628ccc
feat: implement rudimentary save functionality 2022-08-11 01:21:28 +05:30
Harsh Shandilya 311c59a1e2
feat(document): add support for creating new lines 2022-08-11 01:04:46 +05:30
Harsh Shandilya 45e0909cde
feat(document): make deletion work across line boundaries 2022-08-11 00:56:59 +05:30
Harsh Shandilya 181965715e
feat(row): implement `Row.append` 2022-08-11 00:43:59 +05:30
Harsh Shandilya 29c77dc197
feat(editor): implement basic backspace support 2022-08-11 00:40:36 +05:30
Harsh Shandilya 279906df37
feat(document): implement delete support 2022-08-11 00:25:52 +05:30
Harsh Shandilya ca85741062
feat(document): implement insertion support 2022-08-11 00:25:47 +05:30
Harsh Shandilya 10a802c3cf
feat(editor): fill out message bar 2022-08-08 00:53:54 +05:30
Harsh Shandilya a2133f9218
feat(editor): add cursor position to status 2022-08-08 00:40:23 +05:30
Harsh Shandilya 58e6618e6b
feat(editor): add file name to status bar 2022-08-08 00:38:49 +05:30
Harsh Shandilya 5ea82d6a71
feat(document): plumb in an optional file name 2022-08-08 00:31:53 +05:30
Harsh Shandilya 15c874a2e3
feat(editor): draw status and message bars 2022-08-08 00:29:26 +05:30
Harsh Shandilya 9c5d99f200
feat: reserve two lines at the bottom for a status bar 2022-08-08 00:22:30 +05:30
Harsh Shandilya d7ae3fdde0
fix(row): convert tabs in document to spaces during rendering 2022-08-08 00:21:28 +05:30
Harsh Shandilya c566116b97
feat(row): make line length Unicode-aware 2022-08-08 00:21:28 +05:30
Harsh Shandilya 66a4823a11
feat(editor): make keyboard navigation document aware 2022-08-08 00:21:28 +05:30
Harsh Shandilya 0601355a98
feat(editor): scrolling support 2022-08-08 00:19:47 +05:30
Harsh Shandilya efde3d3440
feat(editor): allow opening files passed through `argv` 2022-08-08 00:19:47 +05:30
Harsh Shandilya ad46738140
feat(editor): add support for rendering a document 2022-08-08 00:19:46 +05:30
Harsh Shandilya 6b893fdbd9
feat(editor): make `Editor` carry a `Document` 2022-08-08 00:19:46 +05:30
Harsh Shandilya 5f7572fd55
feat: add types for document rendering 2022-08-08 00:19:46 +05:30
Harsh Shandilya a7d8164200
feat(editor): support `PageUp`, `PageDown`, `Home` and `End` 2022-08-07 23:05:16 +05:30
Harsh Shandilya aff2d24d33
feat(editor): support moving cursor with arrow keys 2022-08-07 23:05:15 +05:30
Harsh Shandilya 753d07579a
Revert "fix(editor): simplify `pressed_key` match expression"
We're adding more cases to this

This reverts commit 189893a827.
2022-08-07 23:05:15 +05:30
Harsh Shandilya a9b6e48ff4
refactor: re-export some types from the crate root 2022-08-07 23:05:15 +05:30
Harsh Shandilya fb345bed2e
feat(editor): start tracking cursor position 2022-08-07 23:05:15 +05:30
Harsh Shandilya 2e5b4384f9
feat(editor): add a welcome message 2022-08-07 22:17:32 +05:30
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 9e52d4ad10
feat: add basic machinery to read input and quit 2022-08-07 16:27:42 +05:30