Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: Copy in TextDiffView may lost the last line #1044

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gadfly3173 wants to merge 1 commit into sourcegit-scm:develop from gadfly3173:fix/copy-text

Conversation

Copy link
Contributor

@gadfly3173 gadfly3173 commented Mar 3, 2025
edited
Loading

Reproduce: Press Ctrl + A in TextDiffView and copy

love-linger added a commit that referenced this pull request Mar 3, 2025
...lines in text diff view (#1044)
Signed-off-by: leo <longshuang@msn.cn>
Copy link
Collaborator

I've pushed another fix for this issue. See commit 35ee4a4

Copy link
Contributor Author

image
I think that make the issue worse.

Copy link
Collaborator

Very strange.
image

Copy link
Collaborator

The reason of this issue is:

When clamp startIdx and endIdx to [0, lines.Count - 1], the endPosition.Column and startPosition.Column may no longer refer to the row corresponding to endIdx/startIdx

Copy link
Collaborator

I can not re-produce the issue shows in your picture.

Copy link
Contributor Author

Run from the code is fine, but the artifacts in CI seems not right.

Copy link
Collaborator

Try to use Copy context menu instead of hotkey Ctrl+C which sometimes did not work as expacted.

Copy link
Contributor Author

gadfly3173 commented Mar 3, 2025
edited
Loading

Try to use Copy context menu instead of hotkey Ctrl+C which sometimes did not work as expacted.

With the CI artifacts, the copy in context menu also not right, that's weird. I'm using Deepin 23 with linux-x64

Copy link
Collaborator

I'll download it and try

Copy link
Collaborator

Strange. The package.win-x64.zip works as expacted on my PC.

Copy link
Collaborator

love-linger commented Mar 3, 2025
edited
Loading

Please make sure you have downloaded the correct version:
image

Copy link
Contributor Author

I am sure that I downloaded linux-x64 from https://github.com/sourcegit-scm/sourcegit/actions/runs/13625760977, and run dotnet publish locally will also produce the effect shown in the picture.

Copy link
Collaborator

Can you debug this project now?

Copy link
Contributor Author

After I reinstalled the deb/copied the locally packaged files several times, it finally worked, and I had no idea what the problem was.

love-linger reacted with thumbs up emoji

@gadfly3173 gadfly3173 deleted the fix/copy-text branch March 3, 2025 08:42
Copy link
Contributor Author

Currently, copy would append an extra empty line if more than one line is selected.

Copy link
Collaborator

Currently, copy would append an extra empty line if more than one line is selected.

It's because that for multiple lines selection, we use StringBuilder.AppendLine which will always add a line-ending character for each line.

Copy link
Contributor Author

I made #1049 to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /