Open deadgander opened 1 year ago
Hi, thanks for the PR.
but what if the caret is placed at the start of the line and no selection is made. this would cause the upper line being duplicated, also if this happens at offset 0
this may produce an exception...
The end is never less than start no matter which direction the selection is made. Therefore when the caret (end) is at offset 0, start will also be zero and it will not enter the branch that contains my change. When at the start of a line, start and end are the same so it also does not enter that branch.
However, I had seen an odd selection issue after performing Duplicate Lines Up, where it highlights the original and duplicated lines. I wrongly assumed this was not my fault but it did not happen before. I need to correct the caret and/or selection during the DUplicate Lines Up action.
aha, looking forward to seeing the next updates...
thanks
I have updated both duplicateUp and duplicateDown to reset the caret position and selection after the text is inserted.
This is my first time working with Kotlin or contributing to an open soruce project so I hope it is okay.
Move end position back one character to avoid last line being duplicated when the end cursor/selection position is at the start of the line.
This is to address issue 105.