Skip to content

Commit

Permalink
Remove trailing whitespace from block selection
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremycostanzo committed Dec 18, 2021
1 parent 2538c87 commit 8e58409
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- `ExpandSelection` is now a configurable mouse binding action
- Config option `background_opacity`, you should use `window.opacity` instead
- Reload configuration files when their symbolic link is replaced
- Strip trailing whitespaces when yanking from a block selection

### Fixed

Expand Down
6 changes: 4 additions & 2 deletions alacritty_terminal/src/term/mod.rs
Expand Up @@ -354,14 +354,16 @@ impl<T> Term<T> {

if is_block {
for line in (start.line.0..end.line.0).map(Line::from) {
res += &self.line_to_string(line, start.column..end.column, start.column.0 != 0);
res += self
.line_to_string(line, start.column..end.column, start.column.0 != 0)
.trim_end();

// If the last column is included, newline is appended automatically.
if end.column != self.columns() - 1 {
res += "\n";
}
}
res += &self.line_to_string(end.line, start.column..end.column, true);
res += self.line_to_string(end.line, start.column..end.column, true).trim_end();
} else {
res = self.bounds_to_string(start, end);
}
Expand Down

0 comments on commit 8e58409

Please sign in to comment.