1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-08-17 16:31:45 +02:00

Compare commits

...

101 Commits
0.26 ... 0.31

Author SHA1 Message Date
Andrey Vlasovskikh
b7e37aeb20 Release notes 2013-11-12 04:18:53 +04:00
Andrey Vlasovskikh
a86ef05d52 Revert "Remove editor selection after undo"
This reverts commit 13fc780287.
2013-11-12 04:14:05 +04:00
Andrey Vlasovskikh
1be2d9affc VIM-582 Fixed line comment and reformat commands with no visual selection 2013-11-12 04:12:20 +04:00
Andrey Vlasovskikh
43e9469546 Bumped version 2013-11-11 15:36:03 +04:00
Andrey Vlasovskikh
23bb0679dd New URL for the plugin page 2013-11-08 18:18:38 +04:00
Andrey Vlasovskikh
04c41414da More release notes 2013-11-08 18:17:11 +04:00
Andrey Vlasovskikh
3490d83ce6 Draft of release notes for 0.30 2013-11-08 18:11:15 +04:00
Andrey Vlasovskikh
13fc780287 Remove editor selection after undo 2013-11-08 17:56:58 +04:00
Andrey Vlasovskikh
f0c234a5de Nullability annotations for 'cmd' parameter of execute() methods 2013-11-08 17:44:19 +04:00
Andrey Vlasovskikh
7f8050e645 Removed unused argument 2013-11-08 17:31:48 +04:00
Andrey Vlasovskikh
e8b27724c9 Nullability annotations for execute() methods of action handlers 2013-11-08 17:07:13 +04:00
Andrey Vlasovskikh
327cd2c524 EA-43519 Fixed IOOBE: EditorImpl.offsetToLogicalLine 2013-11-08 15:52:22 +04:00
Andrey Vlasovskikh
1366e859be Removed a note about <Esc> in completion windows 2013-11-07 20:43:35 +04:00
Andrey Vlasovskikh
17b779b494 Launch Vim action handler for <Esc> in completion windows (VIM-193) 2013-11-07 20:33:59 +04:00
Andrey Vlasovskikh
7e30b7c7a7 Merge branch 'warning-removal' 2013-09-17 00:18:34 +04:00
Andrey Vlasovskikh
b1b8c49c43 Removed unnecessary generate actions override 2013-08-31 16:14:21 +04:00
Andrey Vlasovskikh
876c35c212 Removed old unused undo classes 2013-08-30 16:48:24 +04:00
Andrey Vlasovskikh
e758e3d457 Removed unused VimSettings 2013-08-30 16:45:42 +04:00
Andrey Vlasovskikh
91e7bfce1d Fixed setting command count 2013-08-30 16:39:56 +04:00
Andrey Vlasovskikh
2e6c53fb52 Typos 2013-08-30 16:04:34 +04:00
Andrey Vlasovskikh
510edeb9a6 Reformat code 2013-08-30 16:03:11 +04:00
Andrey Vlasovskikh
8566e7bf46 Fixed potential NPE 2013-08-30 15:57:38 +04:00
Andrey Vlasovskikh
7dfea2feb6 Removed unused parameter 2013-08-30 15:52:13 +04:00
Andrey Vlasovskikh
fcb9de1930 @Nullable 2013-08-30 15:51:51 +04:00
Andrey Vlasovskikh
2c7a3b877c Argument is always true 2013-08-30 15:47:37 +04:00
Andrey Vlasovskikh
e4ae7f8566 Removed unnecessary logger 2013-08-30 15:45:46 +04:00
Andrey Vlasovskikh
94f8544dfa Removed unnecessary Ascii class 2013-08-30 15:42:08 +04:00
Andrey Vlasovskikh
0159155e1c Removed unused ErrorHandler class 2013-08-30 15:41:21 +04:00
Andrey Vlasovskikh
b45e32dd3f Cleanup 2013-08-12 19:40:44 +04:00
Andrey Vlasovskikh
f3d66b3356 VIM-551 Argument of ':put' is optional 2013-08-12 19:39:59 +04:00
Andrey Vlasovskikh
f21190cb24 VIM-550 ':put' creates a new line 2013-08-12 19:38:33 +04:00
Andrey Vlasovskikh
9554eb0990 Extracted VimTestCase.typeText() 2013-08-12 18:40:51 +04:00
Andrey Vlasovskikh
9c04525df8 Extracted VimTestCase.runExCommand() 2013-08-12 18:26:52 +04:00
Andrey Vlasovskikh
26555c6ad6 VIM-425 Read config from .ideavimrc if available 2013-08-12 17:56:32 +04:00
Andrey Vlasovskikh
d6ee29dc91 Refactored Options.loadVimrc() 2013-08-12 17:54:26 +04:00
Andrey Vlasovskikh
e6dacd0b84 Cleanup 2013-08-12 17:38:11 +04:00
Andrey Vlasovskikh
acf75ad080 Cleanup 2013-08-12 17:01:38 +04:00
Andrey Vlasovskikh
92067b2577 VIM-440 Fixed ':e' open file dialog 2013-08-12 16:59:43 +04:00
Andrey Vlasovskikh
24f197ce99 Use SwingUtilities.invokeLater() for consistency 2013-08-12 16:52:33 +04:00
Andrey Vlasovskikh
39cc7db50b Typos 2013-08-09 00:47:05 +04:00
Andrey Vlasovskikh
510a6d12a7 Replace StringBuffer with concatenation 2013-08-09 00:44:25 +04:00
Andrey Vlasovskikh
cb8c1ea4b5 Fixed possible NPE 2013-08-09 00:43:27 +04:00
Andrey Vlasovskikh
3284102dde Specify size in toArray() 2013-08-09 00:40:50 +04:00
Andrey Vlasovskikh
4a5457ad49 Removed unused method 2013-08-09 00:40:21 +04:00
Andrey Vlasovskikh
39ed9265d7 Converted a RegisterActions class instance into a function 2013-08-09 00:30:52 +04:00
Andrey Vlasovskikh
2fc721f220 Typo 2013-08-09 00:19:20 +04:00
Andrey Vlasovskikh
28c658810f Split RegisterActions constructor into several methods 2013-08-09 00:18:08 +04:00
Andrey Vlasovskikh
2f2ecc252e Updated copyright years in sources 2013-08-09 00:06:38 +04:00
Andrey Vlasovskikh
9f2613c56a Moved RegisterActions to the root IdeaVim package
This class is an entry point to nearly all Vim actions, so it should be
easier to discover.
2013-08-08 23:47:00 +04:00
Andrey Vlasovskikh
a58929d4fb Added forgotten release date for 0.29 2013-08-08 21:12:41 +04:00
Andrey Vlasovskikh
fa13be1e15 Updated link to build server 2013-08-08 21:11:20 +04:00
Andrey Vlasovskikh
7a4d900b06 VIM-98 Invoke actions in separate commands for better Undo/Redo
Vim actions used to be invoked inside a key typing command and didn't
have their own commands. Now they've got separate commands with unique
group IDs in order to stop them from being merged into combined
Undo/Redo steps.

The Undo/Redo behaviour still differs from Vim: typing in a single
Insert mode session is split into several Undo chunks depending on
timing. An Undo step may require one more Undo step for moving the
cursor to its position before Undo.
2013-08-08 20:56:28 +04:00
Andrey Vlasovskikh
421ce832dd Updated changelog 2013-05-15 19:18:13 +04:00
Andrey Vlasovskikh
987781f826 VIM-121 Don't move cursor while scrolling 2013-05-15 18:57:46 +04:00
Andrey Vlasovskikh
d85a41ea98 VIM-91 Enable normal <Enter> handling for one-line editors 2013-05-15 17:15:04 +04:00
Andrey Vlasovskikh
42f86a3f73 VIM-482 Added repeat buffer limits 2013-05-15 16:46:09 +04:00
Andrey Vlasovskikh
0241b58777 Updated change notes 2013-04-06 22:29:58 +04:00
Andrey Vlasovskikh
97a2c73efe Updated changelog 2013-04-06 22:19:50 +04:00
Andrey Vlasovskikh
5f1e46ca82 Merge branch 'vim-479' 2013-04-06 21:59:50 +04:00
Andrey Vlasovskikh
805779144e Fixed copying second keystrokes in Reconfigure Vim keymap 2013-04-06 21:50:12 +04:00
Andrey Vlasovskikh
c65e21708c VIM-478 Fixed bug in reconfiguring Vim keymap based on user-defined keymaps 2013-04-06 21:21:22 +04:00
Andrey Vlasovskikh
08e546b677 Fixed NPE in VimKeyMapUtil.installKeyBoardBindings 2013-04-06 19:57:27 +04:00
Andrey Vlasovskikh
11cf8454ad VIM-479 Don't try to put read-only editors into insert mode 2013-04-06 19:53:57 +04:00
Andrey Vlasovskikh
c3494803dc Removed unused code 2013-04-06 18:39:56 +04:00
Andrey Vlasovskikh
c84496b942 Suggest reconfiguring keymap during update only for Macs 2013-04-06 18:12:15 +04:00
Andrey Vlasovskikh
c4eb8e5752 Updated changelog 2013-04-03 15:57:22 +04:00
Andrey Vlasovskikh
7702d3a695 Fixed broken test 2013-04-03 04:05:37 +04:00
Andrey Vlasovskikh
fbff8ed2c0 VIM-419 Keep cursor position after 'gt' and 'gT' 2013-04-03 03:55:02 +04:00
Andrey Vlasovskikh
5b5b6188da VIM-42 Ignore multi-character indents while recoding last insert actions 2013-04-03 00:30:26 +04:00
Andrey Vlasovskikh
6a1707a7e6 Minor style edits 2013-04-01 20:36:41 +04:00
Andrey Vlasovskikh
b625fd3df9 Updated changelog 2013-04-01 20:35:56 +04:00
Andrey Vlasovskikh
ffaf2cc451 VIM-42 Handle moving cursor back and forward during autocompletion
Expressions like static methods (Foo.bar()) and shortcut completions (f.b for
foo.bar()) are completed using several document edits with cursor movements.
Now IdeaVim records and replays these cursor movements.
2013-04-01 20:17:30 +04:00
Andrey Vlasovskikh
dcc9b5a37e VIM-42 Record char strokes as regular document edits 2013-04-01 17:23:33 +04:00
Andrey Vlasovskikh
1b4a51f770 VIM-42 Basic support for repeating code completion using '.' command 2013-04-01 17:10:56 +04:00
Andrey Vlasovskikh
f8d2ee2dd7 VIM-286 Note about switching key repeating on Mac OS X manually 2013-03-27 18:15:46 +04:00
Andrey Vlasovskikh
348d88d543 VIM-92 Note about resetting custom shortcuts 2013-03-27 17:54:51 +04:00
Andrey Vlasovskikh
38b859e555 VIM-472 Fixed right selection in visual character mode to be one char past line 2013-03-26 16:36:15 +04:00
Andrey Vlasovskikh
ca8026f612 VIM-404 Fixed 'O' at the first line 2013-03-26 15:51:15 +04:00
Andrey Vlasovskikh
befcf4298f Updated changelog 2013-03-26 02:43:46 +04:00
Andrey Vlasovskikh
2e0bbcc75d Moved MacKeyRepeat to helpers 2013-03-26 02:23:27 +04:00
Andrey Vlasovskikh
2204fe6451 Fixed unit tests for updated plugin state 2013-03-26 02:21:09 +04:00
Andrey Vlasovskikh
12bc68bc02 VIM-286 Suggest enabling Mac OS X keys autorepeat only if it is not enabled 2013-03-26 02:20:30 +04:00
Andrey Vlasovskikh
290370f744 VIM-92 Don't suggest reconfiguring Vim keymap if it is not installed yet 2013-03-25 22:45:02 +04:00
Andrey Vlasovskikh
79acef46ce VIM-286 Suggest enabling repeating keys on press and hold for Mac OS X 2013-03-25 22:44:25 +04:00
Andrey Vlasovskikh
0054eb5279 Disabled overriding second keystrokes as a workaround for Emacs keymap 2013-03-25 21:27:14 +04:00
Andrey Vlasovskikh
e0eb919e51 VIM-92 Save parent keymap after reconfiguring Vim keymap and show notification 2013-03-25 20:51:30 +04:00
Andrey Vlasovskikh
7c3d5a7946 VIM-92 Suggest to reconfigure Vim keymap using the new generation algorithm 2013-03-25 19:49:31 +04:00
Andrey Vlasovskikh
38cb20d1bd Changed capitalization of "Vim" 2013-03-25 19:48:25 +04:00
Andrey Vlasovskikh
505fcf5b31 VIM-421 Fixed 'cw' at the last word in line 2013-03-13 13:48:11 -07:00
Andrey Vlasovskikh
d744d45ccd VIM-92 Reconfigure Vim keymap by overwriting it and switching bindings without restart 2013-03-12 21:40:18 +04:00
Andrey Vlasovskikh
2e2e7a7df6 VIM-92 Free Ctrl+N that is critical to navigate actions on Linux 2013-03-12 21:39:19 +04:00
Andrey Vlasovskikh
db5ff05bb3 VIM-92 Do not use Meta key on systems other than Mac 2013-03-12 21:38:28 +04:00
Andrey Vlasovskikh
566273fe83 Merge branch 'vim-92' 2013-03-12 16:48:31 +04:00
Andrey Vlasovskikh
decb17e665 VIM-92 Alternative shortcuts for actions with shortcuts bound to IdeaVim
Alternative action shortcuts are obtained from standard shortcuts by
adding Alt+, Ctrl+, Shift+, Meta+, Alt+Ctrl+, etc. to them.
2013-03-12 16:48:17 +04:00
Andrey Vlasovskikh
46c27bbd10 Added John Lindquist to contributors 2013-03-11 15:41:23 +04:00
Andrey Vlasovskikh
72f98cef14 Merge pull request #14 from johnlindquist/master
Matching command-line font and font size to editor font and font size
2013-03-11 04:38:33 -07:00
John Lindquist
0f8cfa289d Command-line font and font size now match editor font and font size 2013-03-10 23:47:53 -06:00
Alexander Zolotov
0cb420c557 VIM-92: Fix Vim keymap to work better in Mac OS
- add extra shortcuts for Linux keymaps
2013-01-11 00:50:15 +04:00
Alexander Zolotov
79df0b0594 VIM-92: Fix Vim keymap to work better in Mac OS
- ability to define extra shortcuts
2013-01-11 00:42:31 +04:00
Alexander Zolotov
dfbddb4050 VIM-92: Fix Vim keymap to work better in Mac OS
- tests for keymap generation
2013-01-10 23:47:20 +04:00
Alexander Zolotov
0f88495f29 VIM-92: Fix Vim keymap to work better in Mac OS
- remove all static overrides from vim.xml
- introduce conflicts resolving
2013-01-08 23:19:41 +04:00
439 changed files with 6277 additions and 6564 deletions

View File

@@ -21,6 +21,7 @@ Contributors:
* [Masanobu Imai](mailto:masanobu.imai@gmail.com)
* [poxu](mailto:poxvuibr@gmail.com)
* [Alexander Zolotov](mailto:alexander.zolotov@jetbrains.com)
* [John Lindquist](mailto:johnlindquist@gmail.com)
If you are a contributor and your name is not listed here, feel free to
contact the maintainer.

View File

@@ -4,6 +4,82 @@ The Changelog
History of changes in IdeaVim for the IntelliJ platform.
0.31, 2013-11-12
----------------
A bugfix release.
Bug fixes:
* VIM-582 Fixed line comment and reformat commands with no visual selection
0.30, 2013-11-11
----------------
Added support for a separate `.ideavimrc` config file. Fixed long-standing
issues with merged undo/redo commands and `<Esc>` during code completion.
Various bug fixes.
Features:
* VIM-425 Read config from .ideavimrc if available
Bug fixes:
* VIM-98 Invoke actions in separate commands for better undo/redo
* VIM-193 Launch Vim action handler for `<Esc>` in completion windows
* VIM-440 Fixed `:e` open file dialog
* VIM-550 `:put` creates a new line
* VIM-551 Argument of `:put` is optional
* Fixed several reported exceptions
0.29, 2013-05-15
----------------
A bugfix release.
Bug fixes:
* VIM-482 Fixed repeat buffer limits
* VIM-91 Enable normal `<Enter>` handling for one-line editors
* VIM-121 Don't move cursor while scrolling
0.28, 2013-04-06
----------------
A bugfix release.
Bug fixes:
* VIM-478 Fixed reconfigure Vim keymap for user-defined base keymaps
* VIM-479 Don't try to activate insert mode for diff view
0.27, 2013-04-03
----------------
New Vim keymap generator creates better keymaps, especially for Mac OS X.
Restart after reconfiguring the keymap is no longer required.
Features:
* VIM-92 Better Vim keymaps for Mac OS X
* VIM-286 Ask if the plugin should enable repeating keys in Mac OS X
Bug fixes:
* VIM-42 Fixed code completion for the `.` command
* VIM-421 Fixed `cw` on the last character in line
* VIM-419 Fixed resetting cursor position after 'gt' and 'gT'
* VIM-233 Fixed code completion for edits in visual block mode
* VIM-404 Fixed `O` command at the first line
* VIM-472 Fixed right selection in visual mode to be one char more
* Fixed command window font size to match editor font size
0.26, 2012-12-26
----------------
@@ -17,11 +93,11 @@ Features:
* VIM-262 Support for paste from register in command mode
* VIM-214 Key bindings for paste into command line
* VIM-43 Added support for the last change position mark
* VIM-177 Added <C-]> and <C-T> to the keymap
* VIM-177 Added `<C-]>` and `<C-T>` to the keymap
Bug fixes:
* VIM-302 Fixed tab switching order for 'gt' and 'gT'
* VIM-302 Fixed tab switching order for `gt` and `gT`
0.25, 2012-12-19

View File

@@ -7,10 +7,10 @@ and AppCode.
Resources:
* [Plugin homepage](http://plugins.intellij.net/plugin/?id=164)
* [Plugin homepage](http://plugins.jetbrains.com/plugin/164)
* [Changelog](https://github.com/JetBrains/ideavim/blob/master/CHANGES.md)
* [Bug tracker](http://youtrack.jetbrains.com/issues/VIM)
* [Continuous integration builds](http://teamcity.jetbrains.com/project.html?projectId=project55)
* [Continuous integration builds](http://teamcity.jetbrains.com/project.html?projectId=IdeaVim)
* [@IdeaVim](http://twitter.com/ideavim) in Twitter
@@ -68,12 +68,6 @@ Vim. Vim compatibility of undo/redo may be improved in the future releases.
### Escape
In the IDE, the `<Esc>` key is used during editing to cancel code completion
windows, dialog windows, and parameter tooltips. While in the Vim insert mode,
`<Esc>` is used to return back to the normal mode. If you are typing in the
insert mode and a code completion window is popped up, pressing `<Esc>` cancel
the window without exiting the insert mode.
Using `<Esc>` in dialog windows remains problematic. For most dialog windows
the Vim emulator is put into the insert mode without the possibility to switch to
the normal mode. In some dialog windows the normal mode is on by default. The

View File

@@ -1,4 +1,4 @@
version-id:0.26
version-id:0.31
platform-version:110.0
idea.download.url=http://download.jetbrains.com/idea/ideaIU-12.0.zip
idea.download.url=http://download.jetbrains.com/idea/ideaIU-12.1.zip
build.number=x

View File

@@ -65,6 +65,8 @@ tag char note action in Normal mode ~
|count| 9 "
|F| F{char} 1 cursor to the Nth occurrence of {char} to
the left
|O| O 2 begin a new line above the cursor and
insert text, repeat N times
|P| ["x]P 2 put the text [from buffer x] before the
cursor N times
|T| T{char} 1 cursor till after Nth occurrence of {char}

View File

@@ -1,22 +1,33 @@
<idea-plugin url="http://plugins.intellij.net/plugin/?id=164">
<idea-plugin url="http://plugins.jetbrains.com/plugin/164">
<name>IdeaVim</name>
<id>IdeaVIM</id>
<change-notes>
<![CDATA[
<p>0.26:</p>
<ul>
<li>Added support for paste in the command mode: from a register using <code>&lt;C-R&gt;</code>, from the clipboard using <code>&lt;S-Insert&gt;</code> or <code>&lt;M-V&gt;</code></li>
<li>Added support for the last change position mark (the dot <code>.</code> mark)</li>
<li>New shortcuts for Go to declaration <code>&lt;C-]&gt;</code> and Navigate back <code>&lt;C-T&gt;</code></li>
<li>Various bug fixes</li>
</ul>
<p>0.25:</p>
<p>0.31:</p>
<ul>
<li>Various bug fixes</li>
</ul>
<p>0.24:</p>
<p>0.30:</p>
<ul>
<li>Added Vim string object selection motions (see help topics <code>v_i"</code>, <code>v_a"</code>)</li>
<li>Support for a separate <code>.ideavimrc</code> config file</li>
<li>Fixed long-standing issues with merged undo/redo commands and <code>&lt;Esc&gt;</code> during completion</li>
<li>Various bug fixes</li>
</ul>
<p>0.29:</p>
<ul>
<li>Fixed repeat buffer limits</li>
<li>Enable normal <code>&lt;Enter&gt;</code> handling for one-line editors</li>
<li>Don't move cursor while scrolling</li>
</ul>
<p>0.28:</p>
<ul>
<li>Fixed reconfigure Vim keymap for user-defined base keymaps</li>
</ul>
<p>0.27:</p>
<ul>
<li>Better Vim keymaps for Mac OS X</li>
<li>Ask if the plugin should enable repeating keys in Mac OS X</li>
<li>Fixed a long-standing bug with code completion and repeat last change command ('<code>.</code>')</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>
@@ -64,11 +75,11 @@
</extensions>
<actions>
<action id="VimPluginToggle" class="com.maddyhome.idea.vim.VimPluginToggleAction" text="VIM Emulator" description="Toggle the Vim Plugin On/Off">
<action id="VimPluginToggle" class="com.maddyhome.idea.vim.VimPluginToggleAction" text="Vim Emulator" description="Toggle the Vim Plugin On/Off">
<keyboard-shortcut first-keystroke="control alt V" keymap="$default"/>
<add-to-group group-id="ToolsMenu" anchor="last"/>
</action>
<action id="VimReconfigureKeymap" class="com.maddyhome.idea.vim.VimReconfigureKeymapAction" text="Reconfigure VIM Keymap" description="Reconfigure VIM keymap">
<action id="VimReconfigureKeymap" class="com.maddyhome.idea.vim.VimReconfigureKeymapAction" text="Reconfigure Vim Keymap" description="Reconfigure Vim keymap">
<add-to-group group-id="ToolsMenu" relative-to-action="after VimPluginToggle"/>
</action>
@@ -339,11 +350,6 @@
<action id="VimResetMode" class="com.maddyhome.idea.vim.action.ResetModeAction" text="Reset Mode"/>
<action id="VimRedo" class="com.maddyhome.idea.vim.action.change.RedoAction" text="Redo"/>
<action id="VimUndo" class="com.maddyhome.idea.vim.action.change.UndoAction" text="Undo"/>
<action id="VimGenerateConstructor" class="com.maddyhome.idea.vim.action.TxActionWrapper" text="Generate Constructor"/>
<action id="VimGenerateGetter" class="com.maddyhome.idea.vim.action.TxActionWrapper" text="Generate Getter"/>
<action id="VimGenerateSetter" class="com.maddyhome.idea.vim.action.TxActionWrapper" text="Generate Setter"/>
<action id="VimGenerateGetterAndSetter" class="com.maddyhome.idea.vim.action.TxActionWrapper" text="Generate Getter and Setter"/>
<action id="VimGenerateEquals" class="com.maddyhome.idea.vim.action.TxActionWrapper" text="Generate Equals"/>
<action id="VimClassNameCompletion" class="com.maddyhome.idea.vim.action.OriginalDelegateAction" text="Class Name Completion"/>
<action id="VimCodeCompletion" class="com.maddyhome.idea.vim.action.OriginalDelegateAction" text="Code Completion"/>

View File

@@ -1,129 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<keymap version="1" name="Vim" disable-mnemonics="false" parent="$default">
<action id="$Copy">
<keyboard-shortcut first-keystroke="control INSERT" />
<keyboard-shortcut first-keystroke="meta C" />
</action>
<action id="$Cut">
<keyboard-shortcut first-keystroke="shift DELETE" />
<keyboard-shortcut first-keystroke="meta X" />
</action>
<action id="$Paste">
<keyboard-shortcut first-keystroke="shift INSERT" />
<keyboard-shortcut first-keystroke="meta V" />
</action>
<action id="$Redo">
<keyboard-shortcut first-keystroke="shift alt BACK_SPACE" />
</action>
<action id="$SelectAll" />
<action id="$Undo">
<keyboard-shortcut first-keystroke="alt BACK_SPACE" />
</action>
<action id="CheckinProject" />
<action id="ClassNameCompletion" />
<action id="ClearCase.CheckInProject" />
<action id="CodeCompletion" />
<action id="CommanderSwapPanels" />
<action id="ContextHelp" />
<action id="EditorBackSpace">
<keyboard-shortcut first-keystroke="BACK_SPACE" />
</action>
<action id="EditorCodeBlockEnd" />
<action id="EditorCodeBlockStart" />
<action id="EditorCopy">
<keyboard-shortcut first-keystroke="control INSERT" />
<keyboard-shortcut first-keystroke="meta C" />
</action>
<action id="EditorCut">
<keyboard-shortcut first-keystroke="shift DELETE" />
<keyboard-shortcut first-keystroke="meta X" />
</action>
<action id="EditorDeleteLine" />
<action id="EditorDeleteToWordEnd" />
<action id="EditorDeleteToWordStart" />
<action id="EditorDownWithSelection" />
<action id="EditorDuplicate" />
<action id="EditorIndentSelection" />
<action id="EditorJoinLines" />
<action id="EditorLeftWithSelection" />
<action id="EditorLineEndWithSelection" />
<action id="EditorLineStartWithSelection" />
<action id="EditorMoveToPageBottom" />
<action id="EditorMoveToPageBottomWithSelection" />
<action id="EditorMoveToPageTop" />
<action id="EditorMoveToPageTopWithSelection" />
<action id="EditorNextWord" />
<action id="EditorNextWordWithSelection" />
<action id="EditorPageDownWithSelection" />
<action id="EditorPageUpWithSelection" />
<action id="EditorPaste">
<keyboard-shortcut first-keystroke="shift INSERT" />
<keyboard-shortcut first-keystroke="meta V" />
</action>
<action id="EditorPreviousWord" />
<action id="EditorPreviousWordWithSelection" />
<action id="EditorRedo" />
<action id="EditorRightWithSelection" />
<action id="EditorScrollDown" />
<action id="EditorScrollToCenter" />
<action id="EditorScrollUp" />
<action id="EditorSelectAll" />
<action id="EditorSelectWord" />
<action id="EditorSplitLine" />
<action id="EditorStartNewLine" />
<action id="EditorTextEnd" />
<action id="EditorTextEndWithSelection" />
<action id="EditorTextStart" />
<action id="EditorTextStartWithSelection" />
<action id="EditorToggleCase" />
<action id="EditorUnSelectWord" />
<action id="EditorUndo" />
<action id="EditorUnindentSelection" />
<action id="EditorUpWithSelection" />
<action id="Find" />
<action id="FindNext">
<keyboard-shortcut first-keystroke="F3" />
</action>
<action id="FindPrevious">
<keyboard-shortcut first-keystroke="shift F3" />
</action>
<action id="GotoBookmark2" />
<action id="GotoClass">
<keyboard-shortcut first-keystroke="shift alt N" />
</action>
<action id="GotoDeclaration">
<mouse-shortcut keystroke="control button1" />
<mouse-shortcut keystroke="button2" />
</action>
<action id="GotoLine" />
<action id="GotoSuperMethod">
<keyboard-shortcut first-keystroke="shift control U" />
</action>
<action id="ImplementMethods">
<keyboard-shortcut first-keystroke="shift control I" />
</action>
<action id="InsertLiveTemplate" />
<action id="MethodHierarchy.ImplementMethodAction" />
<action id="MethodHierarchy.OverrideMethodAction" />
<action id="OverrideMethods">
<keyboard-shortcut first-keystroke="shift control O" />
</action>
<action id="ParameterInfo">
<keyboard-shortcut first-keystroke="shift control P" />
</action>
<action id="QuickJavaDoc">
<mouse-shortcut keystroke="alt button2" />
</action>
<action id="RecentFiles" />
<action id="Replace" />
<action id="SaveAll" />
<action id="SmartTypeCompletion" />
<action id="Starteam.CheckinProject" />
<action id="Subversion.CommitProject" />
<action id="ToggleBookmark2" />
<action id="TypeHierarchy">
<keyboard-shortcut first-keystroke="shift control alt H" />
</action>
<action id="VimKeyHandler">
<keyboard-shortcut first-keystroke="control 2" />
<keyboard-shortcut first-keystroke="control A" />
@@ -145,7 +21,6 @@
<keyboard-shortcut first-keystroke="control L" />
<keyboard-shortcut first-keystroke="control LEFT" />
<keyboard-shortcut first-keystroke="control M" />
<keyboard-shortcut first-keystroke="control N" />
<keyboard-shortcut first-keystroke="control O" />
<keyboard-shortcut first-keystroke="control OPEN_BRACKET" />
<keyboard-shortcut first-keystroke="control P" />

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2006 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,16 +13,17 @@ package com.maddyhome.idea.vim;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim;
import com.intellij.openapi.actionSystem.ActionManager;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.TypedActionHandler;
import com.intellij.openapi.project.Project;
@@ -105,7 +104,6 @@ public class KeyHandler {
// All the editor actions should be performed with top level editor!!!
// Be careful: all the EditorActionHandler implementation should correctly process InjectedEditors
editor = InjectedLanguageUtil.getTopLevelEditor(editor);
logger.debug("handleKey " + key);
final CommandState editorState = CommandState.getInstance(editor);
final boolean isRecording = editorState.isRecording();
boolean shouldRecord = true;
@@ -120,13 +118,11 @@ public class KeyHandler {
else if (isCommandCount(editorState, chKey)) {
// Update the count
count = count * 10 + (chKey - '0');
logger.debug("count now " + count);
}
// Pressing delete while entering a count "removes" the last digit entered
else if (isDeleteCommandCount(key, editorState)) {
// "Remove" the last digit sent to us
count /= 10;
logger.debug("count now " + count);
}
// If we got this far the user is entering a command or supplying an argument to an entered command.
// First let's check to see if we are at the point of expecting a single character argument to a command.
@@ -138,9 +134,6 @@ public class KeyHandler {
else {
// For debugging purposes we track the keys entered for this command
keys.add(key);
if (logger.isDebugEnabled()) {
logger.debug("keys now " + keys);
}
// Ask the key/action tree if this is an appropriate key at this point in the command and if so,
// return the node matching this keystroke
@@ -161,21 +154,16 @@ public class KeyHandler {
// If this is an argument node then the last keystroke was not part of the current command but should
// be the first keystroke of the argument of the current command
else if (node instanceof ArgumentNode) {
shouldRecord = handleArgumentNode(editor, key, context, editorState, shouldRecord, (ArgumentNode)node);
shouldRecord = handleArgumentNode(editor, key, context, editorState, true, (ArgumentNode)node);
}
else {
logger.debug("checking for digraph");
logger.debug("lastWasBS=" + lastWasBS);
logger.debug("lastChar=" + lastChar);
if (lastWasBS && lastChar != 0 && Options.getInstance().isSet("digraph")) {
char dig = CommandGroups.getInstance().getDigraph().getDigraph(lastChar, key.getKeyChar());
logger.debug("dig=" + dig);
key = KeyStroke.getKeyStroke(dig);
}
// If we are in insert/replace mode send this key in for processing
if (editorState.getMode() == CommandState.Mode.INSERT ||
editorState.getMode() == CommandState.Mode.REPLACE) {
if (editorState.getMode() == CommandState.Mode.INSERT || editorState.getMode() == CommandState.Mode.REPLACE) {
if (!CommandGroups.getInstance().getChange().processKey(editor, context, key)) {
shouldRecord = false;
}
@@ -218,32 +206,31 @@ public class KeyHandler {
}
}
private void handleEditorReset(@NotNull Editor editor, @NotNull KeyStroke key, @NotNull DataContext context) {
private void handleEditorReset(@NotNull Editor editor, @NotNull KeyStroke key, @NotNull final DataContext context) {
if (state != State.COMMAND && count == 0 && currentArg == Argument.Type.NONE && currentCmd.size() == 0 &&
CommandGroups.getInstance().getRegister().getCurrentRegister() == RegisterGroup.REGISTER_DEFAULT) {
if (key.getKeyCode() == KeyEvent.VK_ESCAPE) {
CommandProcessor.getInstance().executeCommand(editor.getProject(), new Runnable() {
@Override
public void run() {
KeyHandler.executeAction("VimEditorEscape", context);
//getOriginalHandler().execute(editor, key.getKeyChar(), context);
}
}, "", null);
}
VimPlugin.indicateError();
}
reset(editor);
}
private boolean isDeleteCommandCount(@NotNull KeyStroke key, @NotNull CommandState editorState) {
return (editorState.getMode() == CommandState.Mode.COMMAND ||
editorState.getMode() == CommandState.Mode.VISUAL) &&
state == State.NEW_COMMAND && currentArg != Argument.Type.CHARACTER && currentArg !=
Argument.Type.DIGRAPH &&
return (editorState.getMode() == CommandState.Mode.COMMAND || editorState.getMode() == CommandState.Mode.VISUAL) &&
state == State.NEW_COMMAND && currentArg != Argument.Type.CHARACTER && currentArg != Argument.Type.DIGRAPH &&
key.getKeyCode() == KeyEvent.VK_DELETE && count != 0;
}
private boolean isCommandCount(@NotNull CommandState editorState, char chKey) {
return (editorState.getMode() == CommandState.Mode.COMMAND ||
editorState.getMode() == CommandState.Mode.VISUAL) &&
state == State.NEW_COMMAND && currentArg != Argument.Type.CHARACTER && currentArg !=
Argument.Type.DIGRAPH &&
return (editorState.getMode() == CommandState.Mode.COMMAND || editorState.getMode() == CommandState.Mode.VISUAL) &&
state == State.NEW_COMMAND && currentArg != Argument.Type.CHARACTER && currentArg != Argument.Type.DIGRAPH &&
Character.isDigit(chKey) &&
(count != 0 || chKey != '0');
}
@@ -256,7 +243,6 @@ public class KeyHandler {
}
private void handleCharArgument(@NotNull KeyStroke key, char chKey) {
logger.debug("currentArg is Character");
// We are expecting a character argument - is this a regular character the user typed?
// Some special keys can be handled as character arguments - let's check for them here.
if (chKey == 0) {
@@ -284,12 +270,13 @@ public class KeyHandler {
}
}
private boolean handleDigraph(@NotNull Editor editor, @NotNull KeyStroke key, @NotNull DataContext context, @Nullable Node node) {
private boolean handleDigraph(@NotNull Editor editor, @NotNull KeyStroke key, @NotNull DataContext context,
@Nullable Node node) {
if (digraph == null && !(node instanceof CommandNode) && DigraphSequence.isDigraphStart(key)) {
digraph = new DigraphSequence();
}
if (digraph != null) {
DigraphSequence.DigraphResult res = digraph.processKey(key, editor, context);
DigraphSequence.DigraphResult res = digraph.processKey(key, editor);
switch (res.getResult()) {
case DigraphSequence.DigraphResult.RES_OK:
return true;
@@ -301,11 +288,13 @@ public class KeyHandler {
currentArg = Argument.Type.CHARACTER;
}
digraph = null;
handleKey(editor, res.getStroke(), context);
final KeyStroke stroke = res.getStroke();
if (stroke == null) {
return false;
}
handleKey(editor, stroke, context);
return true;
}
logger.debug("digraph done");
}
return false;
}
@@ -323,24 +312,20 @@ public class KeyHandler {
cmd = top;
}
if (logger.isDebugEnabled()) {
logger.debug("cmd=" + cmd);
}
// If we have a command and a motion command argument, both could possibly have their own counts. We
// need to adjust the counts so the motion gets the product of both counts and the count associated with
// the command gets reset. Example 3c2w (change 2 words, three times) becomes c6w (change 6 words)
Argument arg = cmd.getArgument();
if (logger.isDebugEnabled()) {
logger.debug("arg=" + arg);
}
final Argument arg = cmd.getArgument();
if (arg != null && arg.getType() == Argument.Type.MOTION) {
Command mot = arg.getMotion();
final Command mot = arg.getMotion();
// If no count was entered for either command then nothing changes. If either had a count then
// the motion gets the product of both.
if (mot != null) {
int cnt = cmd.getRawCount() == 0 && mot.getRawCount() == 0 ? 0 : cmd.getCount() * mot.getCount();
cmd.setCount(0);
mot.setCount(cnt);
}
cmd.setCount(0);
}
// If we were in "operator pending" mode, reset back to normal mode.
if (editorState.getMappingMode() == KeyParser.MAPPING_OP_PEND) {
@@ -352,34 +337,30 @@ public class KeyHandler {
editorState.setCommand(cmd);
lastWasBS = ((cmd.getFlags() & Command.FLAG_IS_BACKSPACE) != 0);
logger.debug("lastWasBS=" + lastWasBS);
Project project = editor.getProject();
if (cmd.getType().isRead() || project == null || EditorHelper.canEdit(project, editor)) {
if (ApplicationManager.getApplication().isDispatchThread()) {
Runnable action = new ActionRunner(editor, context, cmd, key);
String name = cmd.getAction().getTemplatePresentation().getText();
name = name != null ? "Vim " + name : "";
if (cmd.getType().isWrite()) {
RunnableHelper.runWriteCommand(project, action, cmd.getActionId(), null);
RunnableHelper.runWriteCommand(project, action, name, action);
}
else {
RunnableHelper.runReadCommand(project, action, cmd.getActionId(), null);
RunnableHelper.runReadCommand(project, action, name, action);
}
}
}
else {
logger.info("write command on read-only file");
VimPlugin.indicateError();
reset(editor);
}
}
private boolean handleArgumentNode(@NotNull Editor editor,
@NotNull KeyStroke key,
@NotNull DataContext context,
@NotNull CommandState editorState,
boolean shouldRecord,
private boolean handleArgumentNode(@NotNull Editor editor, @NotNull KeyStroke key, @NotNull DataContext context,
@NotNull CommandState editorState, boolean shouldRecord,
@NotNull ArgumentNode node) {
logger.debug("argument node");
// Create a new command based on what the user has typed so far, excluding this keystroke.
Command cmd = new Command(count, node.getActionId(), node.getAction(), node.getCmdType(), node.getFlags());
cmd.setKeys(keys);
@@ -398,8 +379,7 @@ public class KeyHandler {
// commands
if ((node.getFlags() & Command.FLAG_OP_PEND) != 0) {
//CommandState.getInstance().setMappingMode(KeyParser.MAPPING_OP_PEND);
editorState.pushState(editorState.getMode(), editorState.getSubMode(),
KeyParser.MAPPING_OP_PEND);
editorState.pushState(editorState.getMode(), editorState.getSubMode(), KeyParser.MAPPING_OP_PEND);
}
break;
case EX_STRING:
@@ -421,7 +401,6 @@ public class KeyHandler {
}
private void handleCommandNode(@NotNull Editor editor, @NotNull DataContext context, @NotNull CommandNode node) {
logger.debug("command node");
// If all does well we are ready to process this command
state = State.READY;
// Did we just get the completed sequence for a motion command argument?
@@ -429,15 +408,13 @@ public class KeyHandler {
// We have been expecting a motion argument - is this one?
if (node.getCmdType() == Command.Type.MOTION) {
// Create the motion command and add it to the stack
Command cmd = new Command(count, node.getActionId(), node.getAction(),
node.getCmdType(), node.getFlags());
Command cmd = new Command(count, node.getActionId(), node.getAction(), node.getCmdType(), node.getFlags());
cmd.setKeys(keys);
currentCmd.push(cmd);
}
else if (node.getCmdType() == Command.Type.RESET) {
currentCmd.clear();
Command cmd = new Command(1, node.getActionId(), node.getAction(),
node.getCmdType(), node.getFlags());
Command cmd = new Command(1, node.getActionId(), node.getAction(), node.getCmdType(), node.getFlags());
cmd.setKeys(keys);
currentCmd.push(cmd);
}
@@ -456,23 +433,20 @@ public class KeyHandler {
// The user entered a valid command that doesn't take any arguments
else {
// Create the command and add it to the stack
Command cmd = new Command(count, node.getActionId(), node.getAction(),
node.getCmdType(), node.getFlags());
Command cmd = new Command(count, node.getActionId(), node.getAction(), node.getCmdType(), node.getFlags());
cmd.setKeys(keys);
currentCmd.push(cmd);
// This is a sanity check that the command has a valid action. This should only fail if the
// programmer made a typo or forgot to add the action to the plugin.xml file
if (cmd.getAction() == null) {
logger.error("NULL action for keys '" + keys + "'");
state = State.ERROR;
}
}
}
private void handleBranchNode(@NotNull Editor editor, @NotNull DataContext context, @NotNull CommandState editorState, char key,
@NotNull BranchNode node) {
logger.debug("branch node");
private void handleBranchNode(@NotNull Editor editor, @NotNull DataContext context, @NotNull CommandState editorState,
char key, @NotNull BranchNode node) {
// Flag that we aren't allowing any more count digits (unless it's OK)
if ((node.getFlags() & Command.FLAG_ALLOW_MID_COUNT) == 0) {
state = State.COMMAND;
@@ -506,15 +480,11 @@ public class KeyHandler {
* @param context The context to run it in
*/
public static void executeAction(@NotNull String name, @NotNull DataContext context) {
logger.debug("executing action " + name);
ActionManager aMgr = ActionManager.getInstance();
AnAction action = aMgr.getAction(name);
if (action != null) {
executeAction(action, context);
}
else {
logger.debug("Unknown action");
}
}
/**
@@ -524,21 +494,14 @@ public class KeyHandler {
* @param context The context to run it in
*/
public static void executeAction(@NotNull AnAction action, @NotNull DataContext context) {
if (logger.isDebugEnabled()) {
logger.debug("executing action " + action);
}
// Hopefully all the arguments are sufficient. So far they all seem to work OK.
// We don't have a specific InputEvent so that is null
// What is "place"? Leave it the empty string for now.
// Is the template presentation sufficient?
// What are the modifiers? Is zero OK?
action.actionPerformed(new AnActionEvent(
null,
context,
"",
action.getTemplatePresentation(),
ActionManager.getInstance(), // API change - don't merge
action.actionPerformed(
new AnActionEvent(null, context, "", action.getTemplatePresentation(), ActionManager.getInstance(),
// API change - don't merge
0));
}
@@ -553,7 +516,6 @@ public class KeyHandler {
keys = new ArrayList<KeyStroke>();
CommandState editorState = CommandState.getInstance(editor);
editorState.setCurrentNode(KeyParser.getInstance().getKeyRoot(editorState.getMappingMode()));
logger.debug("partialReset");
}
/**
@@ -567,7 +529,6 @@ public class KeyHandler {
currentCmd.clear();
currentArg = Argument.Type.NONE;
digraph = null;
logger.debug("reset");
}
/**
@@ -602,8 +563,7 @@ public class KeyHandler {
boolean wasRecording = editorState.isRecording();
executeAction(cmd.getAction(), context);
if (editorState.getMode() == CommandState.Mode.INSERT ||
editorState.getMode() == CommandState.Mode.REPLACE) {
if (editorState.getMode() == CommandState.Mode.INSERT || editorState.getMode() == CommandState.Mode.REPLACE) {
CommandGroups.getInstance().getChange().processCommand(editor, cmd);
}
@@ -656,5 +616,4 @@ public class KeyHandler {
private boolean lastWasBS;
private static KeyHandler instance;
private static Logger logger = Logger.getInstance(KeyHandler.class.getName());
}

View File

@@ -1,3 +1,21 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim;
import com.google.common.base.Joiner;
@@ -6,24 +24,19 @@ import com.google.common.io.Resources;
import com.intellij.notification.Notification;
import com.intellij.notification.NotificationType;
import com.intellij.notification.Notifications;
import com.intellij.openapi.actionSystem.Shortcut;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ApplicationNamesInfo;
import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.application.ex.ApplicationEx;
import com.intellij.openapi.application.ex.ApplicationManagerEx;
import com.intellij.openapi.components.impl.stores.StorageUtil;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.keymap.Keymap;
import com.intellij.openapi.keymap.KeymapManager;
import com.intellij.openapi.keymap.impl.KeymapImpl;
import com.intellij.openapi.keymap.impl.KeymapManagerImpl;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.JDOMUtil;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.maddyhome.idea.vim.ui.VimKeymapDialog;
import org.jdom.Document;
import org.jdom.Element;
@@ -31,6 +44,9 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.*;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import static com.google.common.io.ByteStreams.toByteArray;
@@ -56,10 +72,6 @@ public class VimKeyMapUtil {
*/
public static boolean installKeyBoardBindings() {
LOG.debug("Check for keyboard bindings");
if (isVimKeymapInstalled()) {
return true;
}
final LocalFileSystem localFileSystem = LocalFileSystem.getInstance();
if (localFileSystem.refreshAndFindFileByPath(KEYMAPS_PATH) == null) {
reportError("Failed to install vim keymap. Empty keymaps folder");
@@ -71,9 +83,11 @@ public class VimKeyMapUtil {
final byte[] bytes = toByteArray(retrieveSourceKeymapStream());
Files.write(bytes, new File(INSTALLED_VIM_KEYMAP_PATH));
final Document document = StorageUtil.loadDocument(bytes);
if (!ApplicationManager.getApplication().isUnitTestMode()) {
if (document != null && !ApplicationManager.getApplication().isUnitTestMode()) {
// Prompt user to select the parent for the Vim keyboard
configureVimParentKeymap(INSTALLED_VIM_KEYMAP_PATH, document, false);
if (!configureVimParentKeymap(INSTALLED_VIM_KEYMAP_PATH, document, true)) {
return false;
}
}
installKeymap(document);
} catch (IOException e) {
@@ -101,47 +115,53 @@ public class VimKeyMapUtil {
keymapManager.addKeymap(vimKeyMap);
}
private static void requestRestartOrShutdown(final Project project) {
final ApplicationEx app = ApplicationManagerEx.getApplicationEx();
if (app.isRestartCapable()) {
if (Messages.showDialog(project, "Restart " + ApplicationNamesInfo.getInstance().getProductName() + " to activate changes?",
VimPlugin.IDEAVIM_NOTIFICATION_TITLE, new String[]{"&Restart", "&Postpone"}, 0,
Messages.getQuestionIcon()) == 0) {
app.restart();
}
} else {
if (Messages.showDialog(project, "Shut down " + ApplicationNamesInfo.getInstance().getProductName() + " to activate changes?",
VimPlugin.IDEAVIM_NOTIFICATION_TITLE, new String[]{"&Shut Down", "&Postpone"}, 0,
Messages.getQuestionIcon()) == 0) {
app.exit(true);
}
}
}
/**
* Changes parent keymap for the Vim
*
* @return true if document was changed successfully
*/
private static boolean configureVimParentKeymap(final String path, @NotNull final Document document, final boolean showNotification) throws IOException {
private static boolean configureVimParentKeymap(final String path, @NotNull final Document document,
final boolean showNotification)
throws IOException, InvalidDataException {
final Element rootElement = document.getRootElement();
final String parentKeymap = rootElement.getAttributeValue("parent");
final VimKeymapDialog vimKeymapDialog = new VimKeymapDialog(parentKeymap);
final String parentKeymapName = rootElement.getAttributeValue("parent");
final VimKeymapDialog vimKeymapDialog = new VimKeymapDialog(parentKeymapName);
vimKeymapDialog.show();
if (vimKeymapDialog.getExitCode() != DialogWrapper.OK_EXIT_CODE) {
return false;
}
rootElement.removeAttribute("parent");
final Keymap selectedKeymap = vimKeymapDialog.getSelectedKeymap();
final String keymapName = selectedKeymap.getName();
final Keymap parentKeymap = vimKeymapDialog.getSelectedKeymap();
final String keymapName = parentKeymap.getName();
VimKeymapConflictResolveUtil.resolveConflicts(rootElement, parentKeymap);
// We cannot set a user-defined modifiable keymap as the parent of our Vim keymap so we have to copy its shortcuts
if (parentKeymap.canModify()) {
final KeymapImpl vimKeyMap = new KeymapImpl();
final KeymapManager keymapManager = KeymapManager.getInstance();
final KeymapManagerImpl keymapManagerImpl = (KeymapManagerImpl)keymapManager;
final Keymap[] allKeymaps = keymapManagerImpl.getAllKeymaps();
vimKeyMap.readExternal(rootElement, allKeymaps);
final HashSet<String> ownActions = new HashSet<String>(Arrays.asList(vimKeyMap.getOwnActionIds()));
final KeymapImpl parentKeymapImpl = (KeymapImpl)parentKeymap;
for (String parentAction : parentKeymapImpl.getOwnActionIds()) {
if (!ownActions.contains(parentAction)) {
final List<Shortcut> shortcuts = Arrays.asList(parentKeymap.getShortcuts(parentAction));
rootElement.addContent(VimKeymapConflictResolveUtil.createActionElement(parentAction, shortcuts));
}
}
final Keymap grandParentKeymap = parentKeymap.getParent();
rootElement.setAttribute("parent", grandParentKeymap.getName());
}
else {
rootElement.setAttribute("parent", keymapName);
}
VimPlugin.getInstance().setPreviousKeyMap(keymapName);
// Save modified keymap to the file
JDOMUtil.writeDocument(document, path, "\n");
if (showNotification) {
Notifications.Bus.notify(new Notification(VimPlugin.IDEAVIM_NOTIFICATION_ID, VimPlugin.IDEAVIM_NOTIFICATION_TITLE,
"Successfully configured vim keymap to be based on " +
selectedKeymap.getPresentableName(),
parentKeymap.getPresentableName(),
NotificationType.INFORMATION));
}
@@ -194,30 +214,6 @@ public class VimKeyMapUtil {
return true;
}
public static void reconfigureParentKeymap(final Project project) {
final VirtualFile vimKeymapFile = getVimKeymapFile();
if (vimKeymapFile == null) {
reportError("Failed to find Vim keymap");
return;
}
try {
final Document document = StorageUtil.loadDocument(new FileInputStream(vimKeymapFile.getPath()));
// Prompt user to select the parent for the Vim keyboard
if (configureVimParentKeymap(vimKeymapFile.getPath(), document, true)) {
installKeymap(document);
requestRestartOrShutdown(project);
}
} catch (FileNotFoundException e) {
reportError("Failed to install vim keymap.", e);
} catch (IOException e) {
reportError("Failed to install vim keymap.", e);
} catch (InvalidDataException e) {
reportError("Failed to install vim keymap. Vim.xml file is corrupted", e);
}
}
@NotNull
private static InputStream retrieveSourceKeymapStream() throws IOException {
String keymapPath = PATH_JOINER.join(PathManager.getPluginsPath(), VimPlugin.IDEAVIM_NOTIFICATION_TITLE, VIM_XML);
@@ -241,9 +237,4 @@ public class VimKeyMapUtil {
Notifications.Bus.notify(new Notification(VimPlugin.IDEAVIM_NOTIFICATION_ID, VimPlugin.IDEAVIM_NOTIFICATION_TITLE,
message + String.valueOf(e), NotificationType.ERROR));
}
@Nullable
public static VirtualFile getVimKeymapFile() {
return LocalFileSystem.getInstance().refreshAndFindFileByPath(INSTALLED_VIM_KEYMAP_PATH);
}
}

View File

@@ -0,0 +1,242 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim;
import com.google.common.collect.ImmutableList;
import com.intellij.openapi.actionSystem.KeyboardShortcut;
import com.intellij.openapi.actionSystem.MouseShortcut;
import com.intellij.openapi.actionSystem.Shortcut;
import com.intellij.openapi.keymap.Keymap;
import com.intellij.openapi.keymap.impl.KeymapImpl;
import com.intellij.openapi.util.SystemInfo;
import org.jdom.Element;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import java.awt.event.InputEvent;
import java.awt.event.MouseEvent;
import java.util.*;
import static com.google.common.collect.Lists.newLinkedList;
import static com.google.common.collect.Maps.newHashMap;
/**
* User: zolotov
* Date: 1/8/13
*/
public class VimKeymapConflictResolveUtil {
private static final String SHIFT = "shift";
private static final String CONTROL = "control";
private static final String META = "meta";
private static final String ALT = "alt";
private static final String ALT_GRAPH = "altGraph";
private static final String DOUBLE_CLICK = "doubleClick";
private static final String VIM_KEY_HANDLER_ACTION_ID = "VimKeyHandler";
private static final String ACTION_TAG = "action";
private static final String KEYBOARD_SHORTCUT_TAG = "keyboard-shortcut";
private static final String MOUSE_SHORTCUT_TAG = "mouse-shortcut";
private static final String ID_ATTRIBUTE = "id";
private static final String FIRST_KEYSTROKE_ATTRIBUTE = "first-keystroke";
private static final String KEYSTROKE_ATTRIBUTE = "keystroke";
private static final String SECOND_KEYSTROKE_ATTRIBUTE = "second-keystroke";
private static final List<Integer> ALTERNATIVE_MODIFIERS = ImmutableList.of(
InputEvent.ALT_DOWN_MASK,
InputEvent.CTRL_DOWN_MASK,
InputEvent.SHIFT_DOWN_MASK,
InputEvent.META_DOWN_MASK,
InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK,
InputEvent.ALT_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK,
InputEvent.ALT_DOWN_MASK | InputEvent.META_DOWN_MASK,
InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK,
InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK);
public static void resolveConflicts(Element targetKeymapRoot, Keymap parentKeymap) {
final Collection<String> vimHandlingShortcuts = getVimHandlingShortcuts(targetKeymapRoot);
final Map<String, List<Shortcut>> shortcutsToOverride = retrieveShortcutsToOverride(vimHandlingShortcuts, parentKeymap);
overrideShortcuts(targetKeymapRoot, shortcutsToOverride);
}
/**
* @param targetKeymapRoot root element of Vim keymap
* @return all shortcuts in string representation that should be handled by Vim plugin
*/
private static Collection<String> getVimHandlingShortcuts(Element targetKeymapRoot) {
Element vimKeyHandlerAction = retrieveActionElement(targetKeymapRoot);
if (vimKeyHandlerAction != null) {
Collection<String> result = newLinkedList();
for (Object childAction : vimKeyHandlerAction.getChildren()) {
if (childAction instanceof Element) {
Element shortcut = (Element)childAction;
result.add(shortcut.getAttributeValue(FIRST_KEYSTROKE_ATTRIBUTE));
}
}
return result;
}
return Collections.emptyList();
}
/**
* @param targetKeymapRoot root element of Vim keymap
* @return Retrieve VimKeyHandler action element
*/
@Nullable
private static Element retrieveActionElement(Element targetKeymapRoot) {
Element vimKeyHandlerAction = null;
for (Object child : targetKeymapRoot.getChildren(ACTION_TAG)) {
if (child instanceof Element) {
Element action = (Element)child;
if (VIM_KEY_HANDLER_ACTION_ID.equals(action.getAttributeValue(ID_ATTRIBUTE))) {
vimKeyHandlerAction = action;
break;
}
}
}
return vimKeyHandlerAction;
}
/**
* @param vimHandlingShortcuts collection of shortcuts that should be handled by Vim plugin
* @param parentKeymap selected parent keymap for vim keymap
* @return mapping of action names to its shortcuts that we should save in Vim-keymap
* (or empty list of shortcuts if action just should be disabled)
*/
private static Map<String, List<Shortcut>> retrieveShortcutsToOverride(Collection<String> vimHandlingShortcuts, Keymap parentKeymap) {
Map<String, List<Shortcut>> result = newHashMap();
for (String shortcut : vimHandlingShortcuts) {
final Map<String, ArrayList<KeyboardShortcut>> conflicts = parentKeymap.getConflicts("", KeyboardShortcut.fromString(shortcut));
for (Map.Entry<String, ArrayList<KeyboardShortcut>> conflict : conflicts.entrySet()) {
String actionName = conflict.getKey();
final ArrayList<KeyboardShortcut> conflictedShortcuts = conflict.getValue();
if (result.containsKey(actionName)) {
// found another conflict for already overridden action
List<Shortcut> overridesShortcuts = result.get(actionName);
for (KeyboardShortcut conflictedShortcut : conflictedShortcuts) {
overridesShortcuts.remove(conflictedShortcut);
}
}
else {
// let's override action with all non-conflict shortcuts
List<Shortcut> overriddenShortcuts = newLinkedList();
for (Shortcut actionShortcut : parentKeymap.getShortcuts(actionName)) {
if (!(actionShortcut instanceof KeyboardShortcut) || !conflictedShortcuts.contains(actionShortcut)) {
overriddenShortcuts.add(actionShortcut);
}
}
if (overriddenShortcuts.isEmpty()) {
for (Integer modifier : ALTERNATIVE_MODIFIERS) {
if (!SystemInfo.isMac && (modifier & InputEvent.META_DOWN_MASK) != 0) {
continue;
}
final KeyStroke originalStroke = KeyStroke.getKeyStroke(shortcut);
final int modifiers = originalStroke.getModifiers() | modifier;
//noinspection MagicConstant
final KeyStroke stroke = KeyStroke.getKeyStroke(originalStroke.getKeyCode(), modifiers);
final KeyboardShortcut alternativeShortcut = new KeyboardShortcut(stroke, null);
if (parentKeymap.getConflicts("", alternativeShortcut).isEmpty()) {
overriddenShortcuts.add(alternativeShortcut);
break;
}
}
}
result.put(actionName, overriddenShortcuts);
}
}
}
return result;
}
/**
* Fill vim keymap with overridden actions.
* Only keyboard and mouse shortcuts will be overridden.
*
* @param targetKeymapRoot root element of Vim keymap
* @param shortcutsToOverride overriding mapping: actions -> shortcuts_should_be_saved
*/
private static void overrideShortcuts(Element targetKeymapRoot, Map<String, List<Shortcut>> shortcutsToOverride) {
for (Map.Entry<String, List<Shortcut>> action : shortcutsToOverride.entrySet()) {
targetKeymapRoot.addContent(createActionElement(action.getKey(), action.getValue()));
}
}
public static Element createActionElement(String actionName, List<Shortcut> shortcuts) {
final Element overridesAction = new Element(ACTION_TAG);
overridesAction.setAttribute(ID_ATTRIBUTE, actionName);
for (Shortcut shortcut : shortcuts) {
if (shortcut instanceof KeyboardShortcut) {
KeyboardShortcut keyboardShortcut = (KeyboardShortcut)shortcut;
final String firstShortcutString = KeymapImpl.getKeyShortcutString(keyboardShortcut.getFirstKeyStroke());
final Element shortcutElement = createShortcutElement(KEYBOARD_SHORTCUT_TAG, FIRST_KEYSTROKE_ATTRIBUTE,
firstShortcutString);
overridesAction.addContent(shortcutElement);
final KeyStroke secondKeyStroke = keyboardShortcut.getSecondKeyStroke();
if (secondKeyStroke != null) {
final String secondShortcutString = KeymapImpl.getKeyShortcutString(secondKeyStroke);
shortcutElement.setAttribute(SECOND_KEYSTROKE_ATTRIBUTE, secondShortcutString);
}
}
else if (shortcut instanceof MouseShortcut) {
overridesAction.addContent(createShortcutElement(MOUSE_SHORTCUT_TAG, KEYSTROKE_ATTRIBUTE, getMouseShortcutString((MouseShortcut)shortcut)));
}
}
return overridesAction;
}
private static Element createShortcutElement(String elementName, String shortcutAttributeName, String shortcut) {
final Element shortcutElement = new Element(elementName);
shortcutElement.setAttribute(shortcutAttributeName, shortcut);
return shortcutElement;
}
/**
* Create string representation of mouse shortcut
* KeymapImpl has implementation for mouse shortcut marshaling, but it is private :-(
*
* @param shortcut mouse shortcut
* @return string representation of mouse shortcut
*/
private static String getMouseShortcutString(MouseShortcut shortcut) {
StringBuilder builder = new StringBuilder();
int modifiers = shortcut.getModifiers();
if ((MouseEvent.SHIFT_DOWN_MASK & modifiers) > 0) {
builder.append(SHIFT).append(' ');
}
if ((MouseEvent.CTRL_DOWN_MASK & modifiers) > 0) {
builder.append(CONTROL).append(' ');
}
if ((MouseEvent.META_DOWN_MASK & modifiers) > 0) {
builder.append(META).append(' ');
}
if ((MouseEvent.ALT_DOWN_MASK & modifiers) > 0) {
builder.append(ALT).append(' ');
}
if ((MouseEvent.ALT_GRAPH_DOWN_MASK & modifiers) > 0) {
builder.append(ALT_GRAPH).append(' ');
}
builder.append("button").append(shortcut.getButton()).append(' ');
if (shortcut.getClickCount() > 1) {
builder.append(DOUBLE_CLICK);
}
return builder.toString().trim();
}
}

View File

@@ -1,25 +1,29 @@
/*
* Copyright 2000-2011 JetBrains s.r.o.
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* http://www.apache.org/licenses/LICENSE-2.0
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim;
import com.intellij.notification.Notification;
import com.intellij.notification.NotificationType;
import com.intellij.notification.Notifications;
import com.intellij.openapi.actionSystem.impl.SimpleDataContext;
import com.intellij.openapi.application.Application;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ex.ApplicationEx;
import com.intellij.openapi.application.ex.ApplicationManagerEx;
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.components.ApplicationComponent;
@@ -39,16 +43,13 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.project.ProjectManagerAdapter;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.wm.StatusBar;
import com.intellij.openapi.wm.WindowManager;
import com.maddyhome.idea.vim.command.CommandState;
import com.maddyhome.idea.vim.ex.CommandParser;
import com.maddyhome.idea.vim.group.*;
import com.maddyhome.idea.vim.helper.DelegateCommandListener;
import com.maddyhome.idea.vim.helper.DocumentManager;
import com.maddyhome.idea.vim.helper.EditorData;
import com.maddyhome.idea.vim.helper.EditorDataContext;
import com.maddyhome.idea.vim.key.RegisterActions;
import com.maddyhome.idea.vim.helper.*;
import com.maddyhome.idea.vim.option.Options;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
@@ -81,18 +82,19 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
private static final String IDEAVIM_COMPONENT_NAME = "VimPlugin";
public static final String IDEAVIM_NOTIFICATION_ID = "ideavim";
public static final String IDEAVIM_NOTIFICATION_TITLE = "IdeaVim";
public static final int STATE_VERSION = 2;
private static final boolean BLOCK_CURSOR_VIM_VALUE = true;
private static final boolean ANIMATED_SCROLLING_VIM_VALUE = false;
private static final boolean REFRAIN_FROM_SCROLLING_VIM_VALUE = true;
private VimTypedActionHandler vimHandler;
private RegisterActions actions;
private boolean isBlockCursor = false;
private boolean isAnimatedScrolling = false;
private boolean isRefrainFromScrolling = false;
private boolean error = false;
private int previousStateVersion = 0;
private String previousKeyMap = "";
// It is enabled by default to avoid any special configuration after plugin installation
@@ -142,6 +144,7 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
ApplicationManager.getApplication().invokeLater(new Runnable() {
public void run() {
updateState();
checkAndInstallKeymap();
}
});
@@ -156,11 +159,50 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
// Add some listeners so we can handle special events
setupListeners();
getActions();
// Register vim actions in command mode
RegisterActions.registerActions();
// Register ex handlers
CommandParser.getInstance().registerHandlers();
LOG.debug("done");
}
private void updateState() {
if (isEnabled() && !ApplicationManager.getApplication().isUnitTestMode()) {
boolean requiresRestart = false;
if (previousStateVersion < 1 && SystemInfo.isMac && VimKeyMapUtil.isVimKeymapInstalled()) {
if (Messages.showYesNoDialog("Vim keymap generator has been updated to create keymaps more compatible " +
"with base keymaps.\n\nDo you want to reconfigure your Vim keymap?\n\n" +
"Warning: Any custom shortcuts will be lost!\n\n" +
"(You can do it later using Tools | Reconfigure Vim Keymap).",
IDEAVIM_NOTIFICATION_TITLE,
Messages.getQuestionIcon()) == Messages.YES) {
KeyHandler.executeAction("VimReconfigureKeymap", SimpleDataContext.getProjectContext(null));
}
}
if (previousStateVersion < 2 && SystemInfo.isMac) {
final MacKeyRepeat keyRepeat = MacKeyRepeat.getInstance();
final Boolean enabled = keyRepeat.isEnabled();
if (enabled == null || !enabled) {
if (Messages.showYesNoDialog("Do you want to enable repeating keys in Mac OS X on press and hold " +
"(requires restart)?\n\n" +
"(You can do it manually by running 'defaults write -g " +
"ApplePressAndHoldEnabled 0' in the console).",
IDEAVIM_NOTIFICATION_TITLE,
Messages.getQuestionIcon()) == Messages.YES) {
keyRepeat.setEnabled(true);
requiresRestart = true;
}
}
}
if (requiresRestart) {
final ApplicationEx app = ApplicationManagerEx.getApplicationEx();
app.restart();
}
}
}
private static void checkAndInstallKeymap() {
// Ensure that Vim keymap is installed and install if not.
// Moreover we can use installed keymap as indicator of the first time installed plugin
@@ -212,7 +254,8 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
if (VimPlugin.isEnabled()) {
// Turn on insert mode if editor doesn't have any file
if (!EditorData.isFileEditor(editor) && !CommandState.inInsertMode(editor)) {
if (!EditorData.isFileEditor(editor) && editor.getDocument().isWritable() &&
!CommandState.inInsertMode(editor)) {
KeyHandler.getInstance().handleKey(editor, KeyStroke.getKeyStroke('i'), new EditorDataContext(editor));
}
editor.getSettings().setBlockCursor(!CommandState.inInsertMode(editor));
@@ -264,6 +307,11 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
// Restore whether the plugin is enabled or not
Element state = element.getChild("state");
if (state != null) {
try {
previousStateVersion = Integer.valueOf(state.getAttributeValue("version"));
}
catch (NumberFormatException ignored) {
}
enabled = Boolean.valueOf(state.getAttributeValue("enabled"));
previousKeyMap = state.getAttributeValue("keymap");
}
@@ -278,6 +326,7 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
final Element element = new Element("ideavim");
// Save whether the plugin is enabled or not
final Element state = new Element("state");
state.setAttribute("version", Integer.toString(STATE_VERSION));
state.setAttribute("enabled", Boolean.toString(enabled));
state.setAttribute("keymap", previousKeyMap);
element.addContent(state);
@@ -310,7 +359,7 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
}
/**
* Inidicate to the user that an error has occurred. Just beep.
* Indicate to the user that an error has occurred. Just beep.
*/
public static void indicateError() {
if (ApplicationManager.getApplication().isUnitTestMode()) {
@@ -327,9 +376,9 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
public static void showMessage(@Nullable String msg) {
ProjectManager pm = ProjectManager.getInstance();
Project[] projs = pm.getOpenProjects();
for (Project proj : projs) {
StatusBar bar = WindowManager.getInstance().getStatusBar(proj);
Project[] projects = pm.getOpenProjects();
for (Project project : projects) {
StatusBar bar = WindowManager.getInstance().getStatusBar(project);
if (bar != null) {
if (msg == null || msg.length() == 0) {
bar.setInfo("");
@@ -382,17 +431,6 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
}
}
private RegisterActions getActions() {
if (actions == null) {
// Register vim actions in command mode
actions = RegisterActions.getInstance();
// Register ex handlers
CommandParser.getInstance().registerHandlers();
}
return actions;
}
public boolean isError() {
return error;
}

View File

@@ -1,3 +1,21 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim;
import com.intellij.openapi.actionSystem.AnActionEvent;

View File

@@ -1,9 +1,26 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import org.jetbrains.annotations.NotNull;
/**
@@ -18,6 +35,7 @@ public class VimReconfigureKeymapAction extends AnAction implements DumbAware {
@Override
public void actionPerformed(@NotNull final AnActionEvent e) {
VimKeyMapUtil.reconfigureParentKeymap(e.getData(PlatformDataKeys.PROJECT));
VimKeyMapUtil.installKeyBoardBindings();
VimKeyMapUtil.switchKeymapBindings(true);
}
}

View File

@@ -1,80 +0,0 @@
package com.maddyhome.idea.vim;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.HashSet;
public class VimSettings {
public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public HashSet getChoices() {
return choices;
}
public void setChoices(HashSet choices) {
this.choices = choices;
}
public boolean equals(@Nullable Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final VimSettings that = (VimSettings)o;
if (enabled != that.enabled) {
return false;
}
return choices.equals(that.choices);
}
public int hashCode() {
int result;
result = (enabled ? 1 : 0);
result = 29 * result + choices.hashCode();
return result;
}
@NotNull
public String toString() {
final StringBuffer sb = new StringBuffer();
sb.append("VimSettings");
sb.append("{enabled=").append(enabled);
sb.append(", choices=").append(choices);
sb.append('}');
return sb.toString();
}
private boolean enabled;
private HashSet choices = new HashSet();
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim;
import com.intellij.codeInsight.lookup.LookupEx;
import com.intellij.codeInsight.lookup.LookupManager;
import com.intellij.openapi.actionSystem.DataContext;
@@ -75,6 +74,10 @@ public class VimTypedActionHandler implements TypedActionHandler {
return;
}
// Run key handler outside of the key typed command for creating our own undoable commands
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
try {
handler.handleKey(editor, KeyStroke.getKeyStroke(charTyped), context);
}
@@ -82,6 +85,8 @@ public class VimTypedActionHandler implements TypedActionHandler {
logger.error(e);
}
}
});
}
private TypedActionHandler origHandler;
private KeyHandler handler;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.diagnostic.Logger;
import org.jetbrains.annotations.NotNull;

View File

@@ -1,12 +1,11 @@
package com.maddyhome.idea.vim.action;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -14,10 +13,11 @@ package com.maddyhome.idea.vim.action;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action;
import com.intellij.openapi.actionSystem.AnAction;
public interface DelegateAction {

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -36,7 +35,7 @@ public class ExEntryAction extends EditorAction {
}
private static class Handler extends AbstractEditorActionHandler {
protected boolean execute(@NotNull Editor editor, DataContext context, @NotNull Command cmd) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
CommandGroups.getInstance().getProcess().startExCommand(editor, context, cmd);
return true;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.editor.Editor;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.diagnostic.Logger;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2006 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Editor;
@@ -27,7 +26,6 @@ import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
import com.maddyhome.idea.vim.KeyHandler;
import com.maddyhome.idea.vim.VimPlugin;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
@@ -44,11 +42,11 @@ public class PassThruDelegateEditorAction extends AbstractDelegateEditorAction {
this.origHandler = handler;
}
public void execute(@Nullable Editor editor, @NotNull DataContext dataContext) {
public void execute(@NotNull Editor editor, @NotNull DataContext dataContext) {
if (logger.isDebugEnabled()) {
logger.debug("actionPerformed key=" + stroke);
}
if (editor == null || !VimPlugin.isEnabled()) {
if (!VimPlugin.isEnabled()) {
origHandler.execute(editor, dataContext);
}
else {

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action;
import com.intellij.openapi.editor.actionSystem.EditorAction;
import com.maddyhome.idea.vim.handler.ResetModeHandler;

View File

@@ -1,36 +0,0 @@
package com.maddyhome.idea.vim.action;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.diagnostic.Logger;
/**
*
*/
public class TxActionWrapper extends AbstractDelegateAction {
public void actionPerformed(AnActionEvent event) {
logger.debug("actionPerformed");
getOrigAction().actionPerformed(event);
}
private static Logger logger = Logger.getInstance(TxActionWrapper.class.getName());
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -35,7 +34,7 @@ public class RedoAction extends EditorAction {
}
private static class Handler extends AbstractEditorActionHandler {
protected boolean execute(Editor editor, @NotNull DataContext context, Command cmd) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
return UndoRedoHelper.redo(context);
}
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -39,7 +38,7 @@ public class RepeatChangeAction extends EditorAction {
}
private static class Handler extends AbstractEditorActionHandler {
public boolean execute(Editor editor, @NotNull DataContext context, @NotNull Command command) {
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command command) {
CommandState state = CommandState.getInstance(editor);
Command cmd = state.getLastChangeCommand();
if (cmd != null) {
@@ -65,7 +64,9 @@ public class RepeatChangeAction extends EditorAction {
// oops
}
state.popState();
if (save != null) {
state.setCommand(save);
}
state.saveLastChangeCommand(cmd);
CommandGroups.getInstance().getRegister().selectRegister(reg);

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -36,7 +35,7 @@ public class RepeatExCommandAction extends EditorAction {
}
private static class Handler extends AbstractEditorActionHandler {
public boolean execute(@NotNull Editor editor, DataContext context, @NotNull Command command) {
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command command) {
int count = command.getCount();
try {
return CommandParser.getInstance().processLastCommand(editor, context, count);

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -35,7 +34,7 @@ public class UndoAction extends EditorAction {
}
private static class Handler extends AbstractEditorActionHandler {
protected boolean execute(Editor editor, @NotNull DataContext context, Command cmd) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
return UndoRedoHelper.undo(context);
}
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -38,7 +37,8 @@ public class ChangeCaseLowerVisualAction extends EditorAction {
}
private static class Handler extends VisualOperatorActionHandler {
protected boolean execute(@NotNull Editor editor, DataContext context, Command cmd, TextRange range) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
@NotNull TextRange range) {
return CommandGroups.getInstance().getChange().changeCaseRange(InjectedLanguageUtil.getTopLevelEditor(editor),
range, CharacterHelper.CASE_LOWER);
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -37,7 +36,8 @@ public class ChangeCaseToggleVisualAction extends EditorAction {
}
private static class Handler extends VisualOperatorActionHandler {
protected boolean execute(@NotNull Editor editor, DataContext context, Command cmd, TextRange range) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
@NotNull TextRange range) {
return CommandGroups.getInstance().getChange().changeCaseRange(editor, range, CharacterHelper.CASE_TOGGLE);
}
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -37,7 +36,8 @@ public class ChangeCaseUpperVisualAction extends EditorAction {
}
private static class Handler extends VisualOperatorActionHandler {
protected boolean execute(@NotNull Editor editor, DataContext context, Command cmd, TextRange range) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
@NotNull TextRange range) {
return CommandGroups.getInstance().getChange().changeCaseRange(editor, range, CharacterHelper.CASE_UPPER);
}
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2006 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2006 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -37,7 +36,8 @@ public class ChangeVisualAction extends EditorAction {
}
private static class Handler extends VisualOperatorActionHandler {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, Command cmd, @NotNull TextRange range) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
@NotNull TextRange range) {
final SelectionType type = range.isMultiple() ? SelectionType.BLOCK_WISE : SelectionType.CHARACTER_WISE;
return CommandGroups.getInstance().getChange().changeRange(editor, context, range, type);
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -36,7 +35,7 @@ public class ChangeVisualCharacterAction extends EditorAction {
}
private static class Handler extends VisualOperatorActionHandler {
protected boolean execute(@NotNull Editor editor, DataContext context, @NotNull Command cmd, @NotNull TextRange range) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd, @NotNull TextRange range) {
return CommandGroups.getInstance().getChange().changeCharacterRange(editor, range,
cmd.getArgument().getCharacter());
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -38,7 +37,8 @@ public class ChangeVisualLinesAction extends EditorAction {
}
private static class Handler extends VisualOperatorActionHandler {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, Command cmd, TextRange range) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
@NotNull TextRange range) {
range = new TextRange(EditorHelper.getLineStartForOffset(editor, range.getStartOffset()),
EditorHelper.getLineEndForOffset(editor, range.getEndOffset()) + 1);

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -38,7 +37,8 @@ public class ChangeVisualLinesEndAction extends EditorAction {
}
private static class Handler extends VisualOperatorActionHandler {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, Command cmd, @NotNull TextRange range) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
@NotNull TextRange range) {
if (range.isMultiple()) {
int[] starts = range.getStartOffsets();
int[] ends = range.getEndOffsets();

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -35,7 +34,7 @@ public class FilterCountLinesAction extends EditorAction {
}
private static class Handler extends AbstractEditorActionHandler {
protected boolean execute(@NotNull Editor editor, DataContext context, @NotNull Command cmd) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
CommandGroups.getInstance().getProcess().startFilterCommand(editor, context, cmd);
return true;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.LogicalPosition;
@@ -38,7 +37,7 @@ public class FilterMotionAction extends EditorAction {
}
private static class Handler extends AbstractEditorActionHandler {
protected boolean execute(@NotNull Editor editor, DataContext context, @NotNull Command cmd) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
TextRange range = MotionGroup.getMotionRange(editor, context, cmd.getCount(), cmd.getRawCount(),
cmd.getArgument(), false, false);
if (range == null) {

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.change;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -35,7 +34,7 @@ public class FilterVisualLinesAction extends EditorAction {
}
private static class Handler extends AbstractEditorActionHandler {
protected boolean execute(@NotNull Editor editor, DataContext context, @NotNull Command cmd) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
CommandGroups.getInstance().getProcess().startFilterCommand(editor, context, cmd);
CommandGroups.getInstance().getMotion().resetVisual(editor, true);

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.delete;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.delete;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -36,7 +35,7 @@ public class DeleteCharacterAction extends EditorAction {
private static class Handler extends ChangeEditorActionHandler {
public boolean execute(@NotNull Editor editor, DataContext context, int count, int rawCount, Argument argument) {
return CommandGroups.getInstance().getChange().deleteCharacter(editor, 1);
return CommandGroups.getInstance().getChange().deleteCharacter(editor, 1, false);
}
}
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.delete;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.delete;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -36,7 +35,7 @@ public class DeleteCharacterLeftAction extends EditorAction {
private static class Handler extends ChangeEditorActionHandler {
public boolean execute(@NotNull Editor editor, DataContext context, int count, int rawCount, Argument argument) {
return CommandGroups.getInstance().getChange().deleteCharacter(editor, -count);
return CommandGroups.getInstance().getChange().deleteCharacter(editor, -count, false);
}
}
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.delete;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.delete;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -36,7 +35,7 @@ public class DeleteCharacterRightAction extends EditorAction {
private static class Handler extends ChangeEditorActionHandler {
public boolean execute(@NotNull Editor editor, DataContext context, int count, int rawCount, Argument argument) {
return CommandGroups.getInstance().getChange().deleteCharacter(editor, count);
return CommandGroups.getInstance().getChange().deleteCharacter(editor, count, false);
}
}
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.delete;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.delete;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.delete;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.delete;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.delete;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.delete;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.delete;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.delete;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -36,7 +35,8 @@ public class DeleteJoinVisualLinesAction extends EditorAction {
}
private static class Handler extends VisualOperatorActionHandler {
protected boolean execute(@NotNull Editor editor, DataContext context, Command cmd, @NotNull TextRange range) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
@NotNull TextRange range) {
if (editor.isOneLineMode()) {
return false;
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.delete;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.delete;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -36,7 +35,8 @@ public class DeleteJoinVisualLinesSpacesAction extends EditorAction {
}
private static class Handler extends VisualOperatorActionHandler {
protected boolean execute(@NotNull Editor editor, DataContext context, Command cmd, @NotNull TextRange range) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
@NotNull TextRange range) {
if (editor.isOneLineMode()) {
return false;
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.delete;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.delete;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.delete;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.delete;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.delete;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.delete;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -39,7 +38,8 @@ public class DeleteVisualAction extends EditorAction {
}
private static class Handler extends VisualOperatorActionHandler {
protected boolean execute(@NotNull Editor editor, DataContext context, Command cmd, TextRange range) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
@NotNull TextRange range) {
CommandState.SubMode mode = CommandState.getInstance(editor).getSubMode();
if (mode == CommandState.SubMode.VISUAL_LINE) {
range = new TextRange(EditorHelper.getLineStartForOffset(editor, range.getStartOffset()),
@@ -47,7 +47,7 @@ public class DeleteVisualAction extends EditorAction {
}
return CommandGroups.getInstance().getChange().deleteRange(editor, range,
SelectionType.fromSubMode(mode));
SelectionType.fromSubMode(mode), false);
}
}
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.delete;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.delete;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -39,17 +38,18 @@ public class DeleteVisualLinesAction extends EditorAction {
}
private static class Handler extends VisualOperatorActionHandler {
protected boolean execute(@NotNull Editor editor, DataContext context, Command cmd, TextRange range) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
@NotNull TextRange range) {
CommandState.SubMode mode = CommandState.getInstance(editor).getSubMode();
if (mode == CommandState.SubMode.VISUAL_BLOCK) {
return CommandGroups.getInstance().getChange().deleteRange(editor, range,
SelectionType.fromSubMode(mode));
SelectionType.fromSubMode(mode), false);
}
else {
range = new TextRange(EditorHelper.getLineStartForOffset(editor, range.getStartOffset()),
EditorHelper.getLineEndForOffset(editor, range.getEndOffset()) + 1);
return CommandGroups.getInstance().getChange().deleteRange(editor, range, SelectionType.LINE_WISE);
return CommandGroups.getInstance().getChange().deleteRange(editor, range, SelectionType.LINE_WISE, false);
}
}
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.delete;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.delete;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -38,7 +37,8 @@ public class DeleteVisualLinesEndAction extends EditorAction {
}
private static class Handler extends VisualOperatorActionHandler {
protected boolean execute(@NotNull Editor editor, DataContext context, Command cmd, @NotNull TextRange range) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
@NotNull TextRange range) {
if (range.isMultiple()) {
int[] starts = range.getStartOffsets();
int[] ends = range.getEndOffsets();
@@ -50,14 +50,14 @@ public class DeleteVisualLinesEndAction extends EditorAction {
range = new TextRange(starts, ends);
return CommandGroups.getInstance().getChange().deleteRange(editor, range,
SelectionType.BLOCK_WISE);
SelectionType.BLOCK_WISE, false);
}
else {
range = new TextRange(EditorHelper.getLineStartForOffset(editor, range.getStartOffset()),
EditorHelper.getLineEndForOffset(editor, range.getEndOffset()) + 1);
return CommandGroups.getInstance().getChange().deleteRange(editor, range,
SelectionType.LINE_WISE);
SelectionType.LINE_WISE, false);
}
}
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.insert;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.insert;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.insert;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.insert;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.insert;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.insert;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -35,7 +34,7 @@ public class InsertCharacterAboveCursorAction extends EditorAction {
}
private static class Handler extends AbstractEditorActionHandler {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, Command cmd) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
if (editor.isOneLineMode()) {
return false;
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.insert;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -35,7 +34,7 @@ public class InsertCharacterBelowCursorAction extends EditorAction {
}
private static class Handler extends AbstractEditorActionHandler {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, Command cmd) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
if (editor.isOneLineMode()) {
return false;
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.insert;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -35,7 +34,7 @@ public class InsertDeleteInsertedTextAction extends EditorAction {
}
private static class Handler extends AbstractEditorActionHandler {
public boolean execute(@NotNull Editor editor, DataContext context, Command cmd) {
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
return CommandGroups.getInstance().getChange().insertDeleteInsertedText(editor);
}
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.insert;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -35,7 +34,7 @@ public class InsertDeletePreviousWordAction extends EditorAction {
}
private static class Handler extends AbstractEditorActionHandler {
public boolean execute(@NotNull Editor editor, DataContext context, Command cmd) {
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
return CommandGroups.getInstance().getChange().insertDeletePreviousWord(editor);
}
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.insert;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -35,13 +34,8 @@ public class InsertEnterAction extends EditorAction {
}
private static class Handler extends EditorActionHandler {
public void execute(Editor editor, @NotNull DataContext context) {
editor = InjectedLanguageUtil.getTopLevelEditor(editor);
if (editor.isOneLineMode()) {
return;
}
CommandGroups.getInstance().getChange().processEnter(editor, context);
public void execute(@NotNull Editor editor, @NotNull DataContext context) {
CommandGroups.getInstance().getChange().processEnter(InjectedLanguageUtil.getTopLevelEditor(editor), context);
}
}
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.insert;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.insert;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.insert;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.insert;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.insert;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.insert;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.insert;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.insert;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.insert;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.insert;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -35,7 +34,7 @@ public class InsertSingleCommandAction extends EditorAction {
}
private static class Handler extends EditorActionHandler {
public void execute(@NotNull Editor editor, DataContext context) {
public void execute(@NotNull Editor editor, @NotNull DataContext context) {
CommandGroups.getInstance().getChange().processSingleCommand(InjectedLanguageUtil.getTopLevelEditor(editor));
}
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.insert;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -36,7 +35,8 @@ public class VisualBlockAppendAction extends EditorAction {
}
private static class Handler extends VisualOperatorActionHandler {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, Command cmd, @NotNull TextRange range) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
@NotNull TextRange range) {
if (editor.isOneLineMode()) {
return false;
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.insert;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -36,7 +35,8 @@ public class VisualBlockInsertAction extends EditorAction {
}
private static class Handler extends VisualOperatorActionHandler {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, Command cmd, @NotNull TextRange range) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
@NotNull TextRange range) {
if (editor.isOneLineMode()) {
return false;
}

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.shift;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.shift;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.shift;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.shift;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.shift;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.shift;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.shift;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.shift;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.shift;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.shift;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.shift;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.shift;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -36,7 +35,7 @@ public class ShiftLeftVisualAction extends EditorAction {
}
private static class Handler extends VisualOperatorActionHandler {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd, TextRange range) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd, @NotNull TextRange range) {
CommandGroups.getInstance().getChange().indentRange(editor, context, range, cmd.getCount(), -1);
return true;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.shift;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.shift;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.shift;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.shift;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.shift;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.shift;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.change.shift;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.change.shift;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.shift;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;
@@ -36,7 +35,7 @@ public class ShiftRightVisualAction extends EditorAction {
}
private static class Handler extends VisualOperatorActionHandler {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd, TextRange range) {
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd, @NotNull TextRange range) {
CommandGroups.getInstance().getChange().indentRange(editor, context, range, cmd.getCount(), 1);
return true;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.copy;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.copy;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.copy;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.copy;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.copy;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.copy;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.copy;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.copy;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.copy;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.copy;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.copy;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.copy;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

View File

@@ -1,13 +1,11 @@
package com.maddyhome.idea.vim.action.copy;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2005 Rick Maddy
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2013 The IdeaVim authors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,10 +13,11 @@ package com.maddyhome.idea.vim.action.copy;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.copy;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorAction;

Some files were not shown because too many files have changed in this diff Show More