mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-08-17 16:31:45 +02:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
120b69c439 | ||
![]() |
b68daf3f3e | ||
![]() |
c32a1a5e5b | ||
![]() |
a5e303d1ca | ||
![]() |
c4d8cef44d | ||
![]() |
72fbe758b4 | ||
![]() |
563092cffb | ||
![]() |
9a2a0c3b0e |
@@ -39,6 +39,7 @@ Contributors:
|
||||
* [Daniel Leong](mailto:falcone88@gmail.com)
|
||||
* [Aleksey Lagoshin](mailto:aleksey@pri-num.com)
|
||||
* [Paulo Bu](mailto:pbu_98@yahoo.com)
|
||||
* [Giorgos Gaganis](mailto:gaganis@yahoo.com)
|
||||
|
||||
If you are a contributor and your name is not listed here, feel free to
|
||||
contact the maintainer.
|
||||
|
13
CHANGES.md
13
CHANGES.md
@@ -16,8 +16,17 @@ It is important to distinguish EAP from traditional pre-release software.
|
||||
Please note that the quality of EAP versions may at times be way below even
|
||||
usual beta standards.
|
||||
|
||||
To Be Released
|
||||
--------------
|
||||
|
||||
0.48, 2017-01-15
|
||||
----------------
|
||||
|
||||
A bugfix release.
|
||||
|
||||
Bug fixes:
|
||||
|
||||
* [VIM-1205](https://youtrack.jetbrains.com/issue/VIM-1205) Don't move key handling into separate event for raw handlers
|
||||
* [VIM-1216](https://youtrack.jetbrains.com/issue/VIM-1216) Fixed `.` resetting the last find movement while repeating change that also uses movement
|
||||
|
||||
|
||||
0.47, 2016-10-19
|
||||
----------------
|
||||
|
@@ -38,7 +38,7 @@ intellij {
|
||||
downloadSources Boolean.valueOf(downloadIdeaSources)
|
||||
|
||||
publish {
|
||||
channels publishChannels
|
||||
channels publishChannels.split(',')
|
||||
username publishUsername
|
||||
password publishPassword
|
||||
}
|
||||
|
@@ -2,6 +2,10 @@
|
||||
<name>IdeaVim</name>
|
||||
<id>IdeaVIM</id>
|
||||
<change-notes><![CDATA[
|
||||
<p>0.48:</p>
|
||||
<ul>
|
||||
<li>Various bug fixes</li>
|
||||
</ul>
|
||||
<p>0.47:</p>
|
||||
<ul>
|
||||
<li>Various bug fixes</li>
|
||||
@@ -22,20 +26,6 @@
|
||||
<ul>
|
||||
<li>Fixed running the plugin with Java 6</li>
|
||||
</ul>
|
||||
<p>0.42:</p>
|
||||
<ul>
|
||||
<li>Fixed move commands in read-only files</li>
|
||||
</ul>
|
||||
<p>0.41:</p>
|
||||
<ul>
|
||||
<li>Various bug fixes</li>
|
||||
</ul>
|
||||
<p>0.40:</p>
|
||||
<ul>
|
||||
<li>Support for <code>mapleader</code></li>
|
||||
<li>Support comments in <code>%</code> brace matching</li>
|
||||
<li>Various bug fixes</li>
|
||||
</ul>
|
||||
<p>See also the complete <a href="https://github.com/JetBrains/ideavim/blob/master/CHANGES.md">changelog</a>.</p>
|
||||
]]></change-notes>
|
||||
<description><![CDATA[
|
||||
|
@@ -21,7 +21,6 @@ package com.maddyhome.idea.vim;
|
||||
import com.intellij.codeInsight.lookup.Lookup;
|
||||
import com.intellij.codeInsight.lookup.LookupManager;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.TypedActionHandler;
|
||||
@@ -50,18 +49,12 @@ public class VimTypedActionHandler implements TypedActionHandler {
|
||||
@Override
|
||||
public void execute(@NotNull final Editor editor, final char charTyped, @NotNull final DataContext context) {
|
||||
if (isEnabled(editor)) {
|
||||
// Run key handler outside of the key typed command for creating our own undoable commands
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
handler.handleKey(editor, KeyStroke.getKeyStroke(charTyped), new EditorDataContext(editor));
|
||||
}
|
||||
catch (Throwable e) {
|
||||
logger.error(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
try {
|
||||
handler.handleKey(editor, KeyStroke.getKeyStroke(charTyped), new EditorDataContext(editor));
|
||||
}
|
||||
catch (Throwable e) {
|
||||
logger.error(e);
|
||||
}
|
||||
}
|
||||
else {
|
||||
origHandler.execute(editor, charTyped, context);
|
||||
|
@@ -24,7 +24,6 @@ import com.intellij.notification.Notification;
|
||||
import com.intellij.notification.NotificationListener;
|
||||
import com.intellij.notification.NotificationType;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.keymap.KeymapUtil;
|
||||
@@ -99,18 +98,12 @@ public class VimShortcutKeyAction extends AnAction implements DumbAware {
|
||||
notifyAboutShortcutConflict(keyStroke);
|
||||
}
|
||||
// Should we use InjectedLanguageUtil.getTopLevelEditor(editor) here, as we did in former EditorKeyHandler?
|
||||
// Run key handler later to restore input events sequence due to VimTypedActionHandler
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
KeyHandler.getInstance().handleKey(editor, keyStroke, new EditorDataContext(editor));
|
||||
}
|
||||
catch (Throwable throwable) {
|
||||
ourLogger.error(throwable);
|
||||
}
|
||||
}
|
||||
});
|
||||
try {
|
||||
KeyHandler.getInstance().handleKey(editor, keyStroke, new EditorDataContext(editor));
|
||||
}
|
||||
catch (Throwable throwable) {
|
||||
ourLogger.error(throwable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -41,6 +41,7 @@ public class RepeatChangeAction extends EditorAction {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command command) {
|
||||
CommandState state = CommandState.getInstance(editor);
|
||||
Command cmd = state.getLastChangeCommand();
|
||||
|
||||
if (cmd != null) {
|
||||
if (command.getRawCount() > 0) {
|
||||
cmd.setCount(command.getCount());
|
||||
@@ -53,6 +54,9 @@ public class RepeatChangeAction extends EditorAction {
|
||||
}
|
||||
}
|
||||
Command save = state.getCommand();
|
||||
int lastFTCmd = VimPlugin.getMotion().getLastFTCmd();
|
||||
char lastFTChar = VimPlugin.getMotion().getLastFTChar();
|
||||
|
||||
state.setCommand(cmd);
|
||||
state.pushState(CommandState.Mode.REPEAT, CommandState.SubMode.NONE, MappingMode.NORMAL);
|
||||
char reg = VimPlugin.getRegister().getCurrentRegister();
|
||||
@@ -67,6 +71,7 @@ public class RepeatChangeAction extends EditorAction {
|
||||
if (save != null) {
|
||||
state.setCommand(save);
|
||||
}
|
||||
VimPlugin.getMotion().setLastFTCmd(lastFTCmd, lastFTChar);
|
||||
state.saveLastChangeCommand(cmd);
|
||||
VimPlugin.getRegister().selectRegister(reg);
|
||||
|
||||
|
@@ -182,7 +182,7 @@ public class KeyGroup {
|
||||
final KeymapManagerEx keymapManager = KeymapManagerEx.getInstanceEx();
|
||||
final Keymap keymap = keymapManager.getActiveKeymap();
|
||||
final KeyboardShortcut shortcut = new KeyboardShortcut(keyStroke, null);
|
||||
final Map<String, ArrayList<KeyboardShortcut>> conflicts = keymap.getConflicts("", shortcut);
|
||||
final Map<String, ? extends List<KeyboardShortcut>> conflicts = keymap.getConflicts("", shortcut);
|
||||
final List<AnAction> actions = new ArrayList<AnAction>();
|
||||
for (String actionId : conflicts.keySet()) {
|
||||
final AnAction action = ActionManagerEx.getInstanceEx().getAction(actionId);
|
||||
|
@@ -21,6 +21,7 @@ import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.editor.*;
|
||||
import com.intellij.openapi.editor.event.*;
|
||||
import com.intellij.openapi.editor.ex.DocumentEx;
|
||||
import com.intellij.openapi.editor.ex.util.EditorUtil;
|
||||
import com.intellij.openapi.fileEditor.FileEditor;
|
||||
import com.intellij.openapi.fileEditor.FileEditorManagerAdapter;
|
||||
@@ -1728,15 +1729,16 @@ public class MotionGroup {
|
||||
private boolean myMakingChanges = false;
|
||||
|
||||
public void selectionChanged(@NotNull SelectionEvent selectionEvent) {
|
||||
if (myMakingChanges) {
|
||||
final Editor editor = selectionEvent.getEditor();
|
||||
final Document document = editor.getDocument();
|
||||
if (myMakingChanges || (document instanceof DocumentEx && ((DocumentEx)document).isInEventsHandling())) {
|
||||
return;
|
||||
}
|
||||
|
||||
myMakingChanges = true;
|
||||
try {
|
||||
final Editor editor = selectionEvent.getEditor();
|
||||
final com.intellij.openapi.util.TextRange newRange = selectionEvent.getNewRange();
|
||||
for (Editor e : EditorFactory.getInstance().getEditors(editor.getDocument())) {
|
||||
for (Editor e : EditorFactory.getInstance().getEditors(document)) {
|
||||
if (!e.equals(editor)) {
|
||||
e.getSelectionModel().setSelection(newRange.getStartOffset(), newRange.getEndOffset());
|
||||
}
|
||||
@@ -1809,6 +1811,14 @@ public class MotionGroup {
|
||||
private int endOff;
|
||||
}
|
||||
|
||||
public int getLastFTCmd() {
|
||||
return lastFTCmd;
|
||||
}
|
||||
|
||||
public char getLastFTChar() {
|
||||
return lastFTChar;
|
||||
}
|
||||
|
||||
private int lastFTCmd = 0;
|
||||
private char lastFTChar;
|
||||
private int visualStart;
|
||||
|
@@ -572,4 +572,8 @@ public class ChangeActionTest extends VimTestCase {
|
||||
"<caret>\n" +
|
||||
"and some text after\n");
|
||||
}
|
||||
|
||||
public void testRepeatChangeWordDoesNotBreakNextRepeatFind() {
|
||||
doTest(parseKeys("fXcfYPATATA<Esc>fX.;."), "<caret>aaaaXBBBBYaaaaaaaXBBBBYaaaaaaXBBBBYaaaaaaaa\n", "aaaaPATATAaaaaaaaPATATAaaaaaaPATATAaaaaaaaa\n");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user