Skip to content

Commit

Permalink
Refactor MatchedPath to return chunks of absolute (#125)
Browse files Browse the repository at this point in the history
`MatchedPath` can return chunks of `absolute`, so I refactored the
implementation.

In addition, I added `truncated_absolute` to allow us to get an absolute
path truncated within the window.
  • Loading branch information
yykamei authored Jul 11, 2021
1 parent 5194d6d commit f132ada
Show file tree
Hide file tree
Showing 2 changed files with 171 additions and 85 deletions.
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ fn output_on_terminal(
queue!(stdout, style::Print(prefix))?;

let max_columns: usize = max_columns as usize - 2; // The prefix "> " requires 2 columns.
for chunk in path.chunks(max_columns) {
for chunk in path.relative_chunks(max_columns) {
if chunk.matched() {
queue!(
stdout,
Expand Down
Loading

0 comments on commit f132ada

Please sign in to comment.