ryu1kn / vscode-partial-diff

Visual Studio Code Extension. Take a diff of 2 parts of text(s)
https://marketplace.visualstudio.com/items?itemName=ryu1kn.partial-diff
MIT License
186 stars 16 forks source link

Compare text with clipboard doesn't work #19

Closed AlexMax closed 6 years ago

AlexMax commented 6 years ago

Just what it says on the tin. Opening developer tools while trying to use Compare text with clipboard does not open a diff window and instead gives me this error message:

console.ts:123 [Extension Host] TypeError: Cannot read property 'length' of undefined
    at TextTitleBuilder._lineRangesSuffix (/Users/alex/.vscode/extensions/ryu1kn.partial-diff-0.5.0/lib/text-title-builder.js:12:26)
    at TextTitleBuilder.build (/Users/alex/.vscode/extensions/ryu1kn.partial-diff-0.5.0/lib/text-title-builder.js:7:29)
    at DiffPresenter._buildTextTitle (/Users/alex/.vscode/extensions/ryu1kn.partial-diff-0.5.0/lib/diff-presenter.js:33:39)
    at DiffPresenter._buildTitle (/Users/alex/.vscode/extensions/ryu1kn.partial-diff-0.5.0/lib/diff-presenter.js:24:29)
    at DiffPresenter.takeDiff (/Users/alex/.vscode/extensions/ryu1kn.partial-diff-0.5.0/lib/diff-presenter.js:19:28)
    at CompareSelectionWithClipboardCommand.execute (/Users/alex/.vscode/extensions/ryu1kn.partial-diff-0.5.0/lib/commands/compare-selection-with-clipboard.js:22:39)
    at <anonymous>

I'm using VSCode 1.18.1 and version 0.5.0 of Partial Diff.

ryu1kn commented 6 years ago

Oh wow. I could reproduce it. Thanks for reporting it!

Steps to reproduce

  1. Copy a text
  2. Select a text in a editor
  3. Open the right click menu and select Compare text with clipboard
  4. Get the error log reported above

OS X 10.12.6, VSCode 1.18.1, Partial Diff 0.5.0

ryu1kn commented 6 years ago

Fix released as v0.5.1. Can you confirm that it's fixed? @AlexMax

AlexMax commented 6 years ago

Back to working again. Thank you!

ryu1kn commented 6 years ago

No worries, thanks again for reporting it!!