/** * Sets the visual offset for the caret. */ public static void setVisualOffset(@NotNull Caret caret, int visualOffset) { caret.putUserData(VISUAL_OFFSET, visualOffset); }
/** * Sets the visual block start for the caret. */ public static void setVisualStart(@NotNull Caret caret, int visualStart) { caret.putUserData(VISUAL_START, visualStart); }
/** * Sets the visual block end for the caret. */ public static void setVisualEnd(@NotNull Caret caret, int visualEnd) { caret.putUserData(VISUAL_END, visualEnd); }
/** * Set the insertion start for the caret */ public static void setInsertStart(@NotNull Caret caret, int insertStart) { caret.putUserData(INSERT_START, insertStart); }
/** * Sets the previous last column. */ public static void setPreviousLastColumn(@NotNull Caret caret, int prevLastColumn) { caret.putUserData(PREV_LAST_COLUMN, prevLastColumn); }
/** * Sets the flag determining that a caret was in the first line before inserting a new line above. */ public static void setWasInFirstLine(@NotNull Caret caret, boolean value) { caret.putUserData(WAS_IN_FIRST_LINE, value); }
/** * Sets the text range for current visual operator action. */ public static void setVisualTextRange(@NotNull Caret caret, @Nullable TextRange range) { caret.putUserData(VISUAL_TEXT_RANGE, range); }
/** * Sets the previous visual operator range on the caret. */ public static void setLastVisualOperatorRange(@NotNull Caret caret, @NotNull VisualChange range) { caret.putUserData(VISUAL_OP, range); }
/** * Sets the visual change for current visual operator action. */ public static void setVisualChange(@NotNull Caret caret, @Nullable VisualChange visualChange) { caret.putUserData(VISUAL_CHANGE, visualChange); }
/** * Sets the last column for this caret in this editor * * @param col The column * @param caret The caret * @param editor The editor */ public static void setLastColumn(@NotNull Editor editor, @NotNull Caret caret, int col) { boolean previousWasDollar = getLastColumn(caret) >= MotionGroup.LAST_COLUMN; boolean currentIsDollar = col >= MotionGroup.LAST_COLUMN; if (!CommandState.inVisualBlockMode(editor)) { caret.putUserData(LAST_COLUMN, col); } else { editor.getCaretModel().getPrimaryCaret().putUserData(LAST_COLUMN, col); } if (previousWasDollar != currentIsDollar && CommandState.inVisualBlockMode(editor)) { VimPlugin.getMotion().updateBlockSelection(editor); } }