Skip to content

Copy on Select ignore trailing whitespaces #6869

Open
@david50407

Description

@david50407

Description of the new feature/enhancement

While copying on select, auto ignore trailing whitespaces on each line.

Why?

In my .vimrc, I draw 80 column and 120 column line via background color like this:

image

function! SetColumnWarnOnResized()
  highlight Normal ctermbg=NONE
  if &columns > 120
    let &colorcolumn="81,".join(range(120, &columns), ",") " Set the column warns on 80 and 120+
  else
    let &colorcolumn="81" " Set the column warns on 80
  endif
endfunction
au VimResized * call SetColumnWarnOnResized()
call SetColumnWarnOnResized()     

When I select and copy these words in the screenshot above, Windows Terminal will fill my clipboard with many whitespaces like this (notice that wired whitespaces):

Some texts here...
And here...                                                                                                                                                         Notice the 80 col line in my vim --------------------------------------------->
And the 120 col line ================================================================================================>       

And this only happend sometimes (not always), I don't know if this is a bug?

Related issues

This issues may relatives to these issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-TerminalControlIssues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)Issue-BugIt either shouldn't be doing this or needs an investigation.Priority-2A description (P2)Product-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions