aboutsummaryrefslogtreecommitdiffstats
path: root/src/term.rs
AgeCommit message (Collapse)AuthorFilesLines
2024-01-12Allow 4~ for End.Rose Hogenson1-1/+1
This seems to be what GNU screen provides, at least.
2024-01-12Fix a bug where cursor_pos would return old data.Rose Hogenson1-91/+125
For now I'm just counting the failures, and aborting if cursor_pos immediately failed before. We have to skip the incoming status reports with read_key before cursor_pos will start working again. This should flush any old status reports, and prevent reading them incorrectly.
2024-01-11Implement Home, End, PgUp, and PgDn.Rose Hogenson1-14/+37
2024-01-11Apply a clippy suggestion.Rose Hogenson1-1/+1
2024-01-11Don't call read immediately in cursor_pos.Rose Hogenson1-2/+1
I forgot that read can block. We actually don't want cursor_pos to block for user input before querying, since it will fail nearly every time. It did give me a good opportunity to test the error handling though.
2024-01-11Don't read the wrong value in cursor_pos.Rose Hogenson1-0/+6
It seems like sometimes a slow terminal like lxterminal can take a little while to respond with the cursor position, so the read can time out. If it does, a later call to cursor_pos could read it in. To prevent this, we can call read before even querying the position. If there are any previous pending status responses, this should hopefully read them in, and we can abort early without getting confused. If there is no buffered data on stdin, then it's hopefully safe to write the status query and read the response.
2024-01-11Rewrite the entire thing.Rose Hogenson1-112/+51
They say you can always do a better job on the rewrite, and to a certain extent that was true here. I kept a lot of it the same though, since there was a lot I liked from the original design. The main improvements are in efficiency and code clarity.
2024-01-07Support backspace in xterm.Rose Hogenson1-1/+3
Backspace: Cooler backspace:
2024-01-07Support pasting text into the editor.Rose Hogenson1-15/+77
The editor only repaints when there is a small delay in the input, which only happens when the user is typing. Otherwise the bytes go straight into the buffer.
2024-01-07Implement redo.Rose Hogenson1-0/+5
Is this how redo works?
2024-01-06Implement undo.Rose Hogenson1-0/+5
2024-01-06Use a b-tree for the rope.Rose Hogenson1-5/+12
Now it's balanced :D
2024-01-06Implement backspace.Rose Hogenson1-0/+5
2024-01-06Use more idiomatic error handling.Rose Hogenson1-31/+24
2023-12-29Allow saving the file with CTRL-S.Rose Hogenson1-0/+5
2023-12-29Support inserting text.Rose Hogenson1-2/+2
2023-12-29Allow moving the cursor with the arrow keys.Rose Hogenson1-0/+55
2023-12-27Put the terminal in raw mode.Rose Hogenson1-11/+54
2023-12-27Rename tiocgwinsz.rs to term.rs.Rose Hogenson1-0/+18
I will be putting more functionality in this file.