mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-86397 Delete line (Ctrl+Y) moves caret to the 1st column position
Correct 'duplicate lines' processing in case of the last line
This commit is contained in:
@@ -85,8 +85,10 @@ public class DuplicateAction extends EditorAction {
|
||||
final int lineToCheck = nextLineStart.line - 1;
|
||||
|
||||
int newOffset = end + offset - start;
|
||||
if(lineToCheck == document.getLineCount () /*empty document*/ ||
|
||||
document.getLineSeparatorLength(lineToCheck) == 0) {
|
||||
if(lineToCheck == document.getLineCount () /* empty document */
|
||||
|| nextLineStart.line == document.getLineCount() - 1 /* last line*/
|
||||
|| document.getLineSeparatorLength(lineToCheck) == 0)
|
||||
{
|
||||
s = "\n"+s;
|
||||
newOffset++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user