Skip to content
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

Do not include last line in Duplicate Lines Down when cursor at start of line #105

Open
deadgander opened this issue Jul 31, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@deadgander
Copy link

Duplicate Lines Down behaves slightly differently to other editors (Eclipse, VS Code) in a way that seems strange.

Given the example text:

abc
def
ghi
jkl

To duplicate the middle two lines, I would position the cursor at the start of abc and then *shift+down twice to highlight abc and ghi. The cursor is positioned at the start (left) of jkl. Performing Duplicate Lines Down at this point will duplicate def, ghi and jkl. Other editors tend to not duplicate the last line when the cursor is at the start of the line.

I have locally changed DuplicateAction.kt, adding - 1 to the endLine.
endingLine = document.getLineNumber(end - 1)

This seems to sort it but I haven't fully tested it (selecting from down to up, or performing Duplicate Lines Up).

Could this be changed or made configurable?

As an aside, this plug-in was recommend to me by Jet Brains as not having Duplicate Lines Up was stopping me from moving to their IDEs. Thank you for this plug-in.

@MohammadMD1383 MohammadMD1383 added the enhancement New feature or request label Aug 1, 2023
@MohammadMD1383
Copy link
Owner

Hi, thanks for filling out this issue.
You're right, I will try to fix it as soon as I can, but till then if you could fix it, I would be happy to merge your PR!

And I'm glad that my plugin could help someone... !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants