/** * Reset the selected register back to the default register. */ public void resetRegister() { lastRegister = defaultRegister; logger.debug("register reset"); }
public ToggleInsertReplaceAction() { super(ToggleInsertReplace); logger.debug("ToggleInsertReplaceAction()"); }
/** * This is used to initialize each new editor that gets created. * * @param editor The editor to initialize */ public static void initializeEditor(Editor editor) { if (logger.isDebugEnabled()) logger.debug("editor created: " + editor); }
@NotNull private String processKey(String key, int start, int end) { if (logger.isDebugEnabled()) { logger.debug("process " + key + " " + start + "," + end); } StringBuilder res = new StringBuilder(); res.append(" # ").append(key).append(" ").append("history\n"); String spaces = " "; List<HistoryGroup.HistoryEntry> entries = VimPlugin.getHistory().getEntries(key, start, end); for (HistoryGroup.HistoryEntry entry : entries) { String num = Integer.toString(entry.getNumber()); res.append(spaces.substring(num.length())).append(num).append(" ").append(entry.getEntry()).append("\n"); } return res.toString(); }
public static void runWriteCommand(@Nullable Project project, @NotNull Runnable cmd, @Nullable String name, @Nullable Object groupId) { if (logger.isDebugEnabled()) { logger.debug("write command " + cmd); } CommandProcessor.getInstance().executeCommand(project, new WriteAction(cmd), name, groupId); }
public static void runReadCommand(@Nullable Project project, @NotNull Runnable cmd, @Nullable String name, @Nullable Object groupId) { if (logger.isDebugEnabled()) { logger.debug("read command " + cmd); } CommandProcessor.getInstance().executeCommand(project, new ReadAction(cmd), name, groupId); }
/** * Invoked when an action occurs. */ public void actionPerformed(ActionEvent e) { logger.debug("actionPerformed"); ExTextField target = (ExTextField)getTextComponent(e); target.toggleInsertReplace(); } }
public void saveData(@NotNull Element element) { logger.debug("saveData"); Element hist = new Element("history"); saveData(hist, SEARCH); saveData(hist, COMMAND); saveData(hist, EXPRESSION); saveData(hist, INPUT); element.addContent(hist); }
protected void processKeyEvent(KeyEvent e) { if (logger.isDebugEnabled()) logger.debug("key=" + e); super.processKeyEvent(e); }
public void addEntry(String key, @NotNull String text) { if (logger.isDebugEnabled()) { logger.debug("Add entry '" + text + "' to " + key); } HistoryBlock block = blocks(key); block.addEntry(text); }
@Nullable private static String getGaeExecutablePath(@NotNull String sdkHomePath) { String goExecutablePath = PathUtil.toSystemIndependentName(sdkHomePath); goExecutablePath = StringUtil.trimEnd(goExecutablePath, GoConstants.APP_ENGINE_GO_ROOT_DIRECTORY_PATH); boolean gcloudInstallation = goExecutablePath.endsWith(GoConstants.GCLOUD_APP_ENGINE_DIRECTORY_PATH); if (gcloudInstallation) { LOG.debug("Detected gcloud GAE installation at " + goExecutablePath); goExecutablePath = FileUtil.join(StringUtil.trimEnd(goExecutablePath, GoConstants.GCLOUD_APP_ENGINE_DIRECTORY_PATH), "bin"); } String executablePath = FileUtil.join(goExecutablePath, GoEnvironmentUtil.getGaeExecutableFileName(gcloudInstallation)); return new File(executablePath).exists() ? executablePath : null; }
public void readData(@NotNull Element element) { logger.debug("readData"); Element hist = element.getChild("history"); if (hist == null) { return; } readData(hist, SEARCH); readData(hist, COMMAND); readData(hist, EXPRESSION); readData(hist, INPUT); }
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull ExCommand cmd) throws ExException { String arg = cmd.getArgument(); if (logger.isDebugEnabled()) { logger.debug("arg=" + arg); } return VimPlugin.getDigraph().parseCommandLine(editor, cmd.getArgument()); }
/** * Fetches the set of commands that can be used * on a text component that is using a model and * view produced by this kit. * * @return the set of actions */ public Action[] getActions() { Action[] res = TextAction.augmentList(super.getActions(), this.exActions); if (logger.isDebugEnabled()) logger.debug("res.length=" + res.length); return res; }
private static void resetCursor(@NotNull VirtualFile virtualFile, Project proj, boolean insert) { logger.debug("resetCursor"); Document doc = FileDocumentManager.getInstance().getDocument(virtualFile); if (doc == null) return; // Must be no text editor (such as image) Editor[] editors = EditorFactory.getInstance().getEditors(doc, proj); if (logger.isDebugEnabled()) { logger.debug("There are " + editors.length + " editors for virtual file " + virtualFile.getName()); } for (Editor editor : editors) { editor.getSettings().setBlockCursor(!insert); } }
public void postKey(@NotNull KeyStroke stroke, @NotNull Editor editor) { final Component component = SwingUtilities.getAncestorOfClass(Window.class, editor.getComponent()); final KeyEvent event = createKeyEvent(stroke, component); ApplicationManager.getApplication().invokeLater(() -> { if (logger.isDebugEnabled()) { logger.debug("posting " + event); } Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(event); }); }
/** * 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); }
public void actionPerformed(ActionEvent actionEvent) { logger.debug("complete entry"); KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0); KeyHandler.getInstance().handleKey( ExEntryPanel.getInstance().getEntry().getEditor(), stroke, ExEntryPanel.getInstance().getEntry().getContext()); } }
/** * This event indicates that a document is about to be changed. We use this event to update all the * editor's marks if text is about to be deleted. * * @param event The change event */ public void beforeDocumentChange(@NotNull DocumentEvent event) { if (!VimPlugin.isEnabled()) return; if (logger.isDebugEnabled()) logger.debug("MarkUpdater before, event = " + event); if (event.getOldLength() == 0) return; Document doc = event.getDocument(); updateMarkFromDelete(getAnEditor(doc), VimPlugin.getMark().getAllFileMarks(doc), event.getOffset(), event.getOldLength()); // TODO - update jumps }