Skip to content

Diff: disable selecting line numbers - #1418

Merged
Rachel Macfarlane (RMacfarlane) merged 1 commit into
microsoft:masterfrom
emtei:disable-selecting-line-numbers-in-diff
Oct 28, 2019
Merged

Diff: disable selecting line numbers#1418
Rachel Macfarlane (RMacfarlane) merged 1 commit into
microsoft:masterfrom
emtei:disable-selecting-line-numbers-in-diff

Conversation

@emtei

@emtei Mateusz Stopka (emtei) commented Oct 26, 2019

Copy link
Copy Markdown
Contributor

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

Microsoft Contribution License Agreements (msftclas) commented Oct 26, 2019

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

Copy link
Copy Markdown
Contributor

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
Rachel Macfarlane (RMacfarlane) merged commit 0497f6e into microsoft:master Oct 28, 2019
@emtei
Mateusz Stopka (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