コード例 #1
0
 public void execute(jetbrains.mps.openapi.editor.EditorContext context) {
   EditorCell selectedCell = getDeepestSelectedCell(context);
   int caretX = selectedCell.getCaretX();
   EditorComponent editorComponent = (EditorComponent) context.getEditorComponent();
   if (editorComponent.hasLastCaretX()) {
     caretX = editorComponent.getLastCaretX();
   }
   editorComponent.saveLastCaretX(caretX);
   EditorCell target = findTarget(selectedCell, caretX);
   target.setCaretX(caretX);
   editorComponent.changeSelection(target, false);
 }
コード例 #2
0
 public boolean canExecute(jetbrains.mps.openapi.editor.EditorContext context) {
   EditorCell selectedCell = getDeepestSelectedCell(context);
   return selectedCell != null && findTarget(selectedCell, selectedCell.getCaretX()) != null;
 }