diff options
author | Steve Blundy <sblundy@users.noreply.github.com> | 2018-12-15 13:33:33 -0800 |
---|---|---|
committer | Christian Duerr <chrisduerr@users.noreply.github.com> | 2018-12-15 21:33:33 +0000 |
commit | 0c3e28617a95b4ca30ad9bdbb9114f1e4d41dce5 (patch) | |
tree | 59d5afe96a755910aba3804a7a84e3b299c49222 /src/renderer | |
parent | 21f888ec4149e3078830dfcf9a17adda0ec7623a (diff) | |
download | alacritty-0c3e28617a95b4ca30ad9bdbb9114f1e4d41dce5.tar.gz alacritty-0c3e28617a95b4ca30ad9bdbb9114f1e4d41dce5.zip |
Fixing tabs in copy-paste
This resolves issues with copy-pasting tabs by including them in the
pasted string.
Selection of tabs is still inconsistent with what might be expected
based on other terminal emulators, however the behavior hasn't
regressed.
This fixes https://github.com/jwilm/alacritty/issues/219.
Diffstat (limited to 'src/renderer')
-rw-r--r-- | src/renderer/mod.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs index 02d31524..5d7a661f 100644 --- a/src/renderer/mod.rs +++ b/src/renderer/mod.rs @@ -884,12 +884,17 @@ impl<'a> RenderApi<'a> { }; // Don't render text of HIDDEN cells - let chars = if cell.flags.contains(cell::Flags::HIDDEN) { + let mut chars = if cell.flags.contains(cell::Flags::HIDDEN) { [' '; cell::MAX_ZEROWIDTH_CHARS + 1] } else { cell.chars }; + // Render tabs as spaces in case the font doesn't support it + if chars[0] == '\t' { + chars[0] = ' '; + } + let mut glyph_key = GlyphKey { font_key, size: glyph_cache.font_size, |