/** * Sets the keeping visual mode visual operator action flag for the editor. */ public static void setKeepingVisualOperatorAction(@NotNull Editor editor, boolean value) { editor.putUserData(IS_KEEPING_VISUAL_OPERATOR_ACTION, value); }
/** * Indicate that the next down move should be ignored. */ public static void ignoreNextMove(@NotNull Editor editor) { editor.putUserData(IGNORE_NEXT_MOVE, true); }
/** * Sets the visual block mode flag in the beginning of handling visual operator actions */ public static void setWasVisualBlockMode(@NotNull Editor editor, boolean value) { editor.putUserData(WAS_VISUAL_BLOCK_MODE, value); }
/** * Sets the visual block offset for the editor. * * @param editor The editor */ public static void setVisualBlockOffset(@NotNull Editor editor, int visualBlockOffset) { editor.putUserData(VISUAL_BLOCK_OFFSET, visualBlockOffset); }
/** * Sets the visual block start for the editor. * * @param editor The editor */ public static void setVisualBlockStart(@NotNull Editor editor, int visualBlockStart) { editor.putUserData(VISUAL_BLOCK_START, visualBlockStart); }
/** * Sets the visual block end for the editor. * * @param editor The editor */ public static void setVisualBlockEnd(@NotNull Editor editor, int visualBlockEnd) { editor.putUserData(VISUAL_BLOCK_END, visualBlockEnd); }
/** * Indicate that the next down move should not be ignored. */ public static void dontIgnoreNextMove(@NotNull Editor editor) { editor.putUserData(IGNORE_NEXT_MOVE, false); }
public static void setLastHighlights(@NotNull Editor editor, Collection<RangeHighlighter> highlights) { editor.putUserData(LAST_HIGHLIGHTS, highlights); }
public static void setEditorGroup(@NotNull Editor editor, boolean value) { editor.putUserData(EDITOR_GROUP, value); }
public static void setTestInputModel(@NotNull Editor editor, @NotNull TestInputModel model) { editor.putUserData(TEST_INPUT_MODEL, model); } }
public static void setLastSearch(@NotNull Editor editor, String search) { editor.putUserData(LAST_SEARCH, search); }
public static void setMotionGroup(@NotNull Editor editor, boolean adapter) { editor.putUserData(MOTION_GROUP, adapter); }
public static void setChangeGroup(@NotNull Editor editor, boolean adapter) { editor.putUserData(CHANGE_GROUP, adapter); }
public static void setLineNumbersShown(@NotNull Editor editor, boolean value) { editor.putUserData(LINE_NUMBERS_SHOWN, value); }
/** * Sets the last caret used in down movement. */ public static void setLastDownCaret(@NotNull Editor editor, @NotNull Caret caret) { editor.putUserData(LAST_DOWN_CARET, caret); }
/** * This is used to clean up editors whenever they are closed. * * @param editor The editor to cleanup */ public static void unInitializeEditor(@NotNull Editor editor) { if (logger.isDebugEnabled()) logger.debug("editor closed: " + editor); editor.putUserData(COMMAND_STATE, null); editor.putUserData(LAST_HIGHLIGHTS, null); editor.putUserData(LAST_SELECTION_TYPE, null); editor.putUserData(LAST_VISUAL_RANGE, null); editor.putUserData(MORE_PANEL, null); editor.putUserData(EX_OUTPUT_MODEL, null); }
/** * Sets the mode to which the editor should switch after a change/visual action. */ public static void setChangeSwitchMode(@NotNull Editor editor, @Nullable CommandState.Mode mode) { editor.putUserData(CHANGE_ACTION_SWITCH_MODE, mode); }
public static void setExOutputModel(@NotNull Editor editor, @NotNull ExOutputModel model) { editor.putUserData(EX_OUTPUT_MODEL, model); }
public static void setMorePanel(@NotNull Editor editor, @NotNull ExOutputPanel panel) { editor.putUserData(MORE_PANEL, panel); }
private MyFontMetrics getFontMetrics(Editor editor) { String familyName = UIManager.getFont("Label.font").getFamily(); int size = (int)(Math.max(1, editor.getColorsScheme().getEditorFontSize() - 1) * factor); MyFontMetrics metrics = editor.getUserData(HINT_FONT_METRICS); if (metrics != null && !metrics.isActual(editor, familyName, size)) { metrics = null; } if (metrics == null) { metrics = new MyFontMetrics(editor, familyName, size); editor.putUserData(HINT_FONT_METRICS, metrics); } return metrics; }