OC-3717 Can move cursor inside the placeholder if it came in it from the upper/bottom line

This commit is contained in:
Maxim Shafirov
2012-04-19 20:32:16 +04:00
parent ebb72ee3d5
commit 88aa20e791
2 changed files with 3 additions and 4 deletions
@@ -619,12 +619,12 @@ public class EditorActionUtil {
selectNonexpandableFold(editor);
}
private final static Key<LogicalPosition> PREV_POS = Key.create("PREV_POS");
private final static Key<VisualPosition> PREV_POS = Key.create("PREV_POS");
public static void selectNonexpandableFold(Editor editor) {
final CaretModel caretModel = editor.getCaretModel();
final LogicalPosition pos = caretModel.getLogicalPosition();
final VisualPosition pos = caretModel.getVisualPosition();
LogicalPosition prevPos = editor.getUserData(PREV_POS);
VisualPosition prevPos = editor.getUserData(PREV_POS);
if (prevPos != null) {
int columnShift = pos.line == prevPos.line ? pos.column - prevPos.column : 0;
@@ -196,7 +196,6 @@ public class CaretModelImpl implements CaretModel, PrioritizedDocumentListener,
for (CaretListener listener : myCaretListeners) {
listener.caretPositionChanged(event);
}
EditorActionUtil.selectNonexpandableFold(myEditor);
}
}