Search

Single line copy doesn't work as expected when word wrapping is enabled by James Paul

Closed
as Won't Fix Help for as Won't Fix

2
0
Sign in
to vote
Type: Bug
ID: 540212
Opened: 3/8/2010 5:11:54 PM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
I like to use word wrap because I don't use new lines where it doesn't make sense. So, some lines may be wider than the screen. Now to avoid scrolling which is not an ergonomic friendly act, I enable the word wrap feature for all types of languages. You can enable this by going to Tools -> Options -> Text Editor -> All Languages. The option is "Word Wrap". I also enable the "Show visual glyphs for word wrap" option to recognize the places where the word wrapping occurs. All good.

The bug is when I try to copy the line that is wrapped using the keyboard shortcut for single line copy. You can copy the content of the current line Visual Studio by just clicking the copy button or just CTRL + C. When I do this on a wrapped line, it only copies the first line of the wrapped text. Even though content is technically a single line, the copy mechanism seems not getting it.

The line selection also works the same way. When I select the complete line by keeping the cursor at the beginning of the line and press SHIFT+DOWN, it is supposed to select the whole line. When I enable the word wrap, it doesn't.

The argument against the argument that it should select only what is visually on the same line is that what is visually on the same line is irrelevant to developer. When I make a line copy, I almost never want something wrapped to be left out of the selection and copy. Wrapping is a function of the available screen width and a line selection based on that doesn't make sense.
Details (expand)

Product Language

English

Version

Visual Studio 2010 Beta 2

Operating System

Windows 7

Operating System Language

English

Steps to Reproduce

1. Enable word wrapping by going to Tools -> Options -> Text Editor -> All Languages. The option is "Word Wrap" for a language or all languages.
2. Open a file in that language.
3. Create a line that will wrap.
4. Press CTRL + C
5. Paste using CTRL + V
6. Go back to the beginning of line that is wrapped.
7. Press SHIFT + DOWN

Actual Results

CTRL+C copies only the parts of the line before it is wrapped.
SHIFT+DOWN also selects only the parts of the line before it is wrapped.

Expected Results

In both cases, the whole line (until it encounters CR/LF) should be selected or copied.
      You can indicate your satisfaction with how Microsoft handled this issue by completing this quick 3 question survey. [Details]

 

File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 3/12/2010 at 4:49 PM
Hi jamespaulp,

Thank you for reporting this issue. There's an interesting question with word wrap about whether commands that use the concept of a "line" (e.g. copy current line) should operate on a line in the *view*, which is the current VS behavior, or a line in the *buffer*, which is your suggested behavior. There are merits to both, and users' opinions tend to differ on this matter. We aren't planning to change this in the short time before VS 2010 RTM, so I'm resolving it as Won't Fix for the current release, but this issue will remain in our database to be revisited for a future version of Visual Studio.

Thanks for trying Visual Studio 2010 and sending your feedback!

Brittany Behrens
Program Manager, VS Platform - Editor
http://blogs.msdn.com/visualstudio
Posted by Microsoft on 3/8/2010 at 6:51 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.

Thank you
Sign in to post a workaround.