1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-04-27 07:15:43 +02:00

Make master branch uptoday after cvs2git migration

This commit is contained in:
Oleg Shpynov 2011-03-10 11:14:48 +03:00
parent 47094cef2b
commit 2e587c4767
263 changed files with 3675 additions and 8221 deletions
plugin.xml
resources/META-INF
src/com/maddyhome/idea/vim
VimSettings.java
action
command
common
ex
group
handler

View File

@ -1,257 +0,0 @@
<idea-plugin url="http://sourceforge.net/projects/ideavim/">
<name>@NAME@</name>
<description>VIM Emulator. This plugin provides key mappings in IDEA to emulate vi/vim/gvim. Please see the README file for key mapping installation. Required for a first time install.</description>
<version>@VERSION@-@IDEA-VERSION@</version>
<vendor email="rick@maddyhome.com">Rick Maddy</vendor>
<change-notes>
<![CDATA[
Bug Fixes<br>
- The Escape key is passed up to IDEA if not used by VIM first. This fix solves
minor issues such as not being able to clear highlighted text using the
Ctrl-Shift-F7, for example.<br>
- :quit command now works in all forms (e.g. :q, :qu, :qui, :quit).<br>
- Performing a change command while in visual mode now properly terminates
visual mode.<br>
- Fixed internal error caused when trying to use visual mode with IDEA's
"column mode".<br>
]]>
</change-notes>
<idea-version since-build="1162"/>
<application-components>
<component>
<implementation-class>com.maddyhome.idea.vim.VimPlugin</implementation-class>
</component>
</application-components>
<project-components>
</project-components>
<actions>
<action id="VimPluginToggle" class="com.maddyhome.idea.vim.VimPlugin$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>
<!-- Motions -->
<!-- Left/Right -->
<action id="VimMotionColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionColumnAction" text="Move to Column"/>
<action id="VimMotionFirstColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstColumnAction" text="Start of Line"/>
<action id="VimMotionFirstNonSpace" class="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstNonSpaceAction" text="First Character of Line"/>
<action id="VimMotionLastColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastColumnAction" text="End of Line"/>
<action id="VimMotionLastMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastMatchCharAction" text="Repeat Last Character Match"/>
<action id="VimMotionLastMatchCharReverse" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastMatchCharReverseAction" text="Repeat Last Character Match in Reverse"/>
<action id="VimMotionLastNonSpace" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastNonSpaceAction" text="Last Character of Line"/>
<action id="VimMotionLeft" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftAction" text="Left"/>
<action id="VimMotionLeftWrap" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftWrapAction" text="Left"/>
<action id="VimMotionLeftMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftMatchCharAction" text="Move Left to Character"/>
<action id="VimMotionLeftTillMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftTillMatchCharAction" text="Move Left till Character"/>
<action id="VimMotionMiddleColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionMiddleColumnAction" text="Middle of Screen"/>
<action id="VimMotionRight" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightAction" text="Right"/>
<action id="VimMotionRightWrap" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightWrapAction" text="Right"/>
<action id="VimMotionRightMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightMatchCharAction" text="Move Right to Character"/>
<action id="VimMotionRightTillMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightTillMatchCharAction" text="Move Right till Character"/>
<!-- Up/Down -->
<action id="VimMotionDown" class="com.maddyhome.idea.vim.action.motion.updown.MotionDownAction" text="Down"/>
<action id="VimMotionDownFirstNonSpace" class="com.maddyhome.idea.vim.action.motion.updown.MotionDownFirstNonSpaceAction" text="Down to First non-Space"/>
<action id="VimMotionDownLess1FirstNonSpace" class="com.maddyhome.idea.vim.action.motion.updown.MotionDownLess1FirstNonSpaceAction" text="Down to First non-Space"/>
<action id="VimMotionGotoLineFirst" class="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineFirstAction" text="Goto Line"/>
<action id="VimMotionGotoLineLast" class="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineLastAction" text="Goto Line"/>
<action id="VimMotionGotoLineLastEnd" class="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineLastEndAction" text="Goto Line End"/>
<action id="VimMotionPercentOrMatch" class="com.maddyhome.idea.vim.action.motion.updown.MotionPercentOrMatchAction" text="Percent Down or Match"/>
<action id="VimMotionUp" class="com.maddyhome.idea.vim.action.motion.updown.MotionUpAction" text="Up"/>
<action id="VimMotionUpFirstNonSpace" class="com.maddyhome.idea.vim.action.motion.updown.MotionUpFirstNonSpaceAction" text="Up to First non-Space"/>
<!-- Text -->
<action id="VimMotionCamelEndLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionCamelEndLeftAction" text="Camel Word End Left"/>
<action id="VimMotionCamelEndRight" class="com.maddyhome.idea.vim.action.motion.text.MotionCamelEndRightAction" text="Camel Word End Right"/>
<action id="VimMotionCamelLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionCamelLeftAction" text="Camel Word Left"/>
<action id="VimMotionCamelRight" class="com.maddyhome.idea.vim.action.motion.text.MotionCamelRightAction" text="Camel Word Right"/>
<action id="VimMotionNthCharacter" class="com.maddyhome.idea.vim.action.motion.text.MotionNthCharacterAction" text="Nth Character"/>
<action id="VimMotionWordEndLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionWordEndLeftAction" text="Word End Left"/>
<action id="VimMotionBigWordEndLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionBigWordEndLeftAction" text="BigWord End Left"/>
<action id="VimMotionWordEndRight" class="com.maddyhome.idea.vim.action.motion.text.MotionWordEndRightAction" text="Word End Right"/>
<action id="VimMotionBigWordEndRight" class="com.maddyhome.idea.vim.action.motion.text.MotionBigWordEndRightAction" text="BigWord End Right"/>
<action id="VimMotionWordLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionWordLeftAction" text="Word Left"/>
<action id="VimMotionBigWordLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionBigWordLeftAction" text="BigWord Left"/>
<action id="VimMotionWordRight" class="com.maddyhome.idea.vim.action.motion.text.MotionWordRightAction" text="Word Right"/>
<action id="VimMotionBigWordRight" class="com.maddyhome.idea.vim.action.motion.text.MotionBigWordRightAction" text="BigWord Right"/>
<action id="VimMotionParagraphNext" class="com.maddyhome.idea.vim.action.motion.text.MotionParagraphNextAction" text="Next Paragraph"/>
<action id="VimMotionParagraphPrevious" class="com.maddyhome.idea.vim.action.motion.text.MotionParagraphPreviousAction" text="Previous Paragraph"/>
<!-- Text Objects -->
<action id="VimMotionTextOuterWord" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterWordAction" text="Select outer word"/>
<action id="VimMotionTextOuterBigWord" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBigWordAction" text="Select outer WORD"/>
<action id="VimMotionTextInnerWord" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerWordAction" text="Select inner word"/>
<action id="VimMotionTextInnerBigWord" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBigWordAction" text="Select inner WORD"/>
<!-- Marks -->
<action id="VimMotionMark" class="com.maddyhome.idea.vim.action.motion.mark.MotionMarkAction" text="Mark"/>
<action id="VimMotionGotoFileMark" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoFileMarkAction" text="Goto Mark"/>
<action id="VimMotionGotoFileMarkLine" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoFileMarkLineAction" text="Goto Mark Line"/>
<action id="VimMotionGotoMark" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoMarkAction" text="Goto Mark"/>
<action id="VimMotionGotoMarkLine" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoMarkLineAction" text="Goto Mark Line"/>
<!-- Screen -->
<action id="VimMotionFirstScreenLine" class="com.maddyhome.idea.vim.action.motion.screen.MotionFirstScreenLineAction" text="First Screen Line"/>
<action id="VimMotionLastScreenLine" class="com.maddyhome.idea.vim.action.motion.screen.MotionLastScreenLineAction" text="Last Screen Line"/>
<action id="VimMotionLastScreenLineEnd" class="com.maddyhome.idea.vim.action.motion.screen.MotionLastScreenLineEndAction" text="Last Screen Line End"/>
<action id="VimMotionMiddleScreenLine" class="com.maddyhome.idea.vim.action.motion.screen.MotionMiddleScreenLineAction" text="Middle Screen Line"/>
<!-- Scroll -->
<action id="VimMotionScrollFirstScreenLinePageStart" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollFirstScreenLinePageStartAction" text="Scroll Line to Top"/>
<action id="VimMotionScrollFirstScreenLineStart" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollFirstScreenLineStartAction" text="Scroll Line to Top"/>
<action id="VimMotionScrollFirstScreenLine" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollFirstScreenLineAction" text="Scroll Line to Top"/>
<action id="VimMotionScrollHalfPageDown" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollHalfPageDownAction" text="Scroll Half Page Down"/>
<action id="VimMotionScrollHalfPageUp" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollHalfPageUpAction" text="Scroll Half Page Up"/>
<action id="VimMotionScrollLastScreenLine" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLastScreenLineAction" text="Scroll Line to Bottom"/>
<action id="VimMotionScrollLastScreenLinePageStart" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLastScreenLinePageStartAction" text="Scroll Line to Bottom"/>
<action id="VimMotionScrollLastScreenLineStart" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLastScreenLineStartAction" text="Scroll Line to Bottom"/>
<action id="VimMotionScrollLineDown" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLineDownAction" text="Scroll Line Down"/>
<action id="VimMotionScrollLineUp" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLineUpAction" text="Scroll Line Up"/>
<action id="VimMotionScrollMiddleScreenLine" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollMiddleScreenLineAction" text="Scroll Line to Middle"/>
<action id="VimMotionScrollMiddleScreenLineStart" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollMiddleScreenLineStartAction" text="Scroll Line to Middle"/>
<action id="VimMotionScrollPageDown" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageDownAction" text="Scroll Page Down"/>
<action id="VimMotionScrollPageUp" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageUpAction" text="Scroll Page Up"/>
<!-- Visual -->
<action id="VimVisualExitMode" class="com.maddyhome.idea.vim.action.motion.visual.VisualExitModeAction" text="Exit Visual Mode"/>
<action id="VimVisualToggleCharacterMode" class="com.maddyhome.idea.vim.action.motion.visual.VisualToggleCharacterModeAction" text="Toggle Character Selection"/>
<action id="VimVisualToggleLineMode" class="com.maddyhome.idea.vim.action.motion.visual.VisualToggleLineModeAction" text="Toggle Line Selection"/>
<action id="VimVisualToggleBlockMode" class="com.maddyhome.idea.vim.action.motion.visual.VisualToggleBlockModeAction" text="Toggle Block Selection"/>
<action id="VimVisualSwapEnds" class="com.maddyhome.idea.vim.action.motion.visual.VisualSwapEndsAction" text="Swap Visual Selection Ends"/>
<action id="VimVisualSwapEndsBlock" class="com.maddyhome.idea.vim.action.motion.visual.VisualSwapEndsBlockAction" text="Swap Visual Selection Ends"/>
<action id="VimVisualSelectPrevious" class="com.maddyhome.idea.vim.action.motion.visual.VisualSelectPreviousAction" text="Swap Visual Selection Ends"/>
<action id="VimVisualSwapSelections" class="com.maddyhome.idea.vim.action.motion.visual.VisualSwapSelectionsAction" text="Swap Visual Selection Ends"/>
<!-- Insert -->
<action id="VimInsertAfterCursor" class="com.maddyhome.idea.vim.action.change.insert.InsertAfterCursorAction" text="Insert After Cursor"/>
<action id="VimInsertAfterLineEnd" class="com.maddyhome.idea.vim.action.change.insert.InsertAfterLineEndAction" text="Insert After Line End"/>
<action id="VimInsertAtPreviousInsert" class="com.maddyhome.idea.vim.action.change.insert.InsertAtPreviousInsertAction" text="Insert Before Cursor"/>
<action id="VimInsertBeforeCursor" class="com.maddyhome.idea.vim.action.change.insert.InsertBeforeCursorAction" text="Insert Before Cursor"/>
<action id="VimInsertBeforeFirstNonBlank" class="com.maddyhome.idea.vim.action.change.insert.InsertBeforeFirstNonBlankAction" text="Insert Before First non-Blank"/>
<action id="VimInsertCharacterAboveCursor" class="com.maddyhome.idea.vim.action.change.insert.InsertCharacterAboveCursorAction" text="Insert Character Above Cursor"/>
<action id="VimInsertCharacterBelowCursor" class="com.maddyhome.idea.vim.action.change.insert.InsertCharacterBelowCursorAction" text="Insert Character Below Cursor"/>
<action id="VimInsertDeleteInsertedText" class="com.maddyhome.idea.vim.action.change.insert.InsertDeleteInsertedTextAction" text="Delete Inserted Text"/>
<action id="VimInsertDeletePreviousWord" class="com.maddyhome.idea.vim.action.change.insert.InsertDeletePreviousWordAction" text="Delete Previous Word"/>
<action id="VimInsertEnter" class="com.maddyhome.idea.vim.action.change.insert.InsertEnterAction" text="Enter"/>
<action id="VimInsertExitMode" class="com.maddyhome.idea.vim.action.change.insert.InsertExitModeAction" text="Exit Insert Mode"/>
<action id="VimInsertHelp" class="com.maddyhome.idea.vim.action.change.insert.InsertHelpAction" text="Help"/>
<action id="VimInsertLineStart" class="com.maddyhome.idea.vim.action.change.insert.InsertLineStartAction" text="Insert at Line Start"/>
<action id="VimInsertNewLineAbove" class="com.maddyhome.idea.vim.action.change.insert.InsertNewLineAboveAction" text="Insert New Line Above"/>
<action id="VimInsertNewLineBelow" class="com.maddyhome.idea.vim.action.change.insert.InsertNewLineBelowAction" text="Insert New Line Below"/>
<action id="VimInsertPreviousInsert" class="com.maddyhome.idea.vim.action.change.insert.InsertPreviousInsertAction" text="Insert Previous Text"/>
<action id="VimInsertPreviousInsertExit" class="com.maddyhome.idea.vim.action.change.insert.InsertPreviousInsertExitAction" text="Insert Previous Text"/>
<action id="VimInsertRegister" class="com.maddyhome.idea.vim.action.change.insert.InsertRegisterAction" text="Insert Register"/>
<action id="VimInsertReplaceToggle" class="com.maddyhome.idea.vim.action.change.insert.InsertInsertAction" text="Toggle Insert/Replace"/>
<action id="VimInsertSingleCommand" class="com.maddyhome.idea.vim.action.change.insert.InsertSingleCommandAction" text="Execute Command"/>
<!-- Delete -->
<action id="VimDeleteCharacter" class="com.maddyhome.idea.vim.action.change.delete.DeleteCharacterAction" text="Delete Character"/>
<action id="VimDeleteCharacterLeft" class="com.maddyhome.idea.vim.action.change.delete.DeleteCharacterLeftAction" text="Delete Character Left"/>
<action id="VimDeleteCharacterRight" class="com.maddyhome.idea.vim.action.change.delete.DeleteCharacterRightAction" text="Delete Character Right"/>
<action id="VimDeleteEndOfLine" class="com.maddyhome.idea.vim.action.change.delete.DeleteEndOfLineAction" text="Delete End-of-Line"/>
<action id="VimDeleteJoinLines" class="com.maddyhome.idea.vim.action.change.delete.DeleteJoinLinesAction" text="Delete Join Lines"/>
<action id="VimDeleteJoinLinesSpaces" class="com.maddyhome.idea.vim.action.change.delete.DeleteJoinLinesSpacesAction" text="Delete Join Lines"/>
<action id="VimDeleteJoinVisualLines" class="com.maddyhome.idea.vim.action.change.delete.DeleteJoinVisualLinesAction" text="Delete Join Lines"/>
<action id="VimDeleteJoinVisualLinesSpaces" class="com.maddyhome.idea.vim.action.change.delete.DeleteJoinVisualLinesSpacesAction" text="Delete Join Lines"/>
<action id="VimDeleteLine" class="com.maddyhome.idea.vim.action.change.delete.DeleteLineAction" text="Delete Line"/>
<action id="VimDeleteMotion" class="com.maddyhome.idea.vim.action.change.delete.DeleteMotionAction" text="Delete Motion"/>
<action id="VimDeleteVisual" class="com.maddyhome.idea.vim.action.change.delete.DeleteVisualAction" text="Delete Selection"/>
<action id="VimDeleteVisualLines" class="com.maddyhome.idea.vim.action.change.delete.DeleteVisualLinesAction" text="Delete Selected Lines"/>
<!-- Change -->
<action id="VimChangeCaseLowerMotion" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseLowerMotionAction" text="Change Motion to Lower Case"/>
<action id="VimChangeCaseLowerVisual" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseLowerVisualAction" text="Change Motion to Lower Case"/>
<action id="VimChangeCaseToggleCharacter" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseToggleCharacterAction" text="Change Toggle Case"/>
<action id="VimChangeCaseToggleMotion" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseToggleMotionAction" text="Change Motion Toggle Case"/>
<action id="VimChangeCaseToggleVisual" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseToggleVisualAction" text="Change Motion Toggle Case"/>
<action id="VimChangeCaseUpperMotion" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseUpperMotionAction" text="Change Motion to Upper Case"/>
<action id="VimChangeCaseUpperVisual" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseUpperVisualAction" text="Change Motion to Upper Case"/>
<action id="VimChangeCharacter" class="com.maddyhome.idea.vim.action.change.change.ChangeCharacterAction" text="Change Character"/>
<action id="VimChangeCharacters" class="com.maddyhome.idea.vim.action.change.change.ChangeCharactersAction" text="Change Characters"/>
<action id="VimChangeEndOfLine" class="com.maddyhome.idea.vim.action.change.change.ChangeEndOfLineAction" text="Change to End-of-Line"/>
<action id="VimChangeLine" class="com.maddyhome.idea.vim.action.change.change.ChangeLineAction" text="Change Line"/>
<action id="VimChangeMotion" class="com.maddyhome.idea.vim.action.change.change.ChangeMotionAction" text="Change Motion"/>
<action id="VimChangeReplace" class="com.maddyhome.idea.vim.action.change.change.ChangeReplaceAction" text="Replace"/>
<action id="VimChangeVisual" class="com.maddyhome.idea.vim.action.change.change.ChangeVisualAction" text="Change Motion"/>
<action id="VimChangeVisualCharacter" class="com.maddyhome.idea.vim.action.change.change.ChangeVisualCharacterAction" text="Change Motion"/>
<action id="VimChangeVisualLines" class="com.maddyhome.idea.vim.action.change.change.ChangeVisualLinesAction" text="Change Motion"/>
<action id="VimFilterMotion" class="com.maddyhome.idea.vim.action.change.change.FilterMotionAction" text="Filter Lines"/>
<action id="VimFilterCountLines" class="com.maddyhome.idea.vim.action.change.change.FilterCountLinesAction" text="Filter Lines"/>
<action id="VimFilterVisualLines" class="com.maddyhome.idea.vim.action.change.change.FilterVisualLinesAction" text="Filter Visual Lines"/>
<action id="VimAutoIndentVisual" class="com.maddyhome.idea.vim.action.visual.VisualOperatorDelegateAction" text="Auto Indent Selection"/>
<action id="VimReformatVisual" class="com.maddyhome.idea.vim.action.visual.VisualOperatorDelegateAction" text="Reformat Selection"/>
<action id="VimCommentBlockComment" class="com.maddyhome.idea.vim.action.visual.VisualOperatorDelegateAction" text="Block Comment"/>
<action id="VimCommentLineComment" class="com.maddyhome.idea.vim.action.visual.VisualOperatorDelegateAction" text="Line Comment"/>
<action id="VimSurroundWith" class="com.maddyhome.idea.vim.action.visual.VisualOperatorDelegateAction" text="Surround With"/>
<!-- Shift -->
<action id="VimAutoIndentLines" class="com.maddyhome.idea.vim.action.change.shift.AutoIndentLinesAction" text="Auto Indent Lines"/>
<action id="VimShiftLeftLines" class="com.maddyhome.idea.vim.action.change.shift.ShiftLeftLinesAction" text="Shift Lines Left"/>
<action id="VimShiftLeftMotion" class="com.maddyhome.idea.vim.action.change.shift.ShiftLeftMotionAction" text="Shift Motion Left"/>
<action id="VimShiftLeftVisual" class="com.maddyhome.idea.vim.action.change.shift.ShiftLeftVisualAction" text="Shift Visual Left"/>
<action id="VimShiftRightLines" class="com.maddyhome.idea.vim.action.change.shift.ShiftRightLinesAction" text="Shift Lines Right"/>
<action id="VimShiftRightMotion" class="com.maddyhome.idea.vim.action.change.shift.ShiftRightMotionAction" text="Shift Motion Right"/>
<action id="VimShiftRightVisual" class="com.maddyhome.idea.vim.action.change.shift.ShiftRightVisualAction" text="Shift Visual Right"/>
<!-- Copy -->
<action id="VimCopyPutTextAfterCursor" class="com.maddyhome.idea.vim.action.copy.PutTextAfterCursorAction" text="Put Text"/>
<action id="VimCopyPutTextBeforeCursor" class="com.maddyhome.idea.vim.action.copy.PutTextBeforeCursorAction" text="Put Text"/>
<action id="VimCopyPutTextAfterCursorNoIndent" class="com.maddyhome.idea.vim.action.copy.PutTextAfterCursorNoIndentAction" text="Put Text"/>
<action id="VimCopyPutTextBeforeCursorNoIndent" class="com.maddyhome.idea.vim.action.copy.PutTextBeforeCursorNoIndentAction" text="Put Text"/>
<action id="VimCopyPutTextAfterCursorMoveCursor" class="com.maddyhome.idea.vim.action.copy.PutTextAfterCursorActionMoveCursor" text="Put Text"/>
<action id="VimCopyPutTextBeforeCursorMoveCursor" class="com.maddyhome.idea.vim.action.copy.PutTextBeforeCursorActionMoveCursor" text="Put Text"/>
<action id="VimCopySelectRegister" class="com.maddyhome.idea.vim.action.copy.SelectRegisterAction" text="Select Register"/>
<action id="VimCopyYankLine" class="com.maddyhome.idea.vim.action.copy.YankLineAction" text="Yank Line"/>
<action id="VimCopyYankMotion" class="com.maddyhome.idea.vim.action.copy.YankMotionAction" text="Yank Motion"/>
<action id="VimCopyYankVisual" class="com.maddyhome.idea.vim.action.copy.YankVisualAction" text="Yank Motion"/>
<action id="VimCopyYankVisualLines" class="com.maddyhome.idea.vim.action.copy.YankVisualLinesAction" text="Yank Motion"/>
<action id="VimVisualPutText" class="com.maddyhome.idea.vim.action.copy.PutVisualTextAction" text="Paste over Selection"/>
<!-- File -->
<action id="VimFileSaveClose" class="com.maddyhome.idea.vim.action.file.FileSaveCloseAction" text="Save and Close Editor"/>
<!-- Search -->
<action id="VimSearchEntry" class="com.maddyhome.idea.vim.action.motion.search.SearchEntryAction" text="Search"/>
<action id="VimSearchAgainNext" class="com.maddyhome.idea.vim.action.motion.search.SearchAgainNextAction" text="Search Again"/>
<action id="VimSearchAgainPrevious" class="com.maddyhome.idea.vim.action.motion.search.SearchAgainPreviousAction" text="Search Again"/>
<action id="VimSearchWholeWordForward" class="com.maddyhome.idea.vim.action.motion.search.SearchWholeWordForwardAction" text="Search Again"/>
<action id="VimSearchWholeWordBackward" class="com.maddyhome.idea.vim.action.motion.search.SearchWholeWordBackwardAction" text="Search Again"/>
<action id="VimSearchWordForward" class="com.maddyhome.idea.vim.action.motion.search.SearchWordForwardAction" text="Search Again"/>
<action id="VimSearchWordBackward" class="com.maddyhome.idea.vim.action.motion.search.SearchWordBackwardAction" text="Search Again"/>
<action id="VimGotoDeclaration" class="com.maddyhome.idea.vim.action.motion.search.GotoDeclarationAction" text="Goto Declaration"/>
<!-- Macro -->
<action id="VimToggleRecording" class="com.maddyhome.idea.vim.action.macro.ToggleRecordingAction" text="Record Keystrokes"/>
<action id="VimPlaybackRegister" class="com.maddyhome.idea.vim.action.macro.PlaybackRegisterAction" text="Playback Register"/>
<action id="VimPlaybackLastRegister" class="com.maddyhome.idea.vim.action.macro.PlaybackLastRegisterAction" text="Playback Last Register"/>
<!-- Command Line -->
<action id="VimExBackspace" class="com.maddyhome.idea.vim.action.ex.BackspaceAction" text="Backspace"/>
<action id="VimProcessExEntry" class="com.maddyhome.idea.vim.action.ex.ProcessExEntryAction" text="Process Ex Entry"/>
<action id="VimProcessExKey" class="com.maddyhome.idea.vim.action.ex.ProcessExKeyAction" text="Process Ex Key"/>
<action id="VimCancelExEntry" class="com.maddyhome.idea.vim.action.ex.CancelExEntryAction" text="Cancel Ex Entry"/>
<!-- Other -->
<action id="VimLastSearchReplace" class="com.maddyhome.idea.vim.action.change.change.ChangeLastSearchReplaceAction" text="Repeat Last :s"/>
<action id="VimLastGlobalSearchReplace" class="com.maddyhome.idea.vim.action.change.change.ChangeLastGlobalSearchReplaceAction" text="Repeat Last :s"/>
<action id="VimRepeatChange" class="com.maddyhome.idea.vim.action.change.RepeatChangeAction" text="Repeat Change"/>
<action id="VimRepeatExCommand" class="com.maddyhome.idea.vim.action.change.RepeatExCommandAction" text="Repeat Ex Command"/>
<action id="VimExEntry" class="com.maddyhome.idea.vim.action.ExEntryAction" text="Enter Ex Command"/>
<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"/>
<!-- Keys -->
<action id="VimKeyHandler" class="com.maddyhome.idea.vim.action.key.KeyAction" text="Keys"/>
<action id="VimEditorBackSpace" class="com.maddyhome.idea.vim.action.key.BackSpaceAction" text="BackSpace"/>
<action id="VimEditorDelete" class="com.maddyhome.idea.vim.action.key.DeleteAction" text="Delete"/>
<action id="VimEditorDown" class="com.maddyhome.idea.vim.action.key.DownAction" text="Down"/>
<action id="VimEditorEnter" class="com.maddyhome.idea.vim.action.key.EnterAction" text="Enter"/>
<action id="VimEditorEscape" class="com.maddyhome.idea.vim.action.key.EscapeAction" text="Escape"/>
<action id="VimEditorLeft" class="com.maddyhome.idea.vim.action.key.LeftAction" text="Left"/>
<action id="VimEditorLineEnd" class="com.maddyhome.idea.vim.action.key.LineEndAction" text="LineEnd"/>
<action id="VimEditorLineStart" class="com.maddyhome.idea.vim.action.key.LineStartAction" text="LineStart"/>
<action id="VimEditorPageDown" class="com.maddyhome.idea.vim.action.key.PageDownAction" text="PageDown"/>
<action id="VimEditorPageUp" class="com.maddyhome.idea.vim.action.key.PageUpAction" text="PageUp"/>
<action id="VimEditorRight" class="com.maddyhome.idea.vim.action.key.RightAction" text="Right"/>
<action id="VimEditorTab" class="com.maddyhome.idea.vim.action.key.TabAction" text="Tab"/>
<action id="VimEditorToggleInsertState" class="com.maddyhome.idea.vim.action.key.ToggleInsertStateAction" text="Insert/Overwrite"/>
<action id="VimEditorUp" class="com.maddyhome.idea.vim.action.key.UpAction" text="Up"/>
</actions>
</idea-plugin>

View File

@ -0,0 +1,87 @@
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 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(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;
}
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,44 +0,0 @@
package com.maddyhome.idea.vim.action;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.DataContext;
import com.maddyhome.idea.vim.VimPlugin;
import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.command.CommandState;
/**
*/
public abstract class AbstractCommandAction extends AnAction
{
public final void actionPerformed(AnActionEvent event)
{
CommandState state = CommandState.getInstance();
Command cmd = state.getCommand();
if (!execute(event.getDataContext(), cmd))
{
VimPlugin.indicateError();
}
}
protected abstract boolean execute(DataContext context, Command cmd);
}

View File

@ -2,7 +2,7 @@ package com.maddyhome.idea.vim.action;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2004 Rick Maddy
* 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
@ -35,7 +35,10 @@ public abstract class AbstractDelegateAction extends AnAction implements Delegat
public void setOrigAction(AnAction origAction)
{
logger.debug("origAction=" + origAction);
if (logger.isDebugEnabled())
{
logger.debug("origAction=" + origAction);
}
this.origAction = origAction;
copyFrom(origAction);
}

View File

@ -1,7 +1,7 @@
package com.maddyhome.idea.vim.action;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2004 Rick Maddy
* 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
@ -38,7 +38,10 @@ public abstract class AbstractDelegateEditorAction extends EditorAction implemen
public void setOrigAction(AnAction origAction)
{
logger.debug("origAction=" + origAction);
if (logger.isDebugEnabled())
{
logger.debug("origAction=" + origAction);
}
this.origAction = origAction;
copyFrom(origAction);
}

View File

@ -1,11 +1,24 @@
/*
* Created by IntelliJ IDEA.
* User: rmaddy
* Date: Dec 17, 2004
* Time: 2:52:52 PM
*/
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.AnAction;
public interface DelegateAction

View File

@ -1,8 +1,8 @@
package com.maddyhome.idea.vim.handler.change.insert;
package com.maddyhome.idea.vim.action;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 Rick Maddy
* 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
@ -19,18 +19,12 @@ package com.maddyhome.idea.vim.handler.change.insert;
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.intellij.openapi.actionSystem.AnActionEvent;
/**
*
*/
public class InsertInsertHandler extends EditorActionHandler
public class OriginalDelegateAction extends AbstractDelegateAction
{
public void execute(Editor editor, DataContext context)
public void actionPerformed(AnActionEvent event)
{
CommandGroups.getInstance().getChange().processInsert(editor, context);
getOrigAction().actionPerformed(event);
}
}

View File

@ -2,7 +2,7 @@ package com.maddyhome.idea.vim.action;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 Rick Maddy
* 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

View File

@ -1,29 +1,30 @@
package com.maddyhome.idea.vim.action;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.DataConstants;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.VimPlugin;
import com.maddyhome.idea.vim.undo.UndoManager;
/**
@ -31,6 +32,10 @@ import com.maddyhome.idea.vim.undo.UndoManager;
*/
public class TxActionWrapper extends AbstractDelegateAction
{
public TxActionWrapper()
{
}
public TxActionWrapper(AnAction origAction)
{
super(origAction);
@ -39,21 +44,29 @@ public class TxActionWrapper extends AbstractDelegateAction
public void actionPerformed(AnActionEvent event)
{
logger.debug("actionPerformed");
final Editor editor = (Editor)event.getDataContext().getData(DataConstants.EDITOR);
boolean doTx = editor != null && !UndoManager.getInstance().inCommand(editor);
logger.debug("doTx = " + doTx);
if (doTx)
final Editor editor = event.getData(PlatformDataKeys.EDITOR); // API change - don't merge
if (editor == null || !VimPlugin.isEnabled())
{
UndoManager.getInstance().endCommand(editor);
UndoManager.getInstance().beginCommand(editor);
getOrigAction().actionPerformed(event);
}
getOrigAction().actionPerformed(event);
if (doTx)
else
{
UndoManager.getInstance().endCommand(editor);
UndoManager.getInstance().beginCommand(editor);
boolean doTx = !UndoManager.getInstance().inCommand(editor);
logger.debug("doTx = " + doTx);
if (doTx)
{
UndoManager.getInstance().endCommand(editor);
UndoManager.getInstance().beginCommand(editor);
}
getOrigAction().actionPerformed(event);
if (doTx)
{
UndoManager.getInstance().endCommand(editor);
UndoManager.getInstance().beginCommand(editor);
}
}
}

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.action.key;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.editor.actionSystem.EditorAction;
import com.maddyhome.idea.vim.handler.key.DummyEditorHandler;

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.action.key;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.editor.actionSystem.EditorAction;
import com.maddyhome.idea.vim.handler.key.DummyEditorHandler;

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.action.key;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.editor.actionSystem.EditorAction;
import com.maddyhome.idea.vim.handler.key.DummyEditorHandler;

View File

@ -1,8 +1,8 @@
package com.maddyhome.idea.vim.action.motion.search;
package com.maddyhome.idea.vim.action.key;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 Rick Maddy
* Copyright (C) 2003-2006 Rick Maddy
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -20,15 +20,15 @@ package com.maddyhome.idea.vim.action.motion.search;
*/
import com.intellij.openapi.editor.actionSystem.EditorAction;
import com.maddyhome.idea.vim.handler.motion.search.SearchEntryHandler;
import com.maddyhome.idea.vim.handler.key.DummyEditorHandler;
/**
*
*/
public class SearchEntryAction extends EditorAction
public class DummyAction extends EditorAction
{
public SearchEntryAction()
public DummyAction()
{
super(new SearchEntryHandler());
super(new DummyEditorHandler());
}
}

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.action.key;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.editor.actionSystem.EditorAction;
import com.maddyhome.idea.vim.handler.key.DummyEditorHandler;

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.action.key;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.editor.actionSystem.EditorAction;
import com.maddyhome.idea.vim.handler.key.DummyEditorHandler;

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.action.key;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.editor.actionSystem.EditorAction;
import com.maddyhome.idea.vim.handler.key.DummyEditorHandler;

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.action.key;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.editor.actionSystem.EditorAction;
import com.maddyhome.idea.vim.handler.key.DummyEditorHandler;

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.action.key;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.editor.actionSystem.EditorAction;
import com.maddyhome.idea.vim.handler.key.DummyEditorHandler;

View File

@ -1,8 +1,8 @@
package com.maddyhome.idea.vim.handler.change.insert;
package com.maddyhome.idea.vim.action.key;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 Rick Maddy
* 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
@ -19,18 +19,16 @@ package com.maddyhome.idea.vim.handler.change.insert;
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.maddyhome.idea.vim.VimPlugin;
/**
*
*/
public class InsertHelpHandler extends EditorActionHandler
public class NotImplementedAction extends AnAction
{
public void execute(Editor editor, DataContext context)
public void actionPerformed(AnActionEvent event)
{
CommandGroups.getInstance().getChange().insertHelp(editor, context);
VimPlugin.indicateError();
}
}

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.action.key;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.editor.actionSystem.EditorAction;
import com.maddyhome.idea.vim.handler.key.DummyEditorHandler;

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.action.key;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.editor.actionSystem.EditorAction;
import com.maddyhome.idea.vim.handler.key.DummyEditorHandler;

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.action.key;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.editor.actionSystem.EditorAction;
import com.maddyhome.idea.vim.handler.key.DummyEditorHandler;

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.action.key;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.editor.actionSystem.EditorAction;
import com.maddyhome.idea.vim.handler.key.DummyEditorHandler;

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.action.key;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.editor.actionSystem.EditorAction;
import com.maddyhome.idea.vim.handler.key.DummyEditorHandler;

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.action.key;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.editor.actionSystem.EditorAction;
import com.maddyhome.idea.vim.handler.key.DummyEditorHandler;

View File

@ -2,7 +2,7 @@ package com.maddyhome.idea.vim.command;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2004 Rick Maddy
* Copyright (C) 2003-2006 Rick Maddy
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -34,6 +34,8 @@ public class Argument
public static final int STRING = 3;
/** This is for arguments consisting of a digraph or a regular character */
public static final int DIGRAPH = 4;
/** This is for argumaents consisting of an ex string */
public static final int EX_STRING = 5;
/**
* Creates a character argument
@ -113,7 +115,7 @@ public class Argument
return motionArg;
case CHARACTER:
case DIGRAPH:
return new Character(charArg);
return charArg;
case STRING:
return strArg;
}
@ -121,6 +123,19 @@ public class Argument
throw new IllegalStateException("Unexpected argType of " + type);
}
public String toString()
{
StringBuffer res = new StringBuffer();
res.append("Argument {");
res.append("charArg=").append(charArg);
res.append(",motionArg=").append(motionArg);
res.append(",strArg=").append(strArg);
res.append(",type=").append(type);
res.append("}");
return res.toString();
}
private char charArg = 0;
private Command motionArg = null;
private String strArg = null;

View File

@ -2,7 +2,7 @@ package com.maddyhome.idea.vim.command;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2004 Rick Maddy
* Copyright (C) 2003-2006 Rick Maddy
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -24,6 +24,7 @@ import com.intellij.openapi.editor.actionSystem.EditorAction;
import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
import com.maddyhome.idea.vim.handler.AbstractEditorActionHandler;
import javax.swing.*;
import java.util.List;
/**
@ -40,6 +41,8 @@ public class Command
public static final int FLAG_MOT_EXCLUSIVE = 1 << 5;
/** Indicates that the cursor position should be saved prior to this motion command */
public static final int FLAG_SAVE_JUMP = 1 << 6;
/** Special flag that says this is characterwise only for visual mode */
public static final int FLAG_VISUAL_CHARACTERWISE = 1 << 7;
/** Special command flag that indicates it is not to be repeated */
public static final int FLAG_NO_REPEAT = 1 << 8;
@ -49,12 +52,21 @@ public class Command
public static final int FLAG_SAVE_STROKE = 1 << 10;
/** This is a backspace command */
public static final int FLAG_IS_BACKSPACE = 1 << 11;
public static final int FLAG_SAVE_CHANGES = 1 << 12;
public static final int FLAG_IGNORE_SCROLL_JUMP = 1 << 12;
public static final int FLAG_IGNORE_SIDE_SCROLL_JUMP = 1 << 13;
/** Indicates a command can accept a count in mid command */
public static final int FLAG_ALLOW_MID_COUNT = 1 << 14;
/** Search Flags */
public static final int FLAG_SEARCH_FWD = 1 << 16;
public static final int FLAG_SEARCH_REV = 1 << 17;
public static final int FLAG_KEEP_VISUAL = 1 << 20;
public static final int FLAG_FORCE_VISUAL = 1 << 21;
public static final int FLAG_FORCE_LINEWISE = 1 << 22;
public static final int FLAG_DELEGATE = 1 << 23;
/** Special flag used for any mappings involving operators */
public static final int FLAG_OP_PEND = 1 << 24;
/** This command starts a multi-command undo transaction */
@ -65,6 +77,8 @@ public class Command
public static final int FLAG_NO_ARG_RECORDING = 1 << 27;
/** Indicate that the character argument may come from a digraph */
public static final int FLAG_ALLOW_DIGRAPH = 1 << 28;
public static final int FLAG_COMPLETE_EX = 1 << 29;
public static final int FLAG_TEXT_BLOCK = 1 << 30;
/** Represents commands that actually move the cursor and can be arguments to operators */
public static final int MOTION = 1;
@ -127,9 +141,9 @@ public class Command
* @param type The type of the command
* @param flags Any custom flags specific to this command
*/
public Command(int count, AnAction action, int type, int flags)
public Command(int count, String actionId, AnAction action, int type, int flags)
{
this(count, action, type, flags, null);
this(count, actionId, action, type, flags, null);
}
/**
@ -140,9 +154,10 @@ public class Command
* @param flags Any custom flags specific to this command
* @param arg The argument to this command
*/
public Command(int count, AnAction action, int type, int flags, Argument arg)
public Command(int count, String actionId, AnAction action, int type, int flags, Argument arg)
{
this.count = count;
this.actionId = actionId;
this.action = action;
this.type = type;
this.flags = flags;
@ -214,6 +229,16 @@ public class Command
this.flags = flags;
}
public String getActionId()
{
return actionId;
}
public void setActionId(String actionId)
{
this.actionId = actionId;
}
/**
* Gets the action to execute when the command is run
* @return The command's action
@ -250,34 +275,37 @@ public class Command
this.argument = argument;
}
public List getKeys()
public List<KeyStroke> getKeys()
{
return keys;
}
public void setKeys(List keys)
public void setKeys(List<KeyStroke> keys)
{
this.keys = keys;
}
public String toString()
{
final StringBuffer buf = new StringBuffer();
buf.append("Command");
buf.append("{count=").append(count);
buf.append(",action=").append(action);
buf.append(",type=").append(type);
buf.append(",flags=").append(flags);
buf.append(",argument=").append(argument);
buf.append(",keys=").append(keys);
buf.append('}');
return buf.toString();
StringBuffer res = new StringBuffer();
res.append("Command {");
res.append("count=").append(count);
res.append(",actionId=").append(actionId);
res.append(",action=").append(action);
res.append(",type=").append(type);
res.append(",flags=").append(flags);
res.append(",argument=").append(argument);
res.append(",keys=").append(keys);
res.append("}");
return res.toString();
}
private int count;
private String actionId;
private AnAction action;
private int type;
private int flags;
private Argument argument;
private List keys;
private List<KeyStroke> keys;
}

View File

@ -2,7 +2,7 @@ package com.maddyhome.idea.vim.command;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2004 Rick Maddy
* Copyright (C) 2003-2006 Rick Maddy
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -20,10 +20,13 @@ package com.maddyhome.idea.vim.command;
*/
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.VimPlugin;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.group.RegisterGroup;
import com.maddyhome.idea.vim.helper.EditorData;
import com.maddyhome.idea.vim.key.KeyParser;
import com.maddyhome.idea.vim.key.ParentNode;
import com.maddyhome.idea.vim.option.Options;
import java.util.Stack;
@ -53,20 +56,28 @@ public class CommandState
/**
* Gets the command state singleton
* @return The singleton instance
* @param editor
*/
public synchronized static CommandState getInstance()
public static CommandState getInstance(Editor editor)
{
if (ourInstance == null)
if (editor == null)
{
ourInstance = new CommandState();
return new CommandState();
}
return ourInstance;
CommandState res = EditorData.getCommandState(editor);
if (res == null)
{
res = new CommandState();
EditorData.setCommandState(editor, res);
}
return res;
}
public static boolean inInsertMode()
public static boolean inInsertMode(Editor editor)
{
return (getInstance().getMode() == MODE_INSERT || getInstance().getMode() == MODE_REPLACE);
return (getInstance(editor).getMode() == MODE_INSERT || getInstance(editor).getMode() == MODE_REPLACE);
}
/**
@ -84,7 +95,18 @@ public class CommandState
*/
public void setCommand(Command cmd)
{
command = cmd;
command = cmd;
setFlags(cmd.getFlags());
}
public void setFlags(int flags)
{
this.flags = flags;
}
public int getFlags()
{
return flags;
}
public void pushState(int mode, int submode, int mapping)
@ -92,7 +114,10 @@ public class CommandState
logger.debug("pushState");
modes.push(new State(mode, submode, mapping));
updateStatus();
logger.debug("state=" + this);
if (logger.isDebugEnabled())
{
logger.debug("state=" + this);
}
}
public void popState()
@ -100,7 +125,10 @@ public class CommandState
logger.debug("popState");
modes.pop();
updateStatus();
logger.debug("state=" + this);
if (logger.isDebugEnabled())
{
logger.debug("state=" + this);
}
}
/**
@ -109,7 +137,10 @@ public class CommandState
*/
public int getMode()
{
logger.debug("getMode=" + currentState().getMode());
if (logger.isDebugEnabled())
{
logger.debug("getMode=" + currentState().getMode());
}
//return mode;
return currentState().getMode();
}
@ -147,10 +178,10 @@ public class CommandState
private String getStatusString(int pos)
{
State state = null;
State state;
if (pos >= 0 && pos < modes.size())
{
state = (State)modes.get(pos);
state = modes.get(pos);
}
else if (pos < 0)
{
@ -179,7 +210,7 @@ public class CommandState
case MODE_VISUAL:
if (pos > 0)
{
State tmp = (State)modes.get(pos - 1);
State tmp = modes.get(pos - 1);
if (tmp.getMode() == MODE_COMMAND && tmp.getSubmode() == SUBMODE_SINGLE_COMMAND)
{
msg.append(getStatusString(pos - 1));
@ -250,7 +281,10 @@ public class CommandState
public int getMappingMode()
{
//return mappingMode;
logger.debug("getMappingMode=" + currentState().getMapping());
if (logger.isDebugEnabled())
{
logger.debug("getMappingMode=" + currentState().getMapping());
}
return currentState().getMapping();
}
@ -293,11 +327,21 @@ public class CommandState
updateStatus();
}
public ParentNode getCurrentNode()
{
return currentNode;
}
public void setCurrentNode(ParentNode currentNode)
{
this.currentNode = currentNode;
}
private State currentState()
{
if (modes.size() > 0)
{
return (State)modes.peek();
return modes.peek();
}
else
{
@ -375,14 +419,16 @@ public class CommandState
private int mapping;
}
private Stack modes = new Stack();
private Stack<State> modes = new Stack<State>();
private State defaultState = new State(MODE_COMMAND, 0, KeyParser.MAPPING_NORMAL);
private Command command;
private Command lastChange;
private char lastRegister = RegisterGroup.REGISTER_DEFAULT;
private int flags;
private boolean isRecording = false;
private static CommandState ourInstance;
private ParentNode currentNode = KeyParser.getInstance().getKeyRoot(getMappingMode());
private static Command lastChange = null;
private static char lastRegister = RegisterGroup.REGISTER_DEFAULT;
private static Logger logger = Logger.getInstance(CommandState.class.getName());
}

View File

@ -1,27 +1,24 @@
package com.maddyhome.idea.vim.command;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
/**
* 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.
*/
public class VisualChange
{
public VisualChange(int lines, int columns, int type)

View File

@ -1,27 +1,24 @@
package com.maddyhome.idea.vim.command;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
/**
* 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.
*/
public class VisualRange
{
public VisualRange(int start, int end, int type, int offset)

View File

@ -2,7 +2,7 @@ package com.maddyhome.idea.vim.common;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 Rick Maddy
* 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

View File

@ -0,0 +1,107 @@
package com.maddyhome.idea.vim.common;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2006 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.
*/
public abstract class FileLocation
{
protected FileLocation(int lline, int col, String filename)
{
this.line = lline;
this.col = col;
this.filename = filename;
}
/**
* Clears the mark indicating that it is no longer a valid mark
*/
public void clear()
{
line = -1;
col = -1;
filename = null;
}
/**
* Checks to see if the mark has been invalidated
* @return true is invalid or clear, false if not
*/
public boolean isClear()
{
return (line == -1 && col == -1);
}
/**
* The mark's line
* @return The mark's line
*/
public int getLogicalLine()
{
return line;
}
/**
* Updates the mark's lline
* @param lline The new lline for the mark
*/
public void setLogicalLine(int lline)
{
this.line = lline;
}
/**
* The mark's column
* @return The mark's columnn
*/
public int getCol()
{
return col;
}
/**
* Gets the filename the mark is associate with
* @return The mark's filename
*/
public String getFilename()
{
if (filename != null)
{
return filename;
}
else
{
return null;
}
}
public String toString()
{
final StringBuffer sb = new StringBuffer();
sb.append("FileLocation");
sb.append("{col=").append(col);
sb.append(", line=").append(line);
sb.append(", filename='").append(filename).append('\'');
sb.append('}');
return sb.toString();
}
private int line;
private int col;
private String filename;
}

View File

@ -1,8 +1,8 @@
package com.maddyhome.idea.vim.handler.change.insert;
package com.maddyhome.idea.vim.common;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 Rick Maddy
* Copyright (C) 2003-2006 Rick Maddy
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -19,18 +19,10 @@ package com.maddyhome.idea.vim.handler.change.insert;
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
import com.maddyhome.idea.vim.group.CommandGroups;
/**
*
*/
public class InsertEnterHandler extends EditorActionHandler
public class Jump extends FileLocation
{
public void execute(Editor editor, DataContext context)
public Jump(int lline, int col, String filename)
{
CommandGroups.getInstance().getChange().processEnter(editor, context);
super(lline, col, filename);
}
}

View File

@ -2,7 +2,7 @@ package com.maddyhome.idea.vim.common;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 Rick Maddy
* 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
@ -19,31 +19,13 @@ package com.maddyhome.idea.vim.common;
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import java.util.Comparator;
/**
* This represents a file mark. Each mark has a line and a column, the file it applies to, and the mark key
*/
public class Mark
public class Mark extends FileLocation
{
/**
* Creates a file mark
* @param key The mark's key
* @param lline The logical line within the file
* @param col The column within the line
* @param file The file being marked
*/
public Mark(char key, int lline, int col, VirtualFile file)
{
this.key = key;
this.line = lline;
this.col = col;
this.file = file;
this.filename = null;
}
/**
* Creates a file mark
* @param key The mark's key
@ -53,31 +35,9 @@ public class Mark
*/
public Mark(char key, int lline, int col, String filename)
{
super(lline, col, filename);
this.key = key;
this.line = lline;
this.col = col;
this.file = null;
this.filename = filename;
}
/**
* Clears the mark indicating that it is no longer a valid mark
*/
public void clear()
{
line = -1;
col = -1;
file = null;
filename = null;
}
/**
* Checks to see if the mark has been invalidated
* @return true is invalid or clear, false if not
*/
public boolean isClear()
{
return (line == -1 && col == -1);
}
/**
@ -89,87 +49,32 @@ public class Mark
return key;
}
/**
* The mark's line
* @return The mark's line
*/
public int getLogicalLine()
public boolean equals(Object object)
{
return line;
}
/**
* Updates the mark's lline
* @param lline The new lline for the mark
*/
public void setLogicalLine(int lline)
{
this.line = lline;
}
/**
* The mark's column
* @return The mark's columnn
*/
public int getCol()
{
return col;
}
/**
* The virtual file associated with this mark
* @return The mark's virtual file
*/
public VirtualFile getFile()
{
if (file == null)
if (object instanceof Mark)
{
file = LocalFileSystem.getInstance().findFileByPath(filename);
if (((Mark)object).key == key)
{
return true;
}
}
return file;
}
/**
* Gets the filename the mark is associate with
* @return The mark's filename
*/
public String getFilename()
{
if (filename != null)
{
return filename;
}
else if (file != null)
{
return file.getPath();
}
else
{
return null;
}
return false;
}
public String toString()
{
StringBuffer res = new StringBuffer();
res.append("Mark(key=");
res.append(key);
res.append(", line=");
res.append(line);
res.append(", col=");
res.append(col);
res.append(", file=");
res.append(file);
res.append(", filename=");
res.append(filename);
return res.toString();
final StringBuffer sb = new StringBuffer();
sb.append("Mark{");
sb.append(super.toString());
sb.append(",key=").append(key);
sb.append('}');
return sb.toString();
}
public static class KeySorter implements Comparator
public static class KeySorter<V> implements Comparator<V>
{
public int compare(Object o1, Object o2)
public int compare(V o1, V o2)
{
Mark a = (Mark)o1;
Mark b = (Mark)o2;
@ -189,8 +94,4 @@ public class Mark
}
private char key;
private int line;
private int col;
private VirtualFile file;
private String filename;
}

View File

@ -1,12 +1,8 @@
package com.maddyhome.idea.vim.common;
import com.maddyhome.idea.vim.helper.StringHelper;
import java.util.Comparator;
import java.util.List;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 Rick Maddy
* 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
@ -23,6 +19,12 @@ import java.util.List;
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
import com.maddyhome.idea.vim.helper.StringHelper;
import javax.swing.*;
import java.util.Comparator;
import java.util.List;
/**
* Represents a register.
*/
@ -30,6 +32,7 @@ public class Register
{
/**
* Create a register of the specified type for the given text
* @param name The character
* @param type The register type (linewise or characterwise)
* @param text The text to store
*/
@ -41,7 +44,7 @@ public class Register
this.keys = null;
}
public Register(char name, int type, List keys)
public Register(char name, int type, List<KeyStroke> keys)
{
this.name = name;
this.type = type;
@ -49,6 +52,11 @@ public class Register
this.keys = keys;
}
public void rename(char name)
{
this.name = name;
}
/**
* Gets the name the register is assigned to
* @return The register name
@ -84,7 +92,7 @@ public class Register
* Get the sequence of keys in the register
* @return The register keys
*/
public List getKeys()
public List<KeyStroke> getKeys()
{
if (keys == null && text != null)
{
@ -114,7 +122,7 @@ public class Register
}
}
public void addKeys(List keys)
public void addKeys(List<KeyStroke> keys)
{
if (this.keys != null)
{
@ -140,9 +148,9 @@ public class Register
return keys != null;
}
public static class KeySorter implements Comparator
public static class KeySorter<V> implements Comparator<V>
{
public int compare(Object o1, Object o2)
public int compare(V o1, V o2)
{
Register a = (Register)o1;
Register b = (Register)o2;
@ -164,5 +172,5 @@ public class Register
private char name;
private int type;
private String text;
private List keys;
private List<KeyStroke> keys;
}

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.ex;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.
*/
/**
*
@ -40,17 +40,6 @@ public class CommandName
return optional;
}
public String toString()
{
StringBuffer buf = new StringBuffer();
buf.append("CommandName{");
buf.append("required=").append(required);
buf.append(",optional=").append(optional);
buf.append('}');
return buf.toString();
}
private String required;
private String optional;
}

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.ex;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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 java.util.HashMap;
@ -39,14 +39,14 @@ public class CommandNode
public CommandNode addChild(char ch, CommandHandler command)
{
CommandNode res = new CommandNode(command);
nodes.put(new Character(ch), res);
nodes.put(ch, res);
return res;
}
public CommandNode getChild(char ch)
{
return (CommandNode)nodes.get(new Character(ch));
return nodes.get(ch);
}
public CommandHandler getCommandHandler()
@ -59,17 +59,6 @@ public class CommandNode
this.command = command;
}
public String toString()
{
StringBuffer res = new StringBuffer();
res.append("CommandNode{");
res.append("command=" + command);
res.append(",children=" + nodes);
res.append("}");
return res.toString();
}
private CommandHandler command;
private HashMap nodes = new HashMap();
private HashMap<Character, CommandNode> nodes = new HashMap<Character, CommandNode>();
}

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.ex;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.
*/
/**
* Exception class

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.ex;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.
*/
/**
* Exception class

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.ex;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.
*/
/**
* Exception class

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.ex;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.
*/
/**
* Exception class

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.ex;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.
*/
/**
*

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.ex;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.
*/
/**
* Exception class

View File

@ -1,8 +1,8 @@
package com.maddyhome.idea.vim.handler.change.insert;
package com.maddyhome.idea.vim.ex;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 Rick Maddy
* Copyright (C) 2003-2006 Rick Maddy
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -19,18 +19,25 @@ package com.maddyhome.idea.vim.handler.change.insert;
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
import com.maddyhome.idea.vim.group.CommandGroups;
/**
*
* Exception class
*/
public class InsertExitModeHandler extends EditorActionHandler
public class MissingRangeException extends ExException
{
public void execute(Editor editor, DataContext context)
/**
* Constructs an <code>InvalidArgumentException</code> with no specified detail message.
*/
public MissingRangeException()
{
CommandGroups.getInstance().getChange().processEscape(editor, context);
}
/**
* Constructs an <code>InvalidArgumentException</code> with the specified detail message.
*
* @param s the detail message.
*/
public MissingRangeException(String s)
{
super(s);
}
}

View File

@ -1,23 +1,23 @@
package com.maddyhome.idea.vim.ex;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.
*/
/**
* Exception class

View File

@ -1,25 +1,23 @@
package com.maddyhome.idea.vim.ex;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.
*/
* 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.
*/
/**
*

View File

@ -2,7 +2,7 @@ package com.maddyhome.idea.vim.group;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 Rick Maddy
* 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

View File

@ -2,7 +2,7 @@ package com.maddyhome.idea.vim.group;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 Rick Maddy
* 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

View File

@ -2,7 +2,7 @@ package com.maddyhome.idea.vim.group;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2004 Rick Maddy
* Copyright (C) 2003-2006 Rick Maddy
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -57,6 +57,7 @@ public class CommandGroups
process = new ProcessGroup();
macro = new MacroGroup();
digraph = new DigraphGroup();
history = new HistoryGroup();
}
/**
@ -145,6 +146,11 @@ public class CommandGroups
return digraph;
}
public HistoryGroup getHistory()
{
return history;
}
/**
* Tells each group to save its data.
* @param element The plugin's root element
@ -161,6 +167,7 @@ public class CommandGroups
process.saveData(element);
macro.saveData(element);
digraph.saveData(element);
history.saveData(element);
}
/**
@ -180,6 +187,7 @@ public class CommandGroups
process.readData(element);
macro.readData(element);
digraph.readData(element);
history.readData(element);
}
private static CommandGroups instance;
@ -193,6 +201,7 @@ public class CommandGroups
private ProcessGroup process;
private MacroGroup macro;
private DigraphGroup digraph;
private HistoryGroup history;
private static Logger logger = Logger.getInstance(CommandGroups.class.getName());
}

View File

@ -2,7 +2,7 @@ package com.maddyhome.idea.vim.group;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2004 Rick Maddy
* 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
@ -25,7 +25,6 @@ import com.maddyhome.idea.vim.ui.MorePanel;
import java.util.HashMap;
import java.util.TreeMap;
import java.util.Iterator;
public class DigraphGroup extends AbstractActionGroup
{
@ -37,11 +36,11 @@ public class DigraphGroup extends AbstractActionGroup
public char getDigraph(char ch1, char ch2)
{
String key = new String(new char[]{ch1, ch2});
Character ch = (Character)digraphs.get(key);
Character ch = digraphs.get(key);
if (ch == null)
{
key = new String(new char[]{ch2, ch1});
ch = (Character)digraphs.get(key);
ch = digraphs.get(key);
}
if (ch == null)
@ -50,7 +49,7 @@ public class DigraphGroup extends AbstractActionGroup
}
else
{
return ch.charValue();
return ch;
}
}
@ -77,18 +76,18 @@ public class DigraphGroup extends AbstractActionGroup
int colCount = width / 12;
int height = (int)Math.ceil((double)digraphs.size() / (double)colCount);
logger.debug("width=" + width);
logger.debug("colCount=" + colCount);
logger.debug("height=" + height);
if (logger.isDebugEnabled())
{
logger.debug("width=" + width);
logger.debug("colCount=" + colCount);
logger.debug("height=" + height);
}
StringBuffer res = new StringBuffer();
int cnt = 0;
Iterator iter = keys.keySet().iterator();
while (iter.hasNext())
for (Character code : keys.keySet())
{
Character cd = (Character)iter.next();
char code = cd.charValue();
String key = (String)keys.get(cd);
String key = keys.get(code);
res.append(key);
res.append(' ');
@ -120,7 +119,7 @@ public class DigraphGroup extends AbstractActionGroup
{
res.append('0');
}
res.append(Integer.toHexString((int)code));
res.append(Integer.toHexString(code));
res.append(" ");
cnt++;
@ -132,7 +131,6 @@ public class DigraphGroup extends AbstractActionGroup
}
panel.setText(res.toString());
panel.setVisible(true);
}
private void loadDigraphs()
@ -141,7 +139,7 @@ public class DigraphGroup extends AbstractActionGroup
{
if (defaultDigraphs[i] != '\0' && defaultDigraphs[i + 1] != '\0')
{
Character ch = new Character(defaultDigraphs[i + 2]);
char ch = defaultDigraphs[i + 2];
String key = new String(new char[]{defaultDigraphs[i], defaultDigraphs[i + 1]});
digraphs.put(key, ch);
keys.put(ch, key);
@ -151,8 +149,8 @@ public class DigraphGroup extends AbstractActionGroup
// TODO - load custom digraphs from .vimrc
}
private HashMap digraphs = new HashMap(defaultDigraphs.length);
private TreeMap keys = new TreeMap();
private HashMap<String, Character> digraphs = new HashMap<String, Character>(defaultDigraphs.length);
private TreeMap<Character, String> keys = new TreeMap<Character, String>();
private static final char defaultDigraphs[] = {
/*

View File

@ -0,0 +1,281 @@
package com.maddyhome.idea.vim.group;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003-2006 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.diagnostic.Logger;
import com.maddyhome.idea.vim.helper.StringHelper;
import com.maddyhome.idea.vim.option.NumberOption;
import com.maddyhome.idea.vim.option.Options;
import org.jdom.CDATA;
import org.jdom.Element;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class HistoryGroup extends AbstractActionGroup
{
public static final String SEARCH = "search";
public static final String COMMAND = "cmd";
public static final String EXPRESSION = "expr";
public static final String INPUT = "input";
public void addEntry(String key, String text)
{
if (logger.isDebugEnabled())
{
logger.debug("Add entry '" + text + "' to " + key);
}
HistoryBlock block = blocks(key);
block.addEntry(text);
}
public String getEntry(String key, int index)
{
HistoryBlock block = blocks(key);
return block.getEntry(index);
}
public List<HistoryEntry> getEntries(String key, int first, int last)
{
HistoryBlock block = blocks(key);
List<HistoryEntry> entries = block.getEntries();
List<HistoryEntry> res = new ArrayList<HistoryEntry>();
if (first < 0)
{
if (-first > entries.size())
{
first = Integer.MAX_VALUE;
}
else
{
HistoryEntry entry = entries.get(entries.size() + first);
first = entry.getNumber();
}
}
if (last < 0)
{
if (-last > entries.size())
{
last = Integer.MIN_VALUE;
}
else
{
HistoryEntry entry = entries.get(entries.size() + last);
last = entry.getNumber();
}
}
else if (last == 0)
{
last = Integer.MAX_VALUE;
}
if (logger.isDebugEnabled())
{
logger.debug("first=" + first);
logger.debug("last=" + last);
}
for (HistoryEntry entry : entries)
{
if (entry.getNumber() >= first && entry.getNumber() <= last)
{
res.add(entry);
}
}
return res;
}
private HistoryBlock blocks(String key)
{
HistoryBlock block = histories.get(key);
if (block == null)
{
block = new HistoryBlock();
histories.put(key, block);
}
return block;
}
/**
* Allows the group to save its state and any configuration. This does nothing.
*
* @param element The plugin's root XML element that this group can add a child to
*/
public void saveData(Element element)
{
logger.debug("saveData");
Element hist = new Element("history");
saveData(hist, SEARCH);
saveData(hist, COMMAND);
saveData(hist, EXPRESSION);
saveData(hist, INPUT);
element.addContent(hist);
}
private void saveData(Element element, String key)
{
HistoryBlock block = histories.get(key);
if (block == null)
{
return;
}
Element root = new Element("history-" + key);
List<HistoryEntry> elems = block.getEntries();
for (HistoryEntry entry : elems)
{
Element text = new Element("entry");
CDATA data = new CDATA(StringHelper.entities(entry.getEntry()));
text.addContent(data);
root.addContent(text);
}
element.addContent(root);
}
/**
* Allows the group to restore its state and any configuration. This does nothing.
*
* @param element The plugin's root XML element that this group can add a child to
*/
public void readData(Element element)
{
logger.debug("readData");
Element hist = element.getChild("history");
if (hist == null)
{
return;
}
readData(hist, SEARCH);
readData(hist, COMMAND);
readData(hist, EXPRESSION);
readData(hist, INPUT);
}
private void readData(Element element, String key)
{
HistoryBlock block = histories.get(key);
if (block != null)
{
return;
}
block = new HistoryBlock();
histories.put(key, block);
Element root = element.getChild("history-" + key);
if (root != null)
{
List items = root.getChildren("entry");
for (Object item : items)
{
block.addEntry(StringHelper.unentities(((Element)item).getText()));
}
}
}
private static int maxLength()
{
NumberOption opt = (NumberOption)Options.getInstance().getOption("history");
return opt.value();
}
private static class HistoryBlock
{
public void addEntry(String text)
{
for (int i = 0; i < entries.size(); i++)
{
HistoryEntry entry = entries.get(i);
if (text.equals(entry.getEntry()))
{
entries.remove(i);
break;
}
}
entries.add(new HistoryEntry(++counter, text));
if (entries.size() > maxLength())
{
entries.remove(0);
}
}
public String getEntry(int index)
{
if (index < entries.size())
{
HistoryEntry entry = entries.get(index);
return entry.getEntry();
}
else
{
return null;
}
}
public List<HistoryEntry> getEntries()
{
return entries;
}
private List<HistoryEntry> entries = new ArrayList<HistoryEntry>();
private int counter;
}
public static class HistoryEntry
{
public HistoryEntry(int number, String entry)
{
this.number = number;
this.entry = entry;
}
public int getNumber()
{
return number;
}
public String getEntry()
{
return entry;
}
private int number;
private String entry;
}
private Map<String, HistoryBlock> histories = new HashMap<String, HistoryBlock>();
private static Logger logger = Logger.getInstance(HistoryGroup.class.getName());
}

View File

@ -1,11 +1,24 @@
/*
* Created by IntelliJ IDEA.
* User: rmaddy
* Date: Dec 16, 2004
* Time: 4:15:26 PM
*/
package com.maddyhome.idea.vim.handler;
/*
* 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.AnAction;
public interface DelegateActionHandler

View File

@ -1,38 +0,0 @@
package com.maddyhome.idea.vim.handler;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.group.CommandGroups;
/**
*
*/
public class ExEntryHandler extends AbstractEditorActionHandler
{
protected boolean execute(Editor editor, DataContext context, Command cmd)
{
CommandGroups.getInstance().getProcess().startExCommand(editor, context, cmd);
return true;
}
}

View File

@ -2,7 +2,7 @@ package com.maddyhome.idea.vim.handler;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 Rick Maddy
* 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
@ -32,7 +32,7 @@ public class ResetModeHandler extends EditorActionHandler
{
public void execute(Editor editor, DataContext context)
{
CommandState.getInstance().reset();
KeyHandler.getInstance().fullReset();
CommandState.getInstance(editor).reset();
KeyHandler.getInstance().fullReset(editor);
}
}

View File

@ -1,41 +0,0 @@
package com.maddyhome.idea.vim.handler.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.handler.AbstractEditorActionHandler;
import com.maddyhome.idea.vim.undo.UndoManager;
/**
*
*/
public class RedoHandler extends AbstractEditorActionHandler
{
protected boolean execute(Editor editor, DataContext context, Command cmd)
{
UndoManager.getInstance().endCommand(editor);
boolean res = UndoManager.getInstance().redo(editor, context);
UndoManager.getInstance().beginCommand(editor);
return res;
}
}

View File

@ -1,83 +0,0 @@
package com.maddyhome.idea.vim.handler.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.KeyHandler;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.command.CommandState;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.AbstractEditorActionHandler;
import com.maddyhome.idea.vim.key.KeyParser;
import com.maddyhome.idea.vim.undo.UndoManager;
/**
*/
public class RepeatChangeHandler extends AbstractEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, Command command)
{
CommandState state = CommandState.getInstance();
Command cmd = state.getLastChangeCommand();
if (cmd != null)
{
if (command.getRawCount() > 0)
{
cmd.setCount(command.getCount());
Argument arg = cmd.getArgument();
if (arg != null)
{
Command mot = arg.getMotion();
if (mot != null)
{
mot.setCount(0);
}
}
}
Command save = state.getCommand();
state.setCommand(cmd);
state.pushState(CommandState.MODE_REPEAT, 0, KeyParser.MAPPING_NORMAL);
char reg = CommandGroups.getInstance().getRegister().getCurrentRegister();
CommandGroups.getInstance().getRegister().selectRegister(state.getLastChangeRegister());
try
{
KeyHandler.executeAction(cmd.getAction(), context);
UndoManager.getInstance().endCommand(editor);
UndoManager.getInstance().beginCommand(editor);
}
catch (Exception e)
{
// oops
}
state.popState();
state.setCommand(save);
state.saveLastChangeCommand(cmd);
CommandGroups.getInstance().getRegister().selectRegister(reg);
return true;
}
else
{
return false;
}
}
}

View File

@ -1,45 +0,0 @@
package com.maddyhome.idea.vim.handler.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.ex.CommandParser;
import com.maddyhome.idea.vim.ex.ExException;
import com.maddyhome.idea.vim.handler.AbstractEditorActionHandler;
/**
*/
public class RepeatExCommandHandler extends AbstractEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, Command command)
{
int count = command.getCount();
try
{
return CommandParser.getInstance().processLastCommand(editor, context, count);
}
catch (ExException e)
{
return false;
}
}
}

View File

@ -1,38 +0,0 @@
package com.maddyhome.idea.vim.handler.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
import com.maddyhome.idea.vim.helper.CharacterHelper;
/**
*/
public class ChangeCaseLowerMotionHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
return CommandGroups.getInstance().getChange().changeCaseMotion(editor, context, count, rawCount,
CharacterHelper.CASE_LOWER, argument);
}
}

View File

@ -1,39 +0,0 @@
package com.maddyhome.idea.vim.handler.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.common.TextRange;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
import com.maddyhome.idea.vim.helper.CharacterHelper;
/**
*
*/
public class ChangeCaseLowerVisualHandler extends VisualOperatorActionHandler
{
protected boolean execute(Editor editor, DataContext context, Command cmd, TextRange range)
{
return CommandGroups.getInstance().getChange().changeCaseRange(editor, context, range, CharacterHelper.CASE_LOWER);
}
}

View File

@ -1,36 +0,0 @@
package com.maddyhome.idea.vim.handler.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
/**
*/
public class ChangeCaseToggleCharacterHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
return CommandGroups.getInstance().getChange().changeCaseToggleCharacter(editor, context, count);
}
}

View File

@ -1,38 +0,0 @@
package com.maddyhome.idea.vim.handler.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
import com.maddyhome.idea.vim.helper.CharacterHelper;
/**
*/
public class ChangeCaseToggleMotionHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
return CommandGroups.getInstance().getChange().changeCaseMotion(editor, context, count, rawCount,
CharacterHelper.CASE_TOGGLE, argument);
}
}

View File

@ -1,39 +0,0 @@
package com.maddyhome.idea.vim.handler.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.common.TextRange;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
import com.maddyhome.idea.vim.helper.CharacterHelper;
/**
*
*/
public class ChangeCaseToggleVisualHandler extends VisualOperatorActionHandler
{
protected boolean execute(Editor editor, DataContext context, Command cmd, TextRange range)
{
return CommandGroups.getInstance().getChange().changeCaseRange(editor, context, range, CharacterHelper.CASE_TOGGLE);
}
}

View File

@ -1,38 +0,0 @@
package com.maddyhome.idea.vim.handler.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
import com.maddyhome.idea.vim.helper.CharacterHelper;
/**
*/
public class ChangeCaseUpperMotionHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
return CommandGroups.getInstance().getChange().changeCaseMotion(editor, context, count, rawCount,
CharacterHelper.CASE_UPPER, argument);
}
}

View File

@ -1,39 +0,0 @@
package com.maddyhome.idea.vim.handler.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.common.TextRange;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
import com.maddyhome.idea.vim.helper.CharacterHelper;
/**
*
*/
public class ChangeCaseUpperVisualHandler extends VisualOperatorActionHandler
{
protected boolean execute(Editor editor, DataContext context, Command cmd, TextRange range)
{
return CommandGroups.getInstance().getChange().changeCaseRange(editor, context, range, CharacterHelper.CASE_UPPER);
}
}

View File

@ -1,36 +0,0 @@
package com.maddyhome.idea.vim.handler.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
/**
*/
public class ChangeCharacterHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
return CommandGroups.getInstance().getChange().changeCharacter(editor, context, count, argument.getCharacter());
}
}

View File

@ -1,36 +0,0 @@
package com.maddyhome.idea.vim.handler.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
/**
*/
public class ChangeCharactersHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
return CommandGroups.getInstance().getChange().changeCharacters(editor, context, count);
}
}

View File

@ -1,36 +0,0 @@
package com.maddyhome.idea.vim.handler.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
/**
*/
public class ChangeEndOfLineHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
return CommandGroups.getInstance().getChange().changeEndOfLine(editor, context, count);
}
}

View File

@ -1,39 +0,0 @@
package com.maddyhome.idea.vim.handler.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.ex.LineRange;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
import com.maddyhome.idea.vim.helper.EditorHelper;
/**
*/
public class ChangeLastGlobalSearchReplaceHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
LineRange range = new LineRange(0, EditorHelper.getLineCount(editor) - 1);
return CommandGroups.getInstance().getSearch().searchAndReplace(editor, context, range, "s", "//~/&");
}
}

View File

@ -1,40 +0,0 @@
package com.maddyhome.idea.vim.handler.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.ex.LineRange;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
import com.maddyhome.idea.vim.helper.EditorHelper;
/**
*/
public class ChangeLastSearchReplaceHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
int line = EditorHelper.getCurrentLogicalLine(editor);
LineRange range = new LineRange(line, line);
return CommandGroups.getInstance().getSearch().searchAndReplace(editor, context, range, "s", "//~/");
}
}

View File

@ -1,36 +0,0 @@
package com.maddyhome.idea.vim.handler.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
/**
*/
public class ChangeLineHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
return CommandGroups.getInstance().getChange().changeLine(editor, context, count);
}
}

View File

@ -1,36 +0,0 @@
package com.maddyhome.idea.vim.handler.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
/**
*/
public class ChangeMotionHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
return CommandGroups.getInstance().getChange().changeMotion(editor, context, count, rawCount, argument);
}
}

View File

@ -1,36 +0,0 @@
package com.maddyhome.idea.vim.handler.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
/**
*/
public class ChangeReplaceHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
return CommandGroups.getInstance().getChange().changeReplace(editor, context);
}
}

View File

@ -1,39 +0,0 @@
package com.maddyhome.idea.vim.handler.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.common.TextRange;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
/**
*
*/
public class ChangeVisualCharacterHandler extends VisualOperatorActionHandler
{
protected boolean execute(Editor editor, DataContext context, Command cmd, TextRange range)
{
return CommandGroups.getInstance().getChange().changeCharacterRange(editor, context, range,
cmd.getArgument().getCharacter());
}
}

View File

@ -1,38 +0,0 @@
package com.maddyhome.idea.vim.handler.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.common.TextRange;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
/**
*
*/
public class ChangeVisualHandler extends VisualOperatorActionHandler
{
protected boolean execute(Editor editor, DataContext context, Command cmd, TextRange range)
{
return CommandGroups.getInstance().getChange().changeRange(editor, context, range, Command.FLAG_MOT_INCLUSIVE);
}
}

View File

@ -1,42 +0,0 @@
package com.maddyhome.idea.vim.handler.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.common.TextRange;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
import com.maddyhome.idea.vim.helper.EditorHelper;
/**
*
*/
public class ChangeVisualLinesHandler extends VisualOperatorActionHandler
{
protected boolean execute(Editor editor, DataContext context, Command cmd, TextRange range)
{
range = new TextRange(EditorHelper.getLineStartForOffset(editor, range.getStartOffset()),
EditorHelper.getLineEndForOffset(editor, range.getEndOffset()) + 1);
return CommandGroups.getInstance().getChange().changeRange(editor, context, range, Command.FLAG_MOT_LINEWISE);
}
}

View File

@ -1,38 +0,0 @@
package com.maddyhome.idea.vim.handler.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.AbstractEditorActionHandler;
/**
*/
public class FilterCountLinesHandler extends AbstractEditorActionHandler
{
protected boolean execute(Editor editor, DataContext context, Command cmd)
{
CommandGroups.getInstance().getProcess().startFilterCommand(editor, context, cmd);
return true;
}
}

View File

@ -1,67 +0,0 @@
package com.maddyhome.idea.vim.handler.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.LogicalPosition;
import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.common.TextRange;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.group.MotionGroup;
import com.maddyhome.idea.vim.handler.AbstractEditorActionHandler;
/**
*/
public class FilterMotionHandler extends AbstractEditorActionHandler
{
protected boolean execute(Editor editor, DataContext context, Command cmd)
{
TextRange range = MotionGroup.getMotionRange(editor, context, cmd.getCount(), cmd.getRawCount(),
cmd.getArgument(), false, false);
if (range == null)
{
return false;
}
LogicalPosition current = editor.getCaretModel().getLogicalPosition();
LogicalPosition start = editor.offsetToLogicalPosition(range.getStartOffset());
LogicalPosition end = editor.offsetToLogicalPosition(range.getEndOffset());
int count = 0;
if (current.line != start.line)
{
MotionGroup.moveCaret(editor, context, range.getStartOffset());
}
if (start.line < end.line)
{
count = end.line - start.line + 1;
}
else
{
count = 1;
}
Command command = new Command(count, null, 0, 0);
CommandGroups.getInstance().getProcess().startFilterCommand(editor, context, command);
return true;
}
}

View File

@ -1,40 +0,0 @@
package com.maddyhome.idea.vim.handler.change.change;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.AbstractEditorActionHandler;
/**
*
*/
public class FilterVisualLinesHandler extends AbstractEditorActionHandler
{
protected boolean execute(Editor editor, DataContext context, Command cmd)
{
CommandGroups.getInstance().getProcess().startFilterCommand(editor, context, cmd);
CommandGroups.getInstance().getMotion().resetVisual(editor);
return true;
}
}

View File

@ -1,36 +0,0 @@
package com.maddyhome.idea.vim.handler.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
/**
*/
public class DeleteCharacterHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
return CommandGroups.getInstance().getChange().deleteCharacter(editor, context, 1);
}
}

View File

@ -1,36 +0,0 @@
package com.maddyhome.idea.vim.handler.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
/**
*/
public class DeleteCharacterLeftHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
return CommandGroups.getInstance().getChange().deleteCharacter(editor, context, -count);
}
}

View File

@ -1,36 +0,0 @@
package com.maddyhome.idea.vim.handler.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
/**
*/
public class DeleteCharacterRightHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
return CommandGroups.getInstance().getChange().deleteCharacter(editor, context, count);
}
}

View File

@ -1,36 +0,0 @@
package com.maddyhome.idea.vim.handler.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
/**
*/
public class DeleteEndOfLineHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
return CommandGroups.getInstance().getChange().deleteEndOfLine(editor, context, count);
}
}

View File

@ -1,36 +0,0 @@
package com.maddyhome.idea.vim.handler.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
/**
*/
public class DeleteJoinLinesHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
return CommandGroups.getInstance().getChange().deleteJoinLines(editor, context, count, false);
}
}

View File

@ -1,36 +0,0 @@
package com.maddyhome.idea.vim.handler.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
/**
*/
public class DeleteJoinLinesSpacesHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
return CommandGroups.getInstance().getChange().deleteJoinLines(editor, context, count, true);
}
}

View File

@ -1,38 +0,0 @@
package com.maddyhome.idea.vim.handler.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.common.TextRange;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
/**
*
*/
public class DeleteJoinVisualLinesHandler extends VisualOperatorActionHandler
{
protected boolean execute(Editor editor, DataContext context, Command cmd, TextRange range)
{
return CommandGroups.getInstance().getChange().deleteJoinRange(editor, context, range, false);
}
}

View File

@ -1,38 +0,0 @@
package com.maddyhome.idea.vim.handler.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.common.TextRange;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
/**
*
*/
public class DeleteJoinVisualLinesSpacesHandler extends VisualOperatorActionHandler
{
protected boolean execute(Editor editor, DataContext context, Command cmd, TextRange range)
{
return CommandGroups.getInstance().getChange().deleteJoinRange(editor, context, range, true);
}
}

View File

@ -1,36 +0,0 @@
package com.maddyhome.idea.vim.handler.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
/**
*/
public class DeleteLineHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
return CommandGroups.getInstance().getChange().deleteLine(editor, context, count);
}
}

View File

@ -1,36 +0,0 @@
package com.maddyhome.idea.vim.handler.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
/**
*/
public class DeleteMotionHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
return CommandGroups.getInstance().getChange().deleteMotion(editor, context, count, rawCount, argument, false);
}
}

View File

@ -1,38 +0,0 @@
package com.maddyhome.idea.vim.handler.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.common.TextRange;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
/**
*
*/
public class DeleteVisualHandler extends VisualOperatorActionHandler
{
protected boolean execute(Editor editor, DataContext context, Command cmd, TextRange range)
{
return CommandGroups.getInstance().getChange().deleteRange(editor, context, range, Command.FLAG_MOT_INCLUSIVE, false);
}
}

View File

@ -1,42 +0,0 @@
package com.maddyhome.idea.vim.handler.change.delete;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.common.TextRange;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
import com.maddyhome.idea.vim.helper.EditorHelper;
/**
*
*/
public class DeleteVisualLinesHandler extends VisualOperatorActionHandler
{
protected boolean execute(Editor editor, DataContext context, Command cmd, TextRange range)
{
range = new TextRange(EditorHelper.getLineStartForOffset(editor, range.getStartOffset()),
EditorHelper.getLineEndForOffset(editor, range.getEndOffset()) + 1);
return CommandGroups.getInstance().getChange().deleteRange(editor, context, range, Command.FLAG_MOT_LINEWISE, false);
}
}

View File

@ -1,38 +0,0 @@
package com.maddyhome.idea.vim.handler.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
/**
*/
public class InsertAfterCursorHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
CommandGroups.getInstance().getChange().insertAfterCursor(editor, context);
return true;
}
}

View File

@ -1,38 +0,0 @@
package com.maddyhome.idea.vim.handler.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
/**
*/
public class InsertAfterLineEndHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
CommandGroups.getInstance().getChange().insertAfterLineEnd(editor, context);
return true;
}
}

View File

@ -1,38 +0,0 @@
package com.maddyhome.idea.vim.handler.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
/**
*/
public class InsertAtPreviousInsertHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
CommandGroups.getInstance().getChange().insertAtPreviousInsert(editor, context);
return true;
}
}

View File

@ -1,38 +0,0 @@
package com.maddyhome.idea.vim.handler.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
/**
*/
public class InsertBeforeCursorHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
CommandGroups.getInstance().getChange().insertBeforeCursor(editor, context);
return true;
}
}

View File

@ -1,38 +0,0 @@
package com.maddyhome.idea.vim.handler.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Argument;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
/**
*/
public class InsertBeforeFirstNonBlankHandler extends ChangeEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, int count, int rawCount, Argument argument)
{
CommandGroups.getInstance().getChange().insertBeforeFirstNonBlank(editor, context);
return true;
}
}

View File

@ -1,37 +0,0 @@
package com.maddyhome.idea.vim.handler.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.AbstractEditorActionHandler;
/**
*
*/
public class InsertCharacterAboveCursorHandler extends AbstractEditorActionHandler
{
protected boolean execute(Editor editor, DataContext context, Command cmd)
{
return CommandGroups.getInstance().getChange().insertCharacterAroundCursor(editor, context, -1);
}
}

View File

@ -1,37 +0,0 @@
package com.maddyhome.idea.vim.handler.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.AbstractEditorActionHandler;
/**
*
*/
public class InsertCharacterBelowCursorHandler extends AbstractEditorActionHandler
{
protected boolean execute(Editor editor, DataContext context, Command cmd)
{
return CommandGroups.getInstance().getChange().insertCharacterAroundCursor(editor, context, 1);
}
}

View File

@ -1,37 +0,0 @@
package com.maddyhome.idea.vim.handler.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.AbstractEditorActionHandler;
/*
*
*/
public class InsertDeleteInsertedTextHandler extends AbstractEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, Command cmd)
{
return CommandGroups.getInstance().getChange().insertDeleteInsertedText(editor, context);
}
}

View File

@ -1,37 +0,0 @@
package com.maddyhome.idea.vim.handler.change.insert;
/*
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
* Copyright (C) 2003 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.DataContext;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.handler.AbstractEditorActionHandler;
/*
*
*/
public class InsertDeletePreviousWordHandler extends AbstractEditorActionHandler
{
public boolean execute(Editor editor, DataContext context, Command cmd)
{
return CommandGroups.getInstance().getChange().insertDeletePreviousWord(editor, context);
}
}

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