mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-08-17 16:31:45 +02:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e3f57fd647 | ||
![]() |
e074105bde | ||
![]() |
7a8bdfc4fc | ||
![]() |
d765eb74ef | ||
![]() |
ac654d70fa |
10
CHANGES.txt
10
CHANGES.txt
@@ -4,6 +4,16 @@ The Changelog
|
|||||||
History of changes in IdeaVim for the IntelliJ platform.
|
History of changes in IdeaVim for the IntelliJ platform.
|
||||||
|
|
||||||
|
|
||||||
|
0.23.115, 2012-11-14
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
A bugfix release.
|
||||||
|
|
||||||
|
* VIM-318 Fixed executing editor commands for editors not bound to a project
|
||||||
|
* VIM-321 Fixed IOOBE in delete empty range
|
||||||
|
* VIM-112 Delete a single previous word with <C-W> in insert mode, not all inserted words
|
||||||
|
|
||||||
|
|
||||||
0.23.111, 2012-11-12
|
0.23.111, 2012-11-12
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
|
13
index.txt
13
index.txt
@@ -25,6 +25,7 @@ tag char action in Insert mode ~
|
|||||||
enter digraph
|
enter digraph
|
||||||
|i_CTRL-O| CTRL-O execute a single command and return to insert
|
|i_CTRL-O| CTRL-O execute a single command and return to insert
|
||||||
mode
|
mode
|
||||||
|
|i_CTRL-W| CTRL-W delete word before the cursor
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
2. Normal mode *normal-index*
|
2. Normal mode *normal-index*
|
||||||
@@ -45,6 +46,16 @@ tag char note action in Normal mode ~
|
|||||||
({.%#:} only work with put)
|
({.%#:} only work with put)
|
||||||
|/| /{pattern}<CR> 1 search forward for the Nth occurrence of
|
|/| /{pattern}<CR> 1 search forward for the Nth occurrence of
|
||||||
{pattern}
|
{pattern}
|
||||||
|
|count| 0 1 cursor to the first char of the line
|
||||||
|
|count| 1 prepend to command to give a count
|
||||||
|
|count| 2 "
|
||||||
|
|count| 3 "
|
||||||
|
|count| 4 "
|
||||||
|
|count| 5 "
|
||||||
|
|count| 6 "
|
||||||
|
|count| 7 "
|
||||||
|
|count| 8 "
|
||||||
|
|count| 9 "
|
||||||
|F| F{char} 1 cursor to the Nth occurrence of {char} to
|
|F| F{char} 1 cursor to the Nth occurrence of {char} to
|
||||||
the left
|
the left
|
||||||
|P| ["x]P 2 put the text [from buffer x] before the
|
|P| ["x]P 2 put the text [from buffer x] before the
|
||||||
@@ -55,8 +66,10 @@ tag char note action in Normal mode ~
|
|||||||
"yy"
|
"yy"
|
||||||
|c| ["x]c{motion} 2 delete Nmove text [into buffer x] and start
|
|c| ["x]c{motion} 2 delete Nmove text [into buffer x] and start
|
||||||
insert
|
insert
|
||||||
|
|d| ["x]d{motion} 2 delete Nmove text [into buffer x]
|
||||||
|f| f{char} 1 cursor to Nth occurrence of {char} to the
|
|f| f{char} 1 cursor to Nth occurrence of {char} to the
|
||||||
right
|
right
|
||||||
|
|i| i 2 insert text before the cursor N times
|
||||||
|p| ["x]p 2 put the text [from register x] after the
|
|p| ["x]p 2 put the text [from register x] after the
|
||||||
cursor N times
|
cursor N times
|
||||||
|q| q{0-9a-zA-Z"} record typed characters into named register
|
|q| q{0-9a-zA-Z"} record typed characters into named register
|
||||||
|
@@ -23,6 +23,7 @@ import com.intellij.openapi.actionSystem.ActionManager;
|
|||||||
import com.intellij.openapi.actionSystem.AnAction;
|
import com.intellij.openapi.actionSystem.AnAction;
|
||||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.application.ApplicationManager;
|
||||||
import com.intellij.openapi.diagnostic.Logger;
|
import com.intellij.openapi.diagnostic.Logger;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.TypedActionHandler;
|
import com.intellij.openapi.editor.actionSystem.TypedActionHandler;
|
||||||
@@ -349,13 +350,15 @@ public class KeyHandler {
|
|||||||
logger.debug("lastWasBS=" + lastWasBS);
|
logger.debug("lastWasBS=" + lastWasBS);
|
||||||
|
|
||||||
Project project = editor.getProject();
|
Project project = editor.getProject();
|
||||||
if (cmd.getType().isRead() || (project != null && EditorHelper.canEdit(project, editor))) {
|
if (cmd.getType().isRead() || project == null || EditorHelper.canEdit(project, editor)) {
|
||||||
Runnable action = new ActionRunner(editor, context, cmd, key);
|
if (ApplicationManager.getApplication().isDispatchThread()) {
|
||||||
if (cmd.getType().isWrite()) {
|
Runnable action = new ActionRunner(editor, context, cmd, key);
|
||||||
RunnableHelper.runWriteCommand(project, action, cmd.getActionId(), null);
|
if (cmd.getType().isWrite()) {
|
||||||
}
|
RunnableHelper.runWriteCommand(project, action, cmd.getActionId(), null);
|
||||||
else {
|
}
|
||||||
RunnableHelper.runReadCommand(project, action, cmd.getActionId(), null);
|
else {
|
||||||
|
RunnableHelper.runReadCommand(project, action, cmd.getActionId(), null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@@ -322,19 +322,13 @@ public class ChangeGroup extends AbstractActionGroup {
|
|||||||
* @return true if able to delete text, false if not
|
* @return true if able to delete text, false if not
|
||||||
*/
|
*/
|
||||||
public boolean insertDeletePreviousWord(Editor editor, DataContext context) {
|
public boolean insertDeletePreviousWord(Editor editor, DataContext context) {
|
||||||
int deleteTo = insertStart;
|
final int deleteTo = CommandGroups.getInstance().getMotion().moveCaretToNextWord(editor, -1, false);
|
||||||
int offset = editor.getCaretModel().getOffset();
|
if (deleteTo == -1) {
|
||||||
if (offset == insertStart) {
|
return false;
|
||||||
deleteTo = CommandGroups.getInstance().getMotion().moveCaretToNextWord(editor, -1, false);
|
|
||||||
}
|
}
|
||||||
|
final TextRange range = new TextRange(deleteTo, editor.getCaretModel().getOffset());
|
||||||
if (deleteTo != -1) {
|
deleteRange(editor, context, range, SelectionType.CHARACTER_WISE, false);
|
||||||
deleteRange(editor, context, new TextRange(deleteTo, offset), SelectionType.CHARACTER_WISE,false);
|
return true;
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -188,7 +188,7 @@ public class RegisterGroup extends AbstractActionGroup {
|
|||||||
|
|
||||||
if (start != -1) {
|
if (start != -1) {
|
||||||
CommandGroups.getInstance().getMark().setMark(editor, '[', start);
|
CommandGroups.getInstance().getMark().setMark(editor, '[', start);
|
||||||
CommandGroups.getInstance().getMark().setMark(editor, ']', end - 1);
|
CommandGroups.getInstance().getMark().setMark(editor, ']', Math.max(end - 1, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@@ -53,6 +53,13 @@ public class ChangeActionTest extends VimTestCase {
|
|||||||
"abcdx.\n");
|
"abcdx.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// VIM-321 |d| |count|
|
||||||
|
public void testDeleteEmptyRange() {
|
||||||
|
doTest(stringToKeys("d0"),
|
||||||
|
"<caret>hello\n",
|
||||||
|
"hello\n");
|
||||||
|
}
|
||||||
|
|
||||||
private void doTest(final List<KeyStroke> keys, String before, String after) {
|
private void doTest(final List<KeyStroke> keys, String before, String after) {
|
||||||
myFixture.configureByText("a.java", before);
|
myFixture.configureByText("a.java", before);
|
||||||
final Editor editor = myFixture.getEditor();
|
final Editor editor = myFixture.getEditor();
|
||||||
|
@@ -14,7 +14,7 @@ import static com.maddyhome.idea.vim.helper.StringHelper.stringToKeys;
|
|||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
public class CopyActionTest extends VimTestCase {
|
public class CopyActionTest extends VimTestCase {
|
||||||
// |y| |p|
|
// |y| |p| |count|
|
||||||
public void testYankPutCharacters() {
|
public void testYankPutCharacters() {
|
||||||
typeTextInFile(stringToKeys("y2hp"),
|
typeTextInFile(stringToKeys("y2hp"),
|
||||||
"one two<caret> three\n");
|
"one two<caret> three\n");
|
||||||
|
@@ -0,0 +1,24 @@
|
|||||||
|
package org.jetbrains.plugins.ideavim.action;
|
||||||
|
|
||||||
|
import org.jetbrains.plugins.ideavim.VimTestCase;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.maddyhome.idea.vim.helper.StringHelper.stringToKeys;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author vlan
|
||||||
|
*/
|
||||||
|
public class InsertActionTest extends VimTestCase {
|
||||||
|
// VIM-112 |i| |i_CTRL-W|
|
||||||
|
public void testInsertDeletePreviousWord() {
|
||||||
|
final List<KeyStroke> keys = stringToKeys("ione two three");
|
||||||
|
keys.add(KeyStroke.getKeyStroke("control W"));
|
||||||
|
typeTextInFile(keys,
|
||||||
|
"hello\n" +
|
||||||
|
"<caret>\n");
|
||||||
|
myFixture.checkResult("hello\n" +
|
||||||
|
"one two \n");
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user