mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixed IDEA-111701 Emacs: pressing Ctrl+k several times should add lines to muti-line buffer
(regression for IDEA-18764, broken in IDEA-111275) moveToLogicalPosition and moveToVisualPosition in CaretModel sometimes doesn't actually move caret and used to perform softwrap adjustment on document changes
This commit is contained in:
@@ -152,7 +152,7 @@ public class CaretModelImpl implements CaretModel, PrioritizedDocumentListener,
|
||||
if (myReportCaretMoves) {
|
||||
LogMessageEx.error(LOG, "Unexpected caret move request");
|
||||
}
|
||||
if (!myEditor.isStickySelection()) {
|
||||
if (!myEditor.isStickySelection() && !pos.equals(myVisibleCaret)) {
|
||||
CopyPasteManager.getInstance().stopKillRings();
|
||||
}
|
||||
|
||||
@@ -441,7 +441,7 @@ public class CaretModelImpl implements CaretModel, PrioritizedDocumentListener,
|
||||
if (myReportCaretMoves) {
|
||||
LogMessageEx.error(LOG, "Unexpected caret move request");
|
||||
}
|
||||
if (!myEditor.isStickySelection()) {
|
||||
if (!myEditor.isStickySelection() && !pos.equals(myLogicalCaret)) {
|
||||
CopyPasteManager.getInstance().stopKillRings();
|
||||
}
|
||||
|
||||
|
||||
+13
@@ -108,4 +108,17 @@ public class KillToWordEndActionTest extends LightPlatformCodeInsightTestCase {
|
||||
Object string = contents.getTransferData(DataFlavor.stringFlavor);
|
||||
assertEquals(" second", string);
|
||||
}
|
||||
|
||||
public void testSubsequentKills() throws Exception {
|
||||
String text = "<caret>first second third";
|
||||
configureFromFileText(getTestName(false) + ".txt", text);
|
||||
killToWordEnd();
|
||||
killToWordEnd();
|
||||
checkResultByText(" third");
|
||||
|
||||
Transferable contents = CopyPasteManager.getInstance().getContents();
|
||||
assertTrue(contents instanceof KillRingTransferable);
|
||||
Object string = contents.getTransferData(DataFlavor.stringFlavor);
|
||||
assertEquals("first second", string);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user