Conversation
| let (width, _height) = termion::terminal_size().unwrap(); | ||
| let padding = 5; | ||
| let columns = width / (max_length + padding); | ||
| let mut tw = TabWriter::new(writer).padding(padding as usize); |
There was a problem hiding this comment.
We may want to ditch this albeit neat method of table generation and go for something that will produce better results in our case.
Issues at the moment:
- Sort order is inconsistent with expectation
- Every column is treated as if it was as wide as the widest
Don't forget to print a newline in the middle of a row still.
Proper error handling is always the topc of a good Rust engineer, right?
| } | ||
| println!(); | ||
| print!("{}{}", | ||
| termion::cursor::Left(1000), // XXX |
There was a problem hiding this comment.
Is it worth fixing this now?
| pub fn insert(context: &mut ActionContext, c: char) { | ||
| if let Ok((x, y)) = context.stdout.cursor_pos() { | ||
| // XXX: Why did this panic? | ||
| let i = (x - context.prompt_length) as usize; |
There was a problem hiding this comment.
Worth looking into this again for a bit.
| default = ["raw", "shebang-block"] | ||
| default = ["raw", "history", "completion", "shebang-block"] | ||
|
|
||
| # TODO: Justify and explain features. |
There was a problem hiding this comment.
As always, I think documentation will mark the end of the PR.
Generally in a collaborative environment (which this is currently not), I like this, writing a summary gives people time to review as well as giving future developers the needed information.
| 0 => Completion::None, | ||
| 1 => Completion::Complete(matches.remove(0)), | ||
| _ => { | ||
| // TODO: Support POSIX style lexicographical order? |
There was a problem hiding this comment.
I'm torn on this, as am I torn on row major vs column major order.
| let columns = width / (max_length + padding); | ||
| let mut tw = TabWriter::new(writer).padding(padding as usize); | ||
| // TODO: Determine table width/height and calculate iteration better | ||
| let mut _row = 0; |
There was a problem hiding this comment.
Leave a note here about what we are planning on using row for.
| return; | ||
| } | ||
|
|
||
| // HACK: There's got to be a cleaner way. |
|
First pass review done. Overall, I think the only big open question is how to decouple Also, as usual, error handling could be better. |
Specifically, this does not look to implement everything in #48, though I do hope to get completion working in a somewhat basic state before I move on to making things line up for the modern language. It's worth thinking about how this influences the design though.
The primary goal of this PR is to reintegrate the REPL module and start solidifying it. Unfortunately that means we are back to dealing with #20 which this reverts the partial fix for in a PR it should never have landed in to begin with: #51.
fixes #42
reopens #20