Skip to content

Diff: disable selecting line numbers#1418

Merged
RMacfarlane merged 1 commit intomicrosoft:masterfrom
emtei:disable-selecting-line-numbers-in-diff
Oct 28, 2019
Merged

Diff: disable selecting line numbers#1418
RMacfarlane merged 1 commit intomicrosoft:masterfrom
emtei:disable-selecting-line-numbers-in-diff

Conversation

@emtei
Copy link
Contributor

@emtei emtei commented Oct 26, 2019

Fixes: #354

This PR:
Splits line content into: LineNumber, diffTypeSign and lineContent
Sets user-select: none; for everything that is not a lineContent
Removes some duplicated code from diff.tsx file

I'm not so proud of using private _raw field but i was unable to use DiffLine methods.

@msftclas
Copy link

msftclas commented Oct 26, 2019

CLA assistant check
All CLA requirements met.

Copy link
Contributor

@RMacfarlane RMacfarlane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thank you!

The DiffLine methods were stripped when data was passed from the extension to the webview, since JSON.stringify is used, so the typing is a bit wrong in that context. I think _raw is OK to use since that's the only way to get the data. Perhaps we can update the typings in the future

@RMacfarlane RMacfarlane merged commit 0497f6e into microsoft:master Oct 28, 2019
@emtei emtei deleted the disable-selecting-line-numbers-in-diff branch October 28, 2019 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide a way to select only code

3 participants