mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-08-17 16:31:45 +02:00
Compare commits
171 Commits
0.60.2-EAP
...
0.61.3-EAP
Author | SHA1 | Date | |
---|---|---|---|
![]() |
5cd669202b | ||
![]() |
4a09848720 | ||
![]() |
f998f1be9f | ||
![]() |
3352bdfabb | ||
![]() |
ce43a9648f | ||
![]() |
440a0bf393 | ||
![]() |
64a7555f42 | ||
![]() |
3aa6fe3dc0 | ||
![]() |
3522228d45 | ||
![]() |
9b42d9a5c6 | ||
![]() |
4e8d98f956 | ||
![]() |
f6c3d27bbc | ||
![]() |
21daf83fbd | ||
![]() |
7f1203c207 | ||
![]() |
89b1f90973 | ||
![]() |
8002a5497f | ||
![]() |
770d12d79b | ||
![]() |
7e4ac22d23 | ||
![]() |
4f4b26d3e1 | ||
![]() |
4ea7c421a8 | ||
![]() |
3c8b7e2de4 | ||
![]() |
b13acaf823 | ||
![]() |
709cd6ad6e | ||
![]() |
1316ccc56f | ||
![]() |
881ddd0e11 | ||
![]() |
49611ee6b9 | ||
![]() |
539465bb56 | ||
![]() |
bc54a73d69 | ||
![]() |
5eb12f5d14 | ||
![]() |
557e47650f | ||
![]() |
f50753bfd7 | ||
![]() |
7a164d6d5f | ||
![]() |
60bc936cd9 | ||
![]() |
d097e636ea | ||
![]() |
3ce2bbb624 | ||
![]() |
4926d2554e | ||
![]() |
eae135acba | ||
![]() |
8ce3801b87 | ||
![]() |
0c7c11f817 | ||
![]() |
b3a39c05d7 | ||
![]() |
7370012667 | ||
![]() |
412838fd4b | ||
![]() |
273a614389 | ||
![]() |
3944c80ae2 | ||
![]() |
726ab3f91b | ||
![]() |
ab307dd78f | ||
![]() |
e3079912ae | ||
![]() |
52da3ed0e4 | ||
![]() |
cda85169ea | ||
![]() |
978d1df598 | ||
![]() |
f90d22cc20 | ||
![]() |
bae69d92ae | ||
![]() |
b910239825 | ||
![]() |
6421a5969a | ||
![]() |
5c9faba7f4 | ||
![]() |
c1af738cc5 | ||
![]() |
23a80a9260 | ||
![]() |
d9d92f7eee | ||
![]() |
c8be6c203e | ||
![]() |
612c599d9b | ||
![]() |
1292c7d1ae | ||
![]() |
69f07967b5 | ||
![]() |
aedd427c07 | ||
![]() |
9b6c3dc511 | ||
![]() |
b4fa7f4317 | ||
![]() |
f053d305d5 | ||
![]() |
1d95b7ddf7 | ||
![]() |
01a6964d68 | ||
![]() |
d661f96a9b | ||
![]() |
c79fae8ab3 | ||
![]() |
121f130893 | ||
![]() |
da9a0a414a | ||
![]() |
e0732e041b | ||
![]() |
6fc5b3189a | ||
![]() |
2a0c9cb749 | ||
![]() |
7ad131b448 | ||
![]() |
3e7186bd60 | ||
![]() |
132f8cce53 | ||
![]() |
5c07f42afb | ||
![]() |
1f7a2594c8 | ||
![]() |
ec64d19a36 | ||
![]() |
5cb67470d5 | ||
![]() |
c03f01a96a | ||
![]() |
26b67a43ae | ||
![]() |
a93ca3a205 | ||
![]() |
dcc647ba3c | ||
![]() |
fe44f59239 | ||
![]() |
80dba0babf | ||
![]() |
34acf9a91e | ||
![]() |
cb859dbb7b | ||
![]() |
20c04b1e62 | ||
![]() |
69eaf8ed0c | ||
![]() |
62c828d722 | ||
![]() |
251e8e8ff4 | ||
![]() |
acc41ec72e | ||
![]() |
f9ebcf2ee4 | ||
![]() |
f3df231dc2 | ||
![]() |
75a1bb7cc5 | ||
![]() |
7d6a64315a | ||
![]() |
2758071d31 | ||
![]() |
3881b905be | ||
![]() |
073c62f868 | ||
![]() |
d8e0f26bea | ||
![]() |
04c24ab5d0 | ||
![]() |
bfb0ba1ab9 | ||
![]() |
fb7d48af1f | ||
![]() |
559989ce4b | ||
![]() |
81f59e3c18 | ||
![]() |
b6adf9f7a9 | ||
![]() |
b972a01cf0 | ||
![]() |
0296cae712 | ||
![]() |
c38b18e16b | ||
![]() |
8d65c3ed26 | ||
![]() |
995bb966ad | ||
![]() |
dbda1a76ca | ||
![]() |
ed6f990d9a | ||
![]() |
4f86d9cc77 | ||
![]() |
d55774abab | ||
![]() |
d5591ba08d | ||
![]() |
f67d483c4e | ||
![]() |
f26ddd4a27 | ||
![]() |
dbbea642bc | ||
![]() |
0539e39977 | ||
![]() |
65235d32a1 | ||
![]() |
ecfcdf5a8c | ||
![]() |
cf127ba7f9 | ||
![]() |
1fba77d925 | ||
![]() |
5752b116f6 | ||
![]() |
cdf7fd8ce6 | ||
![]() |
8fe07e7b20 | ||
![]() |
b800237606 | ||
![]() |
fed02e5b8a | ||
![]() |
2d4d3e9410 | ||
![]() |
880d4c6888 | ||
![]() |
6a3d606032 | ||
![]() |
612a86c4d9 | ||
![]() |
14abc25c01 | ||
![]() |
52673d1a02 | ||
![]() |
b7caee119e | ||
![]() |
a148446912 | ||
![]() |
1ee9075976 | ||
![]() |
b03627a110 | ||
![]() |
04ac0ab743 | ||
![]() |
e7aa985ad5 | ||
![]() |
4177f4e4f3 | ||
![]() |
c1e415b76a | ||
![]() |
8ae656dee3 | ||
![]() |
d48576f48a | ||
![]() |
c0c5075072 | ||
![]() |
59d106b8c4 | ||
![]() |
d96c313ecb | ||
![]() |
212c708150 | ||
![]() |
3739eb173e | ||
![]() |
0d3ecce8a2 | ||
![]() |
164d7a4200 | ||
![]() |
1258e602e6 | ||
![]() |
8a5ad713ea | ||
![]() |
12be65fa09 | ||
![]() |
0720431c91 | ||
![]() |
6f1ac1de97 | ||
![]() |
99d2d4b594 | ||
![]() |
2bf9b97e49 | ||
![]() |
c6600f3348 | ||
![]() |
e29ab54b0e | ||
![]() |
197565d4cb | ||
![]() |
3d570d2020 | ||
![]() |
fe364dc6dc | ||
![]() |
5d0e82781f | ||
![]() |
24f005a340 | ||
![]() |
1743c08091 | ||
![]() |
81b095c899 |
@@ -1,26 +1,24 @@
|
||||
<?xml version="1.0" ?>
|
||||
<SmellBaseline>
|
||||
<ManuallySuppressedIssues></ManuallySuppressedIssues>
|
||||
<CurrentIssues>
|
||||
<ManuallySuppressedIssues>
|
||||
<ID>ComplexMethod:CmdHandler.kt$CmdHandler$private fun addAlias(cmd: ExCommand, editor: Editor?): Boolean</ID>
|
||||
<ID>ComplexMethod:CommandHandler.kt$CommandHandler$ @Throws(ExException::class) fun process(editor: Editor, context: DataContext, cmd: ExCommand, count: Int): Boolean</ID>
|
||||
<ID>ComplexMethod:CommandState.kt$CommandState$ fun toVimNotation(): String</ID>
|
||||
<ID>ComplexMethod:CommandState.kt$CommandState$private fun getStatusString(pos: Int): String</ID>
|
||||
</ManuallySuppressedIssues>
|
||||
<CurrentIssues>
|
||||
<ID>ComplexMethod:HistoryHandler.kt$HistoryHandler$override fun execute(editor: Editor, context: DataContext, cmd: ExCommand): Boolean</ID>
|
||||
<ID>ComplexMethod:OptionsManager.kt$OptionsManager$ fun parseOptionLine(editor: Editor?, args: String, failOnBad: Boolean): Boolean</ID>
|
||||
<ID>ComplexMethod:OptionsManager.kt$OptionsManager$ private fun showOptions(editor: Editor?, opts: Collection<Option<*>>, showIntro: Boolean)</ID>
|
||||
<ID>ComplexMethod:PutGroup.kt$PutGroup$private fun moveCaretToEndPosition( editor: Editor, caret: Caret, startOffset: Int, endOffset: Int, typeInRegister: SelectionType, modeInEditor: CommandState.SubMode, caretAfterInsertedText: Boolean )</ID>
|
||||
<ID>ComplexMethod:PutGroup.kt$PutGroup$private fun prepareDocumentAndGetStartOffsets(editor: Editor, caret: Caret, typeInRegister: SelectionType, data: PutData, additionalData: Map<String, Any>): List<Int></ID>
|
||||
<ID>ComplexMethod:SearchHelperKt.kt$// bounds are considered inside corresponding quotes fun checkInString(chars: CharSequence, currentPos: Int, str: Boolean): Boolean</ID>
|
||||
<ID>ComplexMethod:SearchHighlightsHelper.kt$ private fun updateSearchHighlights( pattern: String?, shouldIgnoreSmartCase: Boolean, showHighlights: Boolean, initialOffset: Int, searchRange: LineRange?, forwards: Boolean, forceUpdate: Boolean ): Int</ID>
|
||||
<ID>ComplexMethod:TabCloseHandler.kt$TabCloseHandler$ private fun getTabIndexToClose(arg: String, current: Int, last: Int): Int?</ID>
|
||||
<ID>ComplexMethod:VimExchangeExtension.kt$VimExchangeExtension.Operator$private fun compareExchanges(x: Exchange, y: Exchange): ExchangeCompareResult</ID>
|
||||
<ID>ComplexMethod:VimExtensionFacade.kt$VimExtensionFacade$ @JvmStatic fun inputString(editor: Editor, prompt: String, finishOn: Char?): String</ID>
|
||||
<ID>ComplexMethod:VimMultipleCursorsExtension.kt$VimMultipleCursorsExtension.NextOccurrenceHandler$override fun executeInWriteAction(editor: Editor, context: DataContext)</ID>
|
||||
<ID>ComplexMethod:VimShortcutKeyAction.kt$VimShortcutKeyAction$private fun isEnabled(e: AnActionEvent): Boolean</ID>
|
||||
<ID>ComplexMethod:VisualGroup.kt$private fun setVisualSelection(selectionStart: Int, selectionEnd: Int, caret: Caret)</ID>
|
||||
<ID>LongMethod:CmdHandler.kt$CmdHandler$private fun addAlias(cmd: ExCommand, editor: Editor?): Boolean</ID>
|
||||
<ID>LongMethod:HistoryHandler.kt$HistoryHandler$override fun execute(editor: Editor, context: DataContext, cmd: ExCommand): Boolean</ID>
|
||||
<ID>LongMethod:OptionsManager.kt$OptionsManager$ fun parseOptionLine(editor: Editor?, args: String, failOnBad: Boolean): Boolean</ID>
|
||||
<ID>LongMethod:VimMultipleCursorsExtension.kt$VimMultipleCursorsExtension.NextOccurrenceHandler$override fun executeInWriteAction(editor: Editor, context: DataContext)</ID>
|
||||
<ID>LoopWithTooManyJumpStatements:SearchHighlightsHelper.kt$for (project in projectManager.openProjects) { val current = FileEditorManager.getInstance(project).selectedTextEditor ?: continue // [VERSION UPDATE] 202+ Use editors val editors = EditorFactory.getInstance().getEditors(current.document, project) ?: continue for (editor in editors) { // Try to keep existing highlights if possible. Update if hlsearch has changed or if the pattern has changed. // Force update for the situations where the text is the same, but the ignore case values have changed. // E.g. Use `*` to search for a word (which ignores smartcase), then use `/<Up>` to search for the same pattern, // which will match smartcase. Or changing the smartcase/ignorecase settings if (shouldRemoveSearchHighlights(editor, pattern, showHighlights) || forceUpdate) { removeSearchHighlights(editor) } if (pattern == null) continue if (shouldAddAllSearchHighlights(editor, pattern, showHighlights)) { // hlsearch (+ incsearch/noincsearch) val startLine = searchRange?.startLine ?: 0 val endLine = searchRange?.endLine ?: -1 val results = SearchGroup.findAll(editor, pattern, startLine, endLine, shouldIgnoreCase(pattern, shouldIgnoreSmartCase)) if (results.isNotEmpty()) { currentMatchOffset = findClosestMatch(editor, results, initialOffset, forwards) highlightSearchResults(editor, pattern, results, currentMatchOffset) } editor.vimLastSearch = pattern } else if (shouldAddCurrentMatchSearchHighlight(pattern, showHighlights, initialOffset)) { // nohlsearch + incsearch val searchOptions = EnumSet.of(SearchOptions.WHOLE_FILE) if (wrapscan.isSet) searchOptions.add(SearchOptions.WRAP) if (shouldIgnoreSmartCase) searchOptions.add(SearchOptions.IGNORE_SMARTCASE) if (!forwards) searchOptions.add(SearchOptions.BACKWARDS) val result = SearchGroup.findIt(editor, pattern, initialOffset, 1, searchOptions) if (result != null) { currentMatchOffset = result.startOffset val results = listOf(result) highlightSearchResults(editor, pattern, results, currentMatchOffset) } } else if (shouldMaintainCurrentMatchOffset(pattern, initialOffset)) { // incsearch. If nothing has changed (e.g. we've edited offset values in `/foo/e+2`) make sure we return the // current match offset so the caret remains at the current incsarch match val offset = editor.vimIncsearchCurrentMatchOffset if (offset != null) { currentMatchOffset = offset } } } }</ID>
|
||||
<ID>MagicNumber:ActionListHandler.kt$ActionListHandler$50</ID>
|
||||
<ID>MagicNumber:AddBlockInlaysAction.kt$AddBlockInlaysAction$0.9f</ID>
|
||||
<ID>MagicNumber:AddBlockInlaysAction.kt$AddBlockInlaysAction$1.75f</ID>
|
||||
@@ -55,6 +53,7 @@
|
||||
<ID>MagicNumber:OptionsManager.kt$OptionsManager$19</ID>
|
||||
<ID>MagicNumber:OptionsManager.kt$OptionsManager$20</ID>
|
||||
<ID>MagicNumber:OptionsManager.kt$OptionsManager$3</ID>
|
||||
<ID>MagicNumber:OptionsManager.kt$OptionsManager$50</ID>
|
||||
<ID>MagicNumber:OptionsManager.kt$OptionsManager$80</ID>
|
||||
<ID>MagicNumber:ProcessExEntryAction.kt$ProcessExEntryAction$0x0a</ID>
|
||||
<ID>MagicNumber:RegistersHandler.kt$RegistersHandler$200</ID>
|
||||
@@ -66,6 +65,7 @@
|
||||
<ID>MagicNumber:VimHighlightedYank.kt$VimHighlightedYank.HighlightHandler$3</ID>
|
||||
<ID>MagicNumber:VimHighlightedYank.kt$VimHighlightedYank.HighlightHandler$4</ID>
|
||||
<ID>MatchingDeclarationName:CommandDefinition.kt$CommandName</ID>
|
||||
<ID>MatchingDeclarationName:SearchHelperKt.kt$Direction</ID>
|
||||
<ID>MaxLineLength:ExBeanClass.kt$ExBeanClass$logger<ExBeanClass>().error("IdeaVim doesn't accept contributions to `vimActions` extension points. Please create a plugin using `VimExtension`. Plugin to blame: $pluginId")</ID>
|
||||
<ID>MaxLineLength:ExRanges.kt$SearchRange$override</ID>
|
||||
<ID>MaxLineLength:NotificationService.kt$NotificationService$notification.addAction(AppendToIdeaVimRcAction(notification, "set clipboard+=ideaput", "ideaput") { OptionsManager.clipboard.append(ClipboardOptionsData.ideaput) })</ID>
|
||||
@@ -84,67 +84,18 @@
|
||||
<ID>MaxLineLength:VimShortcutKeyAction.kt$VimShortcutKeyAction.Companion$ImmutableSet.builder<KeyStroke>().addAll(getKeyStrokes(KeyEvent.VK_ENTER, 0)).addAll(getKeyStrokes(KeyEvent.VK_ESCAPE, 0)) .addAll(getKeyStrokes(KeyEvent.VK_TAB, 0)).addAll(getKeyStrokes(KeyEvent.VK_BACK_SPACE, 0, InputEvent.CTRL_DOWN_MASK)) .addAll(getKeyStrokes(KeyEvent.VK_INSERT, 0)).addAll(getKeyStrokes(KeyEvent.VK_DELETE, 0, InputEvent.CTRL_DOWN_MASK)) .addAll(getKeyStrokes(KeyEvent.VK_UP, 0, InputEvent.CTRL_DOWN_MASK, InputEvent.SHIFT_DOWN_MASK)).addAll(getKeyStrokes(KeyEvent.VK_DOWN, 0, InputEvent.CTRL_DOWN_MASK, InputEvent.SHIFT_DOWN_MASK)) .addAll(getKeyStrokes(KeyEvent.VK_LEFT, 0, InputEvent.CTRL_DOWN_MASK, InputEvent.SHIFT_DOWN_MASK, InputEvent.CTRL_DOWN_MASK or InputEvent.SHIFT_DOWN_MASK)) .addAll(getKeyStrokes(KeyEvent.VK_RIGHT, 0, InputEvent.CTRL_DOWN_MASK, InputEvent.SHIFT_DOWN_MASK, InputEvent.CTRL_DOWN_MASK or InputEvent.SHIFT_DOWN_MASK)) .addAll(getKeyStrokes(KeyEvent.VK_HOME, 0, InputEvent.CTRL_DOWN_MASK, InputEvent.SHIFT_DOWN_MASK, InputEvent.CTRL_DOWN_MASK or InputEvent.SHIFT_DOWN_MASK))</ID>
|
||||
<ID>MemberNameEqualsClassName:Ranges.kt$Ranges$private val ranges: MutableList<Range> = mutableListOf()</ID>
|
||||
<ID>NestedBlockDepth:OptionsManager.kt$OptionsManager$ fun parseOptionLine(editor: Editor?, args: String, failOnBad: Boolean): Boolean</ID>
|
||||
<ID>ReturnCount:ActionBeanClass.kt$ActionBeanClass$fun getParsedModes(): Set<MappingMode>?</ID>
|
||||
<ID>ReturnCount:Alias.kt$Alias$fun getCommand(input: String, count: Int): String</ID>
|
||||
<ID>ReturnCount:CmdFilterHandler.kt$CmdFilterHandler$override fun execute(editor: Editor, context: DataContext, cmd: ExCommand): Boolean</ID>
|
||||
<ID>ReturnCount:CmdHandler.kt$CmdHandler$private fun addAlias(cmd: ExCommand, editor: Editor?): Boolean</ID>
|
||||
<ID>ReturnCount:CommandGroup.kt$CommandGroup$fun isAlias(command: String): Boolean</ID>
|
||||
<ID>ReturnCount:DeleteJoinLinesAction.kt$DeleteJoinLinesAction$override fun execute(editor: Editor, context: DataContext, count: Int, rawCount: Int, argument: Argument?): Boolean</ID>
|
||||
<ID>ReturnCount:DeleteJoinLinesSpacesAction.kt$DeleteJoinLinesSpacesAction$override fun execute(editor: Editor, context: DataContext, count: Int, rawCount: Int, argument: Argument?): Boolean</ID>
|
||||
<ID>ReturnCount:DeleteJoinVisualLinesAction.kt$DeleteJoinVisualLinesAction$override fun executeForAllCarets(editor: Editor, context: DataContext, cmd: Command, caretsAndSelections: Map<Caret, VimSelection>): Boolean</ID>
|
||||
<ID>ReturnCount:DeleteJoinVisualLinesSpacesAction.kt$DeleteJoinVisualLinesSpacesAction$override fun executeForAllCarets(editor: Editor, context: DataContext, cmd: Command, caretsAndSelections: Map<Caret, VimSelection>): Boolean</ID>
|
||||
<ID>ReturnCount:DeleteMotionAction.kt$DeleteMotionAction$override fun execute(editor: Editor, caret: Caret, context: DataContext, count: Int, rawCount: Int, argument: Argument?): Boolean</ID>
|
||||
<ID>ReturnCount:EditFileHandler.kt$EditFileHandler$override fun execute(editor: Editor, context: DataContext, cmd: ExCommand): Boolean</ID>
|
||||
<ID>ReturnCount:EditorHelper.kt$ fun Editor.isPrimaryEditor(): Boolean</ID>
|
||||
<ID>ReturnCount:ExRanges.kt$Range.Companion$ @JvmStatic fun createRange(str: String, offset: Int, move: Boolean): Array<Range>?</ID>
|
||||
<ID>ReturnCount:FilterMotionAction.kt$FilterMotionAction$override fun execute(editor: Editor, context: DataContext, cmd: Command): Boolean</ID>
|
||||
<ID>ReturnCount:GotoCharacterHandler.kt$GotoCharacterHandler$override fun execute(editor: Editor, caret: Caret, context: DataContext, cmd: ExCommand): Boolean</ID>
|
||||
<ID>ReturnCount:Helper.kt$@Suppress("IncorrectParentDisposable") fun Editor.isTemplateActive(): Boolean</ID>
|
||||
<ID>ReturnCount:HistoryHandler.kt$HistoryHandler$override fun execute(editor: Editor, context: DataContext, cmd: ExCommand): Boolean</ID>
|
||||
<ID>ReturnCount:IdeaSelectionControl.kt$IdeaSelectionControl$ fun predictMode(editor: Editor, selectionSource: VimListenerManager.SelectionSource): CommandState.Mode</ID>
|
||||
<ID>ReturnCount:MapHandler.kt$MapHandler$@Throws(ExException::class) private fun executeCommand(cmd: ExCommand, editor: Editor?): Boolean</ID>
|
||||
<ID>ReturnCount:Marks.kt$IntellijMark$private fun getProject(): Project?</ID>
|
||||
<ID>ReturnCount:Marks.kt$VimMark.Companion$@JvmStatic fun create(key: Char?, logicalLine: Int?, col: Int?, filename: String?, protocol: String?): VimMark?</ID>
|
||||
<ID>ReturnCount:ModalEntry.kt$ModalEntry.<no name provided>$override fun dispatchKeyEvent(e: KeyEvent): Boolean</ID>
|
||||
<ID>ReturnCount:MotionScrollLastScreenLinePageStartAction.kt$MotionScrollLastScreenLinePageStartAction$override fun execute(editor: Editor, context: DataContext, cmd: Command): Boolean</ID>
|
||||
<ID>ReturnCount:OperatorAction.kt$OperatorAction$override fun execute(editor: Editor, context: DataContext, cmd: Command): Boolean</ID>
|
||||
<ID>ReturnCount:OptionsManager.kt$OptionsManager$ fun parseOptionLine(editor: Editor?, args: String, failOnBad: Boolean): Boolean</ID>
|
||||
<ID>ReturnCount:PutGroup.kt$PutGroup$private fun getProviderForPasteViaIde(context: DataContext, typeInRegister: SelectionType, data: PutData): PasteProvider?</ID>
|
||||
<ID>ReturnCount:PutGroup.kt$PutGroup$private fun prepareDocumentAndGetStartOffsets(editor: Editor, caret: Caret, typeInRegister: SelectionType, data: PutData, additionalData: Map<String, Any>): List<Int></ID>
|
||||
<ID>ReturnCount:PutLinesHandler.kt$PutLinesHandler$override fun execute(editor: Editor, context: DataContext, cmd: ExCommand): Boolean</ID>
|
||||
<ID>ReturnCount:ReloadVimRc.kt$VimRcFileState$fun equalTo(document: Document): Boolean</ID>
|
||||
<ID>ReturnCount:RepeatHandler.kt$RepeatHandler$@Throws(ExException::class) override fun execute(editor: Editor, caret: Caret, context: DataContext, cmd: ExCommand): Boolean</ID>
|
||||
<ID>ReturnCount:SelectMotionRightAction.kt$SelectMotionRightAction$override fun getOffset(editor: Editor, caret: Caret, context: DataContext, count: Int, rawCount: Int, argument: Argument?): Int</ID>
|
||||
<ID>ReturnCount:ShowCmd.kt$ShowCmd$fun getFullText(editor: Editor?): String</ID>
|
||||
<ID>ReturnCount:TabCloseHandler.kt$TabCloseHandler$ private fun getTabIndexToClose(arg: String, current: Int, last: Int): Int?</ID>
|
||||
<ID>ReturnCount:TextObjectActionHandler.kt$TextObjectActionHandler$ final override fun baseExecute(editor: Editor, caret: Caret, context: DataContext, cmd: Command): Boolean</ID>
|
||||
<ID>ReturnCount:UndoRedoHelper.kt$UndoRedoHelper$fun redo(context: DataContext): Boolean</ID>
|
||||
<ID>ReturnCount:UndoRedoHelper.kt$UndoRedoHelper$fun undo(context: DataContext): Boolean</ID>
|
||||
<ID>ReturnCount:VimExchangeExtension.kt$VimExchangeExtension.Operator$override fun apply(editor: Editor, context: DataContext, selectionType: SelectionType): Boolean</ID>
|
||||
<ID>ReturnCount:VimExtensionFacade.kt$VimExtensionFacade$ @JvmStatic fun inputString(editor: Editor, prompt: String, finishOn: Char?): String</ID>
|
||||
<ID>ReturnCount:VimMultipleCursorsExtension.kt$VimMultipleCursorsExtension.AllOccurrencesHandler$override fun executeInWriteAction(editor: Editor, context: DataContext)</ID>
|
||||
<ID>ReturnCount:VimMultipleCursorsExtension.kt$VimMultipleCursorsExtension.NextOccurrenceHandler$override fun executeInWriteAction(editor: Editor, context: DataContext)</ID>
|
||||
<ID>ReturnCount:VimMultipleCursorsExtension.kt$VimMultipleCursorsExtension.SkipOccurrenceHandler$override fun executeInWriteAction(editor: Editor, context: DataContext)</ID>
|
||||
<ID>ReturnCount:VimScriptParser.kt$VimScriptParser$@Throws(ExException::class) fun evaluate(expression: String, globals: Map<String?, Any?>): Any</ID>
|
||||
<ID>ReturnCount:VimScriptParser.kt$VimScriptParser$fun findOrCreateIdeaVimRc(): File?</ID>
|
||||
<ID>ReturnCount:VimShortcutKeyAction.kt$VimShortcutKeyAction$private fun getKeyStroke(e: AnActionEvent): KeyStroke?</ID>
|
||||
<ID>ReturnCount:VimShortcutKeyAction.kt$VimShortcutKeyAction$private fun isEnabled(e: AnActionEvent): Boolean</ID>
|
||||
<ID>ReturnCount:VimSurroundExtension.kt$VimSurroundExtension.CSurroundHandler$override fun execute(editor: Editor, context: DataContext)</ID>
|
||||
<ID>ReturnCount:VimSurroundExtension.kt$VimSurroundExtension.Operator$override fun apply(editor: Editor, context: DataContext, selectionType: SelectionType): Boolean</ID>
|
||||
<ID>ReturnCount:VisualBlockAppendAction.kt$VisualBlockAppendAction$override fun executeForAllCarets(editor: Editor, context: DataContext, cmd: Command, caretsAndSelections: Map<Caret, VimSelection>): Boolean</ID>
|
||||
<ID>ReturnCount:VisualBlockInsertAction.kt$VisualBlockInsertAction$override fun executeForAllCarets(editor: Editor, context: DataContext, cmd: Command, caretsAndSelections: Map<Caret, VimSelection>): Boolean</ID>
|
||||
<ID>ReturnCount:VisualMotionGroup.kt$VisualMotionGroup$ fun toggleVisual(editor: Editor, count: Int, rawCount: Int, subMode: CommandState.SubMode): Boolean</ID>
|
||||
<ID>ReturnCount:VisualMotionGroup.kt$VisualMotionGroup$fun autodetectVisualSubmode(editor: Editor): CommandState.SubMode</ID>
|
||||
<ID>ReturnCount:VisualMotionGroup.kt$VisualMotionGroup$fun selectPreviousVisualMode(editor: Editor): Boolean</ID>
|
||||
<ID>ReturnCount:VisualMotionGroup.kt$VisualMotionGroup$fun swapVisualSelections(editor: Editor): Boolean</ID>
|
||||
<ID>ReturnCount:VisualMotionGroup.kt$VisualMotionGroup$private fun seemsLikeBlockMode(editor: Editor): Boolean</ID>
|
||||
<ID>ReturnCount:VisualOperatorActionHandler.kt$VisualOperatorActionHandler$final override fun baseExecute(editor: Editor, caret: Caret, context: DataContext, cmd: Command): Boolean</ID>
|
||||
<ID>ReturnCount:YankGroup.kt$YankGroup$ fun yankMotion(editor: Editor, context: DataContext, count: Int, rawCount: Int, argument: Argument): Boolean</ID>
|
||||
<ID>ThrowsCount:CommandHandler.kt$CommandHandler$ @Throws(ExException::class) fun process(editor: Editor, context: DataContext, cmd: ExCommand, count: Int): Boolean</ID>
|
||||
<ID>ThrowsCount:CommandHandler.kt$CommandHandler$private fun checkArgs(cmd: ExCommand)</ID>
|
||||
<ID>TooManyFunctions:CommandBuilder.kt$CommandBuilder</ID>
|
||||
<ID>TooManyFunctions:CommandState.kt$CommandState</ID>
|
||||
<ID>TooManyFunctions:PutGroup.kt$PutGroup</ID>
|
||||
<ID>TooManyFunctions:Ranges.kt$Ranges</ID>
|
||||
<ID>TooManyFunctions:SearchHighlightsHelper.kt$com.maddyhome.idea.vim.helper.SearchHighlightsHelper.kt</ID>
|
||||
<ID>TooManyFunctions:VisualGroup.kt$com.maddyhome.idea.vim.group.visual.VisualGroup.kt</ID>
|
||||
<ID>TooManyFunctions:VisualMotionGroup.kt$VisualMotionGroup</ID>
|
||||
</CurrentIssues>
|
@@ -11,6 +11,8 @@ complexity:
|
||||
threshold: 6
|
||||
ComplexCondition:
|
||||
threshold: 6
|
||||
ComplexMethod:
|
||||
threshold: 20
|
||||
exceptions:
|
||||
TooGenericExceptionCaught:
|
||||
active: false
|
||||
@@ -25,3 +27,5 @@ style:
|
||||
active: false
|
||||
MaxLineLength:
|
||||
maxLineLength: 160
|
||||
ReturnCount:
|
||||
max: 5
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -5,6 +5,9 @@
|
||||
!/.idea/scopes
|
||||
!/.idea/copyright
|
||||
!/.idea/icon.png
|
||||
!/.idea/inspectionProfiles
|
||||
!/.idea/fileTemplates
|
||||
!/.idea/runConfigurations
|
||||
|
||||
/build/
|
||||
/out/
|
||||
|
1
.idea/fileTemplates/code/I18nized Concatenation.java
generated
Normal file
1
.idea/fileTemplates/code/I18nized Concatenation.java
generated
Normal file
@@ -0,0 +1 @@
|
||||
com.maddyhome.idea.vim.helper.MessageHelper.message("${PROPERTY_KEY}", ${PARAMETERS})
|
1
.idea/fileTemplates/code/I18nized Expression.java
generated
Normal file
1
.idea/fileTemplates/code/I18nized Expression.java
generated
Normal file
@@ -0,0 +1 @@
|
||||
com.maddyhome.idea.vim.helper.MessageHelper.message("${PROPERTY_KEY}")
|
34
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
34
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@@ -0,0 +1,34 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="HardCodedStringLiteral" enabled="false" level="WARNING" enabled_by_default="false">
|
||||
<scope name="Production" level="WARNING" enabled="false">
|
||||
<option name="ignoreForAssertStatements" value="true" />
|
||||
<option name="ignoreForExceptionConstructors" value="true" />
|
||||
<option name="ignoreForSpecifiedExceptionConstructors" value="" />
|
||||
<option name="ignoreForJUnitAsserts" value="true" />
|
||||
<option name="ignoreForClassReferences" value="true" />
|
||||
<option name="ignoreForPropertyKeyReferences" value="true" />
|
||||
<option name="ignoreForNonAlpha" value="true" />
|
||||
<option name="ignoreAssignedToConstants" value="false" />
|
||||
<option name="ignoreToString" value="true" />
|
||||
<option name="nonNlsCommentPattern" value="NON-NLS" />
|
||||
</scope>
|
||||
<option name="ignoreForAssertStatements" value="true" />
|
||||
<option name="ignoreForExceptionConstructors" value="true" />
|
||||
<option name="ignoreForSpecifiedExceptionConstructors" value="" />
|
||||
<option name="ignoreForJUnitAsserts" value="true" />
|
||||
<option name="ignoreForClassReferences" value="true" />
|
||||
<option name="ignoreForPropertyKeyReferences" value="true" />
|
||||
<option name="ignoreForNonAlpha" value="true" />
|
||||
<option name="ignoreAssignedToConstants" value="false" />
|
||||
<option name="ignoreToString" value="false" />
|
||||
<option name="nonNlsCommentPattern" value="NON-NLS" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="MissortedModifiers" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="m_requireAnnotationsFirst" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PluginXmlI18n" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="UnstableApiUsage" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
</profile>
|
||||
</component>
|
47
.idea/inspectionProfiles/Qodana.xml
generated
Normal file
47
.idea/inspectionProfiles/Qodana.xml
generated
Normal file
@@ -0,0 +1,47 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<description>Inspections profile for Qodana</description>
|
||||
<option name="myName" value="Qodana" />
|
||||
<inspection_tool class="CanBeFinal" enabled="false" level="WARNING" enabled_by_default="false">
|
||||
<option name="REPORT_CLASSES" value="false" />
|
||||
<option name="REPORT_METHODS" value="false" />
|
||||
<option name="REPORT_FIELDS" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="GrUnresolvedAccess" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="HardCodedStringLiteral" enabled="false" level="WARNING" enabled_by_default="false">
|
||||
<scope name="Production" level="WARNING" enabled="false">
|
||||
<option name="ignoreForAssertStatements" value="true" />
|
||||
<option name="ignoreForExceptionConstructors" value="true" />
|
||||
<option name="ignoreForSpecifiedExceptionConstructors" value="" />
|
||||
<option name="ignoreForJUnitAsserts" value="true" />
|
||||
<option name="ignoreForClassReferences" value="true" />
|
||||
<option name="ignoreForPropertyKeyReferences" value="true" />
|
||||
<option name="ignoreForNonAlpha" value="true" />
|
||||
<option name="ignoreAssignedToConstants" value="false" />
|
||||
<option name="ignoreToString" value="true" />
|
||||
<option name="nonNlsCommentPattern" value="NON-NLS" />
|
||||
</scope>
|
||||
<option name="ignoreForAssertStatements" value="true" />
|
||||
<option name="ignoreForExceptionConstructors" value="true" />
|
||||
<option name="ignoreForSpecifiedExceptionConstructors" value="" />
|
||||
<option name="ignoreForJUnitAsserts" value="true" />
|
||||
<option name="ignoreForClassReferences" value="true" />
|
||||
<option name="ignoreForPropertyKeyReferences" value="true" />
|
||||
<option name="ignoreForNonAlpha" value="true" />
|
||||
<option name="ignoreAssignedToConstants" value="false" />
|
||||
<option name="ignoreToString" value="false" />
|
||||
<option name="nonNlsCommentPattern" value="NON-NLS" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="MissortedModifiers" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="m_requireAnnotationsFirst" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="SameReturnValue" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
||||
<option name="processCode" value="true" />
|
||||
<option name="processLiterals" value="true" />
|
||||
<option name="processComments" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="SuperTearDownInFinally" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="UnstableApiUsage" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
</profile>
|
||||
</component>
|
24
.idea/runConfigurations/IdeaVim_full_verification.xml
generated
Normal file
24
.idea/runConfigurations/IdeaVim_full_verification.xml
generated
Normal file
@@ -0,0 +1,24 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="IdeaVim full verification" type="GradleRunConfiguration" factoryName="Gradle">
|
||||
<ExternalSystemSettings>
|
||||
<option name="executionName" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="externalSystemIdString" value="GRADLE" />
|
||||
<option name="scriptParameters" value="" />
|
||||
<option name="taskDescriptions">
|
||||
<list />
|
||||
</option>
|
||||
<option name="taskNames">
|
||||
<list>
|
||||
<option value="check" />
|
||||
<option value="runPluginVerifier" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="vmOptions" value="" />
|
||||
</ExternalSystemSettings>
|
||||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||
<DebugAllEnabled>false</DebugAllEnabled>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
23
.idea/runConfigurations/IdeaVim_tests.xml
generated
Normal file
23
.idea/runConfigurations/IdeaVim_tests.xml
generated
Normal file
@@ -0,0 +1,23 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="IdeaVim tests" type="GradleRunConfiguration" factoryName="Gradle">
|
||||
<ExternalSystemSettings>
|
||||
<option name="executionName" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="externalSystemIdString" value="GRADLE" />
|
||||
<option name="scriptParameters" value="" />
|
||||
<option name="taskDescriptions">
|
||||
<list />
|
||||
</option>
|
||||
<option name="taskNames">
|
||||
<list>
|
||||
<option value="test" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="vmOptions" value="" />
|
||||
</ExternalSystemSettings>
|
||||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||
<DebugAllEnabled>false</DebugAllEnabled>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
23
.idea/runConfigurations/Start_IJ_with_IdeaVim.xml
generated
Normal file
23
.idea/runConfigurations/Start_IJ_with_IdeaVim.xml
generated
Normal file
@@ -0,0 +1,23 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Start IJ with IdeaVim" type="GradleRunConfiguration" factoryName="Gradle">
|
||||
<ExternalSystemSettings>
|
||||
<option name="executionName" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="externalSystemIdString" value="GRADLE" />
|
||||
<option name="scriptParameters" value="" />
|
||||
<option name="taskDescriptions">
|
||||
<list />
|
||||
</option>
|
||||
<option name="taskNames">
|
||||
<list>
|
||||
<option value="runIde" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="vmOptions" value="" />
|
||||
</ExternalSystemSettings>
|
||||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||
<DebugAllEnabled>false</DebugAllEnabled>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
36
.teamcity/_Self/Project.kt
vendored
36
.teamcity/_Self/Project.kt
vendored
@@ -1,7 +1,24 @@
|
||||
package _Self
|
||||
|
||||
import _Self.buildTypes.*
|
||||
import _Self.vcsRoots.*
|
||||
import _Self.buildTypes.GitHubPullRequests
|
||||
import _Self.buildTypes.Nvim
|
||||
import _Self.buildTypes.PluginVerifier
|
||||
import _Self.buildTypes.Release
|
||||
import _Self.buildTypes.ReleaseEap
|
||||
import _Self.buildTypes.TestsForIntelliJ20181
|
||||
import _Self.buildTypes.TestsForIntelliJ20182
|
||||
import _Self.buildTypes.TestsForIntelliJ20183
|
||||
import _Self.buildTypes.TestsForIntelliJ20191
|
||||
import _Self.buildTypes.TestsForIntelliJ20192
|
||||
import _Self.buildTypes.TestsForIntelliJ20193
|
||||
import _Self.buildTypes.TestsForIntelliJ20201
|
||||
import _Self.buildTypes.TestsForIntelliJ20202
|
||||
import _Self.buildTypes.TestsForIntelliJ20203
|
||||
import _Self.buildTypes.TestsForIntelliJEAP
|
||||
import _Self.vcsRoots.Branch_181
|
||||
import _Self.vcsRoots.Branch_183
|
||||
import _Self.vcsRoots.Branch_191_193
|
||||
import _Self.vcsRoots.GitHubPullRequest
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.Project
|
||||
|
||||
object Project : Project({
|
||||
@@ -11,21 +28,26 @@ object Project : Project({
|
||||
vcsRoot(Branch_181)
|
||||
vcsRoot(GitHubPullRequest)
|
||||
vcsRoot(Branch_191_193)
|
||||
vcsRoot(Branch_Nvim)
|
||||
|
||||
buildType(GitHubPullRequests)
|
||||
|
||||
buildType(Release)
|
||||
buildType(ReleaseEap)
|
||||
|
||||
buildType(TestsForIntelliJ20201)
|
||||
buildType(TestsForIntelliJ20202)
|
||||
buildType(TestsForIntelliJ20203)
|
||||
buildType(TestsForIntelliJEAP)
|
||||
|
||||
buildType(Nvim)
|
||||
buildType(PluginVerifier)
|
||||
|
||||
buildType(TestsForIntelliJ20191)
|
||||
buildType(TestsForIntelliJ20181)
|
||||
buildType(TestsForIntelliJ20192)
|
||||
buildType(TestsForIntelliJ20182)
|
||||
buildType(TestsForIntelliJ20193)
|
||||
buildType(TestsForIntelliJ20183)
|
||||
// buildType(Nvim)
|
||||
buildType(ReleaseEap)
|
||||
buildType(TestsForIntelliJ20202)
|
||||
buildType(TestsForIntelliJEAP)
|
||||
|
||||
features {
|
||||
feature {
|
||||
|
1
.teamcity/_Self/buildTypes/ActiveTests.kt
vendored
1
.teamcity/_Self/buildTypes/ActiveTests.kt
vendored
@@ -41,5 +41,6 @@ sealed class ActiveTests(buildName: String, ijVersion: String) : BuildType({
|
||||
})
|
||||
|
||||
object TestsForIntelliJEAP : ActiveTests("Tests for IntelliJ Latest EAP", "LATEST-EAP-SNAPSHOT")
|
||||
object TestsForIntelliJ20203 : ActiveTests("Tests for IntelliJ 2020.3", "2020.3")
|
||||
object TestsForIntelliJ20202 : ActiveTests("Tests for IntelliJ 2020.2", "2020.2")
|
||||
object TestsForIntelliJ20201 : ActiveTests("Tests for IntelliJ 2020.1", "2020.1")
|
||||
|
@@ -1,7 +1,8 @@
|
||||
package _Self.buildTypes
|
||||
|
||||
import _Self.vcsRoots.GitHubPullRequest
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.*
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.CheckoutMode
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.PullRequests
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.commitStatusPublisher
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.pullRequests
|
||||
@@ -15,7 +16,7 @@ object GitHubPullRequests : BuildType({
|
||||
|
||||
params {
|
||||
param("env.ORG_GRADLE_PROJECT_downloadIdeaSources", "false")
|
||||
param("env.ORG_GRADLE_PROJECT_ideaVersion", "2020.1")
|
||||
param("env.ORG_GRADLE_PROJECT_ideaVersion", "2020.3")
|
||||
param("env.ORG_GRADLE_PROJECT_instrumentPluginCode", "false")
|
||||
}
|
||||
|
||||
|
22
.teamcity/_Self/buildTypes/Nvim.kt
vendored
22
.teamcity/_Self/buildTypes/Nvim.kt
vendored
@@ -2,36 +2,40 @@ package _Self.buildTypes
|
||||
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.CheckoutMode
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.DslContext
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.script
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs
|
||||
|
||||
object Nvim : BuildType({
|
||||
name = "NVIM"
|
||||
description = "branch EAP"
|
||||
name = "Tests with nvim"
|
||||
description = "Running tests with nvim integration"
|
||||
|
||||
params {
|
||||
param("env.ORG_GRADLE_PROJECT_downloadIdeaSources", "false")
|
||||
param("env.ORG_GRADLE_PROJECT_ideaVersion", "LATEST-EAP-SNAPSHOT")
|
||||
param("env.ORG_GRADLE_PROJECT_instrumentPluginCode", "false")
|
||||
param("env.ideavim.nvim.path", "./nvim-linux64/bin/nvim")
|
||||
}
|
||||
|
||||
vcs {
|
||||
root(_Self.vcsRoots.Branch_Nvim)
|
||||
root(DslContext.settingsRoot)
|
||||
|
||||
checkoutMode = CheckoutMode.ON_SERVER
|
||||
}
|
||||
|
||||
steps {
|
||||
script {
|
||||
scriptContent = "apt-get install neovim"
|
||||
name = "Set up NeoVim"
|
||||
scriptContent = """
|
||||
wget https://github.com/neovim/neovim/releases/download/v0.4.4/nvim-linux64.tar.gz
|
||||
tar xzf nvim-linux64.tar.gz
|
||||
cd nvim-linux64/bin
|
||||
chmod +x nvim
|
||||
""".trimIndent()
|
||||
}
|
||||
gradle {
|
||||
tasks = "--version"
|
||||
param("org.jfrog.artifactory.selectedDeployableServer.defaultModuleVersionConfiguration", "GLOBAL")
|
||||
}
|
||||
gradle {
|
||||
tasks = "clean test"
|
||||
tasks = "clean testWithNeovim"
|
||||
buildFile = ""
|
||||
enableStacktrace = true
|
||||
param("org.jfrog.artifactory.selectedDeployableServer.defaultModuleVersionConfiguration", "GLOBAL")
|
||||
|
40
.teamcity/_Self/buildTypes/PluginVerifier.kt
vendored
Normal file
40
.teamcity/_Self/buildTypes/PluginVerifier.kt
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
package _Self.buildTypes
|
||||
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.CheckoutMode
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.DslContext
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs
|
||||
|
||||
object PluginVerifier : BuildType({
|
||||
name = "Plugin verification"
|
||||
params {
|
||||
param("env.ORG_GRADLE_PROJECT_downloadIdeaSources", "false")
|
||||
param("env.ORG_GRADLE_PROJECT_instrumentPluginCode", "false")
|
||||
}
|
||||
|
||||
vcs {
|
||||
root(DslContext.settingsRoot)
|
||||
|
||||
checkoutMode = CheckoutMode.ON_SERVER
|
||||
}
|
||||
|
||||
steps {
|
||||
gradle {
|
||||
tasks = "clean runPluginVerifier"
|
||||
buildFile = ""
|
||||
enableStacktrace = true
|
||||
param("org.jfrog.artifactory.selectedDeployableServer.defaultModuleVersionConfiguration", "GLOBAL")
|
||||
}
|
||||
}
|
||||
|
||||
triggers {
|
||||
vcs {
|
||||
branchFilter = ""
|
||||
}
|
||||
}
|
||||
|
||||
requirements {
|
||||
noLessThanVer("teamcity.agent.jvm.version", "1.8")
|
||||
}
|
||||
})
|
12
.teamcity/_Self/buildTypes/Release.kt
vendored
12
.teamcity/_Self/buildTypes/Release.kt
vendored
@@ -1,6 +1,8 @@
|
||||
package _Self.buildTypes
|
||||
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.*
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.CheckoutMode
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.DslContext
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle
|
||||
|
||||
object Release : BuildType({
|
||||
@@ -8,11 +10,15 @@ object Release : BuildType({
|
||||
description = "Build and publish IdeaVim plugin"
|
||||
|
||||
artifactRules = "build/distributions/*"
|
||||
buildNumberPattern = "0.60"
|
||||
buildNumberPattern = "0.61"
|
||||
|
||||
params {
|
||||
param("env.ORG_GRADLE_PROJECT_ideaVersion", "2020.2")
|
||||
password("env.ORG_GRADLE_PROJECT_publishToken", "credentialsJSON:ec1dc748-e289-47e1-88b6-f193d7999bf4", label = "Password")
|
||||
password(
|
||||
"env.ORG_GRADLE_PROJECT_publishToken",
|
||||
"credentialsJSON:ec1dc748-e289-47e1-88b6-f193d7999bf4",
|
||||
label = "Password"
|
||||
)
|
||||
param("env.ORG_GRADLE_PROJECT_publishUsername", "vlan")
|
||||
param("env.ORG_GRADLE_PROJECT_version", "%build.number%")
|
||||
param("env.ORG_GRADLE_PROJECT_downloadIdeaSources", "false")
|
||||
|
14
.teamcity/_Self/buildTypes/ReleaseEap.kt
vendored
14
.teamcity/_Self/buildTypes/ReleaseEap.kt
vendored
@@ -13,16 +13,24 @@ object ReleaseEap : BuildType({
|
||||
description = "Build and publish EAP of IdeaVim plugin"
|
||||
|
||||
artifactRules = "build/distributions/*"
|
||||
buildNumberPattern = "0.60.%build.counter%"
|
||||
buildNumberPattern = "0.61.%build.counter%"
|
||||
|
||||
params {
|
||||
param("env.ORG_GRADLE_PROJECT_ideaVersion", "2020.2")
|
||||
password("env.ORG_GRADLE_PROJECT_publishToken", "credentialsJSON:ec1dc748-e289-47e1-88b6-f193d7999bf4", label = "Token")
|
||||
password(
|
||||
"env.ORG_GRADLE_PROJECT_publishToken",
|
||||
"credentialsJSON:ec1dc748-e289-47e1-88b6-f193d7999bf4",
|
||||
label = "Token"
|
||||
)
|
||||
param("env.ORG_GRADLE_PROJECT_publishUsername", "vlan")
|
||||
param("env.ORG_GRADLE_PROJECT_version", "%build.number%")
|
||||
param("env.ORG_GRADLE_PROJECT_downloadIdeaSources", "false")
|
||||
param("env.ORG_GRADLE_PROJECT_publishChannels", "eap")
|
||||
password("env.ORG_GRADLE_PROJECT_slackUrl", "credentialsJSON:a8ab8150-e6f8-4eaf-987c-bcd65eac50b5", label = "Slack Token")
|
||||
password(
|
||||
"env.ORG_GRADLE_PROJECT_slackUrl",
|
||||
"credentialsJSON:a8ab8150-e6f8-4eaf-987c-bcd65eac50b5",
|
||||
label = "Slack Token"
|
||||
)
|
||||
}
|
||||
|
||||
vcs {
|
||||
|
@@ -1,42 +0,0 @@
|
||||
package _Self.buildTypes
|
||||
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.*
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs
|
||||
|
||||
object TestsForIntelliJ20181 : BuildType({
|
||||
name = "Tests for IntelliJ 2018.1"
|
||||
description = "branch 181"
|
||||
|
||||
params {
|
||||
param("env.ORG_GRADLE_PROJECT_downloadIdeaSources", "false")
|
||||
param("env.ORG_GRADLE_PROJECT_ideaVersion", "IC-2018.1")
|
||||
param("env.ORG_GRADLE_PROJECT_instrumentPluginCode", "false")
|
||||
param("env.ORG_GRADLE_PROJECT_javaVersion", "1.8")
|
||||
}
|
||||
|
||||
vcs {
|
||||
root(_Self.vcsRoots.Branch_181)
|
||||
|
||||
checkoutMode = CheckoutMode.ON_SERVER
|
||||
}
|
||||
|
||||
steps {
|
||||
gradle {
|
||||
tasks = "clean test"
|
||||
buildFile = ""
|
||||
enableStacktrace = true
|
||||
param("org.jfrog.artifactory.selectedDeployableServer.defaultModuleVersionConfiguration", "GLOBAL")
|
||||
}
|
||||
}
|
||||
|
||||
triggers {
|
||||
vcs {
|
||||
branchFilter = ""
|
||||
}
|
||||
}
|
||||
|
||||
requirements {
|
||||
noLessThanVer("teamcity.agent.jvm.version", "1.8")
|
||||
}
|
||||
})
|
@@ -1,42 +0,0 @@
|
||||
package _Self.buildTypes
|
||||
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.*
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs
|
||||
|
||||
object TestsForIntelliJ20182 : BuildType({
|
||||
name = "Tests for IntelliJ 2018.2"
|
||||
description = "branch 182"
|
||||
|
||||
params {
|
||||
param("env.ORG_GRADLE_PROJECT_downloadIdeaSources", "false")
|
||||
param("env.ORG_GRADLE_PROJECT_ideaVersion", "IC-2018.2")
|
||||
param("env.ORG_GRADLE_PROJECT_instrumentPluginCode", "false")
|
||||
param("env.ORG_GRADLE_PROJECT_javaVersion", "1.8")
|
||||
}
|
||||
|
||||
vcs {
|
||||
root(_Self.vcsRoots.Branch_181)
|
||||
|
||||
checkoutMode = CheckoutMode.ON_SERVER
|
||||
}
|
||||
|
||||
steps {
|
||||
gradle {
|
||||
tasks = "clean test"
|
||||
buildFile = ""
|
||||
enableStacktrace = true
|
||||
param("org.jfrog.artifactory.selectedDeployableServer.defaultModuleVersionConfiguration", "GLOBAL")
|
||||
}
|
||||
}
|
||||
|
||||
triggers {
|
||||
vcs {
|
||||
branchFilter = ""
|
||||
}
|
||||
}
|
||||
|
||||
requirements {
|
||||
noLessThanVer("teamcity.agent.jvm.version", "1.8")
|
||||
}
|
||||
})
|
@@ -1,6 +1,7 @@
|
||||
package _Self.buildTypes
|
||||
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.*
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.CheckoutMode
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs
|
||||
|
||||
|
@@ -1,43 +0,0 @@
|
||||
package _Self.buildTypes
|
||||
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.*
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs
|
||||
|
||||
object TestsForIntelliJ20191 : BuildType({
|
||||
name = "Tests for IntelliJ 2019.1"
|
||||
description = "branch 191"
|
||||
|
||||
params {
|
||||
param("env.ORG_GRADLE_PROJECT_downloadIdeaSources", "false")
|
||||
param("env.ORG_GRADLE_PROJECT_legacyNoJavaPlugin", "true")
|
||||
param("env.ORG_GRADLE_PROJECT_ideaVersion", "IC-2019.1")
|
||||
param("env.ORG_GRADLE_PROJECT_instrumentPluginCode", "false")
|
||||
param("env.ORG_GRADLE_PROJECT_javaVersion", "1.8")
|
||||
}
|
||||
|
||||
vcs {
|
||||
root(_Self.vcsRoots.Branch_191_193)
|
||||
|
||||
checkoutMode = CheckoutMode.ON_SERVER
|
||||
}
|
||||
|
||||
steps {
|
||||
gradle {
|
||||
tasks = "clean test"
|
||||
buildFile = ""
|
||||
enableStacktrace = true
|
||||
param("org.jfrog.artifactory.selectedDeployableServer.defaultModuleVersionConfiguration", "GLOBAL")
|
||||
}
|
||||
}
|
||||
|
||||
triggers {
|
||||
vcs {
|
||||
branchFilter = ""
|
||||
}
|
||||
}
|
||||
|
||||
requirements {
|
||||
noLessThanVer("teamcity.agent.jvm.version", "1.8")
|
||||
}
|
||||
})
|
@@ -1,43 +0,0 @@
|
||||
package _Self.buildTypes
|
||||
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.*
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs
|
||||
|
||||
object TestsForIntelliJ20192 : BuildType({
|
||||
name = "Tests for IntelliJ 2019.2"
|
||||
description = "branch 192"
|
||||
|
||||
params {
|
||||
param("env.ORG_GRADLE_PROJECT_downloadIdeaSources", "false")
|
||||
param("env.ORG_GRADLE_PROJECT_legacyNoJavaPlugin", "false")
|
||||
param("env.ORG_GRADLE_PROJECT_ideaVersion", "IC-2019.2")
|
||||
param("env.ORG_GRADLE_PROJECT_instrumentPluginCode", "false")
|
||||
param("env.ORG_GRADLE_PROJECT_javaVersion", "1.8")
|
||||
}
|
||||
|
||||
vcs {
|
||||
root(_Self.vcsRoots.Branch_191_193)
|
||||
|
||||
checkoutMode = CheckoutMode.ON_SERVER
|
||||
}
|
||||
|
||||
steps {
|
||||
gradle {
|
||||
tasks = "clean test"
|
||||
buildFile = ""
|
||||
enableStacktrace = true
|
||||
param("org.jfrog.artifactory.selectedDeployableServer.defaultModuleVersionConfiguration", "GLOBAL")
|
||||
}
|
||||
}
|
||||
|
||||
triggers {
|
||||
vcs {
|
||||
branchFilter = ""
|
||||
}
|
||||
}
|
||||
|
||||
requirements {
|
||||
noLessThanVer("teamcity.agent.jvm.version", "1.8")
|
||||
}
|
||||
})
|
@@ -1,43 +0,0 @@
|
||||
package _Self.buildTypes
|
||||
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.*
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs
|
||||
|
||||
object TestsForIntelliJ20193 : BuildType({
|
||||
name = "Tests for IntelliJ 2019.3"
|
||||
description = "branch 193"
|
||||
|
||||
params {
|
||||
param("env.ORG_GRADLE_PROJECT_downloadIdeaSources", "false")
|
||||
param("env.ORG_GRADLE_PROJECT_legacyNoJavaPlugin", "false")
|
||||
param("env.ORG_GRADLE_PROJECT_ideaVersion", "2019.3")
|
||||
param("env.ORG_GRADLE_PROJECT_instrumentPluginCode", "false")
|
||||
param("env.ORG_GRADLE_PROJECT_javaVersion", "1.8")
|
||||
}
|
||||
|
||||
vcs {
|
||||
root(_Self.vcsRoots.Branch_191_193)
|
||||
|
||||
checkoutMode = CheckoutMode.ON_SERVER
|
||||
}
|
||||
|
||||
steps {
|
||||
gradle {
|
||||
tasks = "clean test"
|
||||
buildFile = ""
|
||||
enableStacktrace = true
|
||||
param("org.jfrog.artifactory.selectedDeployableServer.defaultModuleVersionConfiguration", "GLOBAL")
|
||||
}
|
||||
}
|
||||
|
||||
triggers {
|
||||
vcs {
|
||||
branchFilter = ""
|
||||
}
|
||||
}
|
||||
|
||||
requirements {
|
||||
noLessThanVer("teamcity.agent.jvm.version", "1.8")
|
||||
}
|
||||
})
|
47
.teamcity/_Self/buildTypes/TestsForIntelliJ_181-182.kt
vendored
Normal file
47
.teamcity/_Self/buildTypes/TestsForIntelliJ_181-182.kt
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
@file:Suppress("ClassName")
|
||||
|
||||
package _Self.buildTypes
|
||||
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.CheckoutMode
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs
|
||||
|
||||
sealed class TestsForIntelliJ_181_branch(private val version: String) : BuildType({
|
||||
name = "Tests for IntelliJ $version"
|
||||
|
||||
params {
|
||||
param("env.ORG_GRADLE_PROJECT_downloadIdeaSources", "false")
|
||||
param("env.ORG_GRADLE_PROJECT_ideaVersion", "IC-$version")
|
||||
param("env.ORG_GRADLE_PROJECT_instrumentPluginCode", "false")
|
||||
param("env.ORG_GRADLE_PROJECT_javaVersion", "1.8")
|
||||
}
|
||||
|
||||
vcs {
|
||||
root(_Self.vcsRoots.Branch_181)
|
||||
|
||||
checkoutMode = CheckoutMode.ON_SERVER
|
||||
}
|
||||
|
||||
steps {
|
||||
gradle {
|
||||
tasks = "clean test"
|
||||
buildFile = ""
|
||||
enableStacktrace = true
|
||||
param("org.jfrog.artifactory.selectedDeployableServer.defaultModuleVersionConfiguration", "GLOBAL")
|
||||
}
|
||||
}
|
||||
|
||||
triggers {
|
||||
vcs {
|
||||
branchFilter = ""
|
||||
}
|
||||
}
|
||||
|
||||
requirements {
|
||||
noLessThanVer("teamcity.agent.jvm.version", "1.8")
|
||||
}
|
||||
})
|
||||
|
||||
object TestsForIntelliJ20181 : TestsForIntelliJ_181_branch("2018.1")
|
||||
object TestsForIntelliJ20182 : TestsForIntelliJ_181_branch("2018.2")
|
49
.teamcity/_Self/buildTypes/TestsForIntelliJ_191-193.kt
vendored
Normal file
49
.teamcity/_Self/buildTypes/TestsForIntelliJ_191-193.kt
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
@file:Suppress("ClassName")
|
||||
|
||||
package _Self.buildTypes
|
||||
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.CheckoutMode
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs
|
||||
|
||||
sealed class TestsForIntelliJ_191_193_branch(private val version: String) : BuildType({
|
||||
name = "Tests for IntelliJ $version"
|
||||
|
||||
params {
|
||||
param("env.ORG_GRADLE_PROJECT_downloadIdeaSources", "false")
|
||||
param("env.ORG_GRADLE_PROJECT_legacyNoJavaPlugin", "true")
|
||||
param("env.ORG_GRADLE_PROJECT_ideaVersion", "IC-$version")
|
||||
param("env.ORG_GRADLE_PROJECT_instrumentPluginCode", "false")
|
||||
param("env.ORG_GRADLE_PROJECT_javaVersion", "1.8")
|
||||
}
|
||||
|
||||
vcs {
|
||||
root(_Self.vcsRoots.Branch_191_193)
|
||||
|
||||
checkoutMode = CheckoutMode.ON_SERVER
|
||||
}
|
||||
|
||||
steps {
|
||||
gradle {
|
||||
tasks = "clean test"
|
||||
buildFile = ""
|
||||
enableStacktrace = true
|
||||
param("org.jfrog.artifactory.selectedDeployableServer.defaultModuleVersionConfiguration", "GLOBAL")
|
||||
}
|
||||
}
|
||||
|
||||
triggers {
|
||||
vcs {
|
||||
branchFilter = ""
|
||||
}
|
||||
}
|
||||
|
||||
requirements {
|
||||
noLessThanVer("teamcity.agent.jvm.version", "1.8")
|
||||
}
|
||||
})
|
||||
|
||||
object TestsForIntelliJ20191 : TestsForIntelliJ_191_193_branch("2019.1")
|
||||
object TestsForIntelliJ20192 : TestsForIntelliJ_191_193_branch("2019.2")
|
||||
object TestsForIntelliJ20193 : TestsForIntelliJ_191_193_branch("2019.3")
|
11
.teamcity/_Self/vcsRoots/Branch_Nvim.kt
vendored
11
.teamcity/_Self/vcsRoots/Branch_Nvim.kt
vendored
@@ -1,11 +0,0 @@
|
||||
@file:Suppress("ClassName")
|
||||
|
||||
package _Self.vcsRoots
|
||||
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.vcs.GitVcsRoot
|
||||
|
||||
object Branch_Nvim : GitVcsRoot({
|
||||
name = "https://github.com/JetBrains/ideavim (branch nvim)"
|
||||
url = "https://github.com/JetBrains/ideavim.git"
|
||||
branch = "neovim"
|
||||
})
|
12
AUTHORS.md
12
AUTHORS.md
@@ -323,6 +323,18 @@ Contributors:
|
||||
[![icon][github]](https://github.com/i-e-b)
|
||||
|
||||
Iain Ballard
|
||||
* [![icon][mail]](mailto:brandoncc@gmail.com)
|
||||
[![icon][github]](https://github.com/brandoncc)
|
||||
|
||||
Brandon Conway
|
||||
* [![icon][mail]](mailto:ga@anadoxin.org)
|
||||
[![icon][github]](https://github.com/antekone)
|
||||
|
||||
Grzegorz Antoniak
|
||||
* [![icon][mail]](mailto:shaunpatterson@gmail.com)
|
||||
[![icon][github]](https://github.com/shaunpatterson)
|
||||
|
||||
Shaun Patterson
|
||||
|
||||
If you are a contributor and your name is not listed here, feel free to
|
||||
contact the maintainers.
|
||||
|
50
CHANGES.md
50
CHANGES.md
@@ -24,24 +24,66 @@ usual beta standards.
|
||||
|
||||
## To Be Released
|
||||
|
||||
### Features:
|
||||
* Support `unmap` and `mapclear` commands [VIM-1491](https://youtrack.jetbrains.com/issue/VIM-1491)
|
||||
* Support mappings in ex panel (`cmap`) [VIM-1227](https://youtrack.jetbrains.com/issue/VIM-1227)
|
||||
|
||||
### Changes:
|
||||
* `octal` is now disabled by default for `nrformats`. [VIM-2181](https://youtrack.jetbrains.com/issue/VIM-2181)
|
||||
|
||||
### Fixes:
|
||||
* [VIM-2113](https://youtrack.jetbrains.com/issue/VIM-2113) Fix `cit` for empty tags
|
||||
* [VIM-2114](https://youtrack.jetbrains.com/issue/VIM-2114) Unnamed register isn't changed after deleting empty tag
|
||||
* [VIM-1475](https://youtrack.jetbrains.com/issue/VIM-1475) Enable block caret to be used in insert mode.
|
||||
* [VIM-2170](https://youtrack.jetbrains.com/issue/VIM-2170) Fix an alternative range format for `s` command
|
||||
* [VIM-1913](https://youtrack.jetbrains.com/issue/VIM-1913)
|
||||
[VIM-2154](https://youtrack.jetbrains.com/issue/VIM-2154) Several fixes for AppCode templates
|
||||
* [VIM-1756](https://youtrack.jetbrains.com/issue/VIM-1756) Fix startsel from insert mode
|
||||
|
||||
### Merged PRs:
|
||||
* [249](https://github.com/JetBrains/ideavim/pull/249) by [Jan Palus](https://github.com/jpalus): VIM-2113 Increase tag range only in visual mode
|
||||
* [250](https://github.com/JetBrains/ideavim/pull/250) by [Jan Palus](https://github.com/jpalus): VIM-2114 Do not override registers when deleting empty range
|
||||
* [256](https://github.com/JetBrains/ideavim/pull/256) by [Brandon Conway](https://github.com/brandoncc): Fix typo
|
||||
* [254](https://github.com/JetBrains/ideavim/pull/254) by [Grzegorz Antoniak](https://github.com/antekone): VIM-1475: Add an option to use block caret in insert mode
|
||||
* [225](https://github.com/JetBrains/ideavim/pull/225) by [sumoooru2](https://github.com/sumoooru2): Implement cmap
|
||||
* [258](https://github.com/JetBrains/ideavim/pull/258) by [Matt Ellis](https://github.com/citizenmatt): Show the correct handler class in :map
|
||||
* [257](https://github.com/JetBrains/ideavim/pull/257) by [Matt Ellis](https://github.com/citizenmatt): Extract SearchHighlightsHelper from SearchGroup
|
||||
* [251](https://github.com/JetBrains/ideavim/pull/251) by [Shaun Patterson](https://github.com/shaunpatterson): VIM-1756: startSel works in insert mode
|
||||
|
||||
## 0.61, 2020-11-12
|
||||
|
||||
### Features:
|
||||
* Ability to map IDE actions via the `<Action>` keyword. E.g. `map <C-K> <Action>(CommentByLineComment)`.
|
||||
Check out `README.md` for the details.
|
||||
* `IdeaVim: track action Ids` command to find action ids for the `:action` command.
|
||||
Enable this option in "Search everywhere" (double shift).
|
||||
* Ability to enable extensions using `vim-plug` or `vundle` syntax.
|
||||
E.g. to enable commentary extension you can use one of the following commands:
|
||||
```vim
|
||||
set commentary
|
||||
Plug 'tpope/vim-commentary'
|
||||
Plug 'https://github.com/tpope/vim-commentary'
|
||||
Plugin 'tpope/vim-commentary'
|
||||
...
|
||||
```
|
||||
This approach is especially handy if you have `.vimrc` with plugins registered via `vim-plug` or `vundle`.
|
||||
|
||||
|
||||
### Changes:
|
||||
* Fix `<Esc>` for dialogs. Now `<Esc>` will exit insert / visual mode and close the dialog from normal mode.
|
||||
* Add option to disable IdeaVim
|
||||
in dialogs / single line editors. [VIM-765](https://youtrack.jetbrains.com/issue/VIM-765)
|
||||
Use `set ideaenabledbufs=` to disable IdeaVim in dialog editors.
|
||||
_Note for EAP users: the option name can be changed for the stable release_
|
||||
* Add option to disable IdeaVim in dialogs / single line editors. [VIM-765](https://youtrack.jetbrains.com/issue/VIM-765)
|
||||
Use `set ideavimsupport=` to disable IdeaVim in dialog editors.
|
||||
* Reposition cursor when `scrolloff` changes
|
||||
|
||||
### Fixes:
|
||||
* [VIM-2150](https://youtrack.jetbrains.com/issue/VIM-2150) `Shift-D` should not delete an empty line
|
||||
* [VIM-2157](https://youtrack.jetbrains.com/issue/VIM-2157) Fix tab with an active template
|
||||
* [VIM-2156](https://youtrack.jetbrains.com/issue/VIM-2156) Correct up/down motions with inlays
|
||||
* [VIM-2144](https://youtrack.jetbrains.com/issue/VIM-2144) Correct text position after block insert with inlays
|
||||
* [VIM-2158](https://youtrack.jetbrains.com/issue/VIM-2158) Fix scrolling when `scrolloff` is over half screen height, but less than full height
|
||||
|
||||
### Merged PRs:
|
||||
* [255](https://github.com/JetBrains/ideavim/pull/255) by [Matt Ellis](https://github.com/citizenmatt): Fix various scrolling issues
|
||||
|
||||
## 0.60, 2020-10-09
|
||||
|
||||
|
@@ -26,7 +26,12 @@ OK, ready to do some coding?
|
||||
* Fork the repository and clone it to the local machine.
|
||||
* Open the project with IntelliJ IDEA.
|
||||
|
||||
Yoo hoo! You’re all set to begin contributing. Here are some useful gradle commands:
|
||||
Yoo hoo! You’re all set to begin contributing.
|
||||
We've prepared some useful configurations for you:
|
||||
|
||||

|
||||
|
||||
And here are useful gradle commands:
|
||||
|
||||
* `./gradlew runIde` — start the dev version of IntelliJ IDEA with IdeaVim installed.
|
||||
* `./gradlew test` — run tests.
|
||||
@@ -136,5 +141,5 @@ This is just terrible. [You know what to do](https://github.com/JetBrains/ideavi
|
||||
* [Changelog](CHANGES.md)
|
||||
* [Contributors listing](AUTHORS.md)
|
||||
|
||||
[teamcity-build-status]: https://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_TestsForIntelliJ20201&guest=1
|
||||
[teamcity-build-status-svg]: https://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_TestsForIntelliJ20201)/statusIcon.svg?guest=1
|
||||
[teamcity-build-status]: https://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_TestsForIntelliJEAP&guest=1
|
||||
[teamcity-build-status-svg]: https://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_TestsForIntelliJEAP)/statusIcon.svg?guest=1
|
||||
|
103
README.md
103
README.md
@@ -11,7 +11,7 @@ IdeaVim
|
||||
[![Gitter][gitter-svg]][gitter]
|
||||
[![Twitter][twitter-svg]][twitter]
|
||||
|
||||
IdeaVim is a Vim emulation plugin for IDEs based on the IntelliJ Platform.
|
||||
IdeaVim is a Vim emulation plugin for IntelliJ Platform-based IDEs.
|
||||
|
||||
##### Contact maintainers:
|
||||
* [Bug tracker](https://youtrack.jetbrains.com/issues/VIM)
|
||||
@@ -144,28 +144,45 @@ set idearefactormode=keep
|
||||
map <leader>f <Plug>(easymotion-s)
|
||||
map <leader>e <Plug>(easymotion-f)
|
||||
|
||||
map <leader>d :action Debug<CR>
|
||||
map <leader>r :action RenameElement<CR>
|
||||
map <leader>c :action Stop<CR>
|
||||
map <leader>z :action ToggleDistractionFreeMode<CR>
|
||||
map <leader>d <Action>(Debug)
|
||||
map <leader>r <Action>(RenameElement)
|
||||
map <leader>c <Action>(Stop)
|
||||
map <leader>z <Action>(ToggleDistractionFreeMode)
|
||||
|
||||
map <leader>s :action SelectInProjectView<CR>
|
||||
map <leader>a :action Annotate<CR>
|
||||
map <leader>h :action Vcs.ShowTabbedFileHistory<CR>
|
||||
map <S-Space> :action GotoNextError<CR>
|
||||
map <leader>s <Action>(SelectInProjectView)
|
||||
map <leader>a <Action>(Annotate)
|
||||
map <leader>h <Action>(Vcs.ShowTabbedFileHistory)
|
||||
map <S-Space> <Action>(GotoNextError)
|
||||
|
||||
map <leader>b :action ToggleLineBreakpoint<CR>
|
||||
map <leader>o :action FileStructurePopup<CR>
|
||||
map <leader>b <Action>(ToggleLineBreakpoint)
|
||||
map <leader>o <Action>(FileStructurePopup)
|
||||
```
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Suggested options</strong> (click to see)</summary>
|
||||
|
||||
Here is also a list of the suggested options from [defaults.vim](https://github.com/vim/vim/blob/master/runtime/defaults.vim)
|
||||
|
||||
```vim
|
||||
" Show a few lines of context around the cursor. Note that this makes the
|
||||
" text scroll if you mouse-click near the start or end of the window.
|
||||
set scrolloff=5
|
||||
|
||||
" Do incremental searching
|
||||
set incsearch
|
||||
|
||||
" Don't use Ex mode, use Q for formatting.
|
||||
map Q gq
|
||||
```
|
||||
</details>
|
||||
|
||||
|
||||
You can read your `~/.vimrc` file from `~/.ideavimrc` with this command:
|
||||
|
||||
source ~/.vimrc
|
||||
|
||||
Please note that IdeaVim currently parses `~/.ideavimrc` & `~/.vimrc` files via simple pattern-matching.
|
||||
> :warning: Please note that IdeaVim currently parses `~/.ideavimrc` & `~/.vimrc` files via simple pattern-matching.
|
||||
See [VIM-669](https://youtrack.jetbrains.com/issue/VIM-669) for proper parsing
|
||||
of VimL files.
|
||||
|
||||
@@ -183,67 +200,43 @@ Emulated Vim Plugins
|
||||
|
||||
See [doc/emulated-plugins.md](doc/emulated-plugins.md)
|
||||
|
||||
Changes to the IDE
|
||||
------------------
|
||||
Executing IDE Actions
|
||||
---------------------
|
||||
|
||||
### Executing IDE Actions
|
||||
|
||||
IdeaVim adds two commands for listing and executing arbitrary IDE actions as
|
||||
IdeaVim adds various commands for listing and executing arbitrary IDE actions as
|
||||
Ex commands or via `:map` command mappings:
|
||||
|
||||
* `:actionlist [pattern]`
|
||||
* Find IDE actions by name or keymap pattern (E.g. `:actionlist extract`, `:actionlist <C-D`)
|
||||
* `:action {name}`
|
||||
* Execute an action named `NAME`
|
||||
**Executing actions:**
|
||||
* `:action {action_id}`
|
||||
* Execute an action by id. Works from Ex command line.
|
||||
* `<Action>(*action_id*)`
|
||||
* For the mappings you can use a special `<Action>` keyword. Don't forget the parentheses.
|
||||
|
||||
In addition to `:actionlist` command, IdeaVim provides `IdeaVim: track action Ids` option to
|
||||
extract the ids of executed command. This option can be found in "Search everywhere" (double `shift`). **[To Be Released]**
|
||||
**Finding actions:**
|
||||
* `:actionlist [pattern]`
|
||||
* Find IDE actions by id or keymap pattern (E.g. `:actionlist extract`, `:actionlist <C-D`)
|
||||
|
||||
* In addition to `:actionlist` command, IdeaVim provides `IdeaVim: track action Ids` option to
|
||||
extract the ids of executed command. This option can be found in "Search everywhere" (double `shift`).
|
||||
|
||||
<details>
|
||||
<summary><strong>"Track aciton Ids" Details</strong> (click to see)</summary>
|
||||
<img src="resources/readme/track_action_id.gif" alt="track actioin ids"/>
|
||||
<summary><strong>"Track action Ids" Details</strong> (click to see)</summary>
|
||||
<img src="resources/readme/track_action_id.gif" alt="track action ids"/>
|
||||
</details>
|
||||
|
||||
For the mappings you can use a special `<Action>` keyword. Use `<Action>(*action_id*)` to map keys to some action. Don't
|
||||
forget the parentheses. This keyword works for insert mode as well. **[To Be Released]**
|
||||
|
||||
Examples:
|
||||
|
||||
```vim
|
||||
" Map \r to the Reformat Code action
|
||||
:map \r :action ReformatCode<CR>
|
||||
" or
|
||||
:map \r <Action>(ReformatCode) " [To Be Released]
|
||||
:map \r <Action>(ReformatCode)
|
||||
|
||||
" Map <leader>d to start debug
|
||||
:map <leader>d :action Debug<CR>
|
||||
" or
|
||||
:map <leader>d <Action>(Debug) " [To Be Released]
|
||||
:map <leader>d <Action>(Debug)
|
||||
|
||||
" Map \b to toggle the breakpoint on the current line
|
||||
:map \b :action ToggleLineBreakpoint<CR>
|
||||
" or
|
||||
:map \b <Action>(ToggleLineBreakpoint) " [To Be Released]
|
||||
:map \b <Action>(ToggleLineBreakpoint)
|
||||
```
|
||||
|
||||
### Undo/Redo
|
||||
|
||||
The IdeaVim plugin uses the undo/redo functionality of the IntelliJ Platform,
|
||||
so the behavior of the `u` and `<C-R>` commands may differ from the original
|
||||
Vim. Vim compatibility of undo/redo may be improved in future releases.
|
||||
|
||||
See also [unresolved undo issues](https://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+Help+topic%3A+u).
|
||||
|
||||
### Escape
|
||||
|
||||
Using `<Esc>` in dialog windows remains problematic. For most dialog windows,
|
||||
the Vim emulator is put into insert mode with `<Esc>` not working. You
|
||||
should use `<C-c>` or `<C-[>` instead. In some dialog windows, the normal mode is
|
||||
switched by default. The usage of the Vim emulator in dialog windows is an area for
|
||||
improvement.
|
||||
|
||||
See also [unresolved escape issues](https://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+Help+topic%3A+i_Esc).
|
||||
|
||||
:gem: Contributing
|
||||
------------
|
||||
|
||||
|
40
build.gradle
40
build.gradle
@@ -8,12 +8,12 @@ buildscript {
|
||||
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
||||
classpath "com.github.AlexPl292:mark-down-to-slack:1.0.1"
|
||||
classpath "com.github.AlexPl292:mark-down-to-slack:1.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'org.jetbrains.intellij' version '0.5.0'
|
||||
id 'org.jetbrains.intellij' version '0.6.5'
|
||||
id 'io.gitlab.arturbosch.detekt' version '1.14.1'
|
||||
id "org.jetbrains.changelog" version "0.6.2"
|
||||
}
|
||||
@@ -45,6 +45,8 @@ intellij {
|
||||
intellijRepo = "https://www.jetbrains.com/intellij-repository"
|
||||
plugins = ['java']
|
||||
|
||||
downloadRobotServerPlugin.version = "0.10.0"
|
||||
|
||||
publishPlugin {
|
||||
channels publishChannels.split(',')
|
||||
username publishUsername
|
||||
@@ -52,17 +54,31 @@ intellij {
|
||||
}
|
||||
}
|
||||
|
||||
runIdeForUiTests {
|
||||
systemProperty "robot-server.port", "8082"
|
||||
}
|
||||
|
||||
runPluginVerifier {
|
||||
ideVersions = ["IC-2020.1.4", "IC-2020.2.3"]
|
||||
downloadDirectory = "${project.buildDir}/pluginVerifier/ides"
|
||||
teamCityOutputFormat = true
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
maven { url = "https://jetbrains.bintray.com/intellij-third-party-dependencies" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
|
||||
compileOnly "org.jetbrains:annotations:19.0.0"
|
||||
compileOnly "org.jetbrains:annotations:20.1.0"
|
||||
|
||||
// https://mvnrepository.com/artifact/com.ensarsarajcic.neovim.java/neovim-api
|
||||
compile group: 'com.ensarsarajcic.neovim.java', name: 'neovim-api', version: '0.1.16'
|
||||
testImplementation("com.ensarsarajcic.neovim.java:neovim-api:0.1.16")
|
||||
|
||||
testImplementation("com.intellij.remoterobot:remote-robot:0.10.0")
|
||||
testImplementation("com.intellij.remoterobot:remote-fixtures:1.1.18")
|
||||
}
|
||||
|
||||
compileKotlin {
|
||||
@@ -77,8 +93,8 @@ compileTestKotlin {
|
||||
}
|
||||
|
||||
detekt {
|
||||
config = files("./detekt/config.yaml")
|
||||
baseline = file("${rootProject.projectDir}/detekt/baseline.xml")
|
||||
config = files("${rootProject.projectDir}/.detekt/config.yaml")
|
||||
baseline = file("${rootProject.projectDir}/.detekt/baseline.xml")
|
||||
input = files("src")
|
||||
|
||||
buildUponDefaultConfig = true
|
||||
@@ -94,7 +110,7 @@ tasks.detekt.jvmTarget = javaVersion
|
||||
|
||||
task testWithNeovim(type: Test) {
|
||||
group = "verification"
|
||||
systemProperty "ideavim.neovim.test", 'true'
|
||||
systemProperty "ideavim.nvim.test", 'true'
|
||||
}
|
||||
|
||||
changelog {
|
||||
@@ -107,12 +123,20 @@ changelog {
|
||||
// version = "0.60"
|
||||
}
|
||||
|
||||
task getUnreleasedChangelog() {
|
||||
group = "changelog"
|
||||
doLast {
|
||||
def log = changelog.getUnreleased().toHTML()
|
||||
println log
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("slackEapNotification") {
|
||||
doLast {
|
||||
if (!slackUrl) return
|
||||
def post = new URL(slackUrl).openConnection()
|
||||
def changeLog = changelog.getUnreleased().toText()
|
||||
def slackDown = new DownParser(changeLog).toSlack().toString()
|
||||
def slackDown = new DownParser(changeLog, true).toSlack().toString()
|
||||
def message = """
|
||||
{
|
||||
"text": "New version of IdeaVim",
|
||||
|
@@ -4,7 +4,15 @@ Emulated Vim Plugins
|
||||
IdeaVim extensions emulate plugins of the original Vim. In order to use
|
||||
IdeaVim extensions, you have to enable them via this command in your `~/.ideavimrc`:
|
||||
|
||||
```
|
||||
set <extension-name>
|
||||
```
|
||||
|
||||
If you reuse your existing `.vimrc` file using `source ~/.vimrc`, IdeaVim can parse and enable plugins that are defined
|
||||
using [vim-plug](https://github.com/junegunn/vim-plug) or [vundle](https://github.com/VundleVim/Vundle.vim).
|
||||
No additional set commands in `~/.ideavimrc` are required.
|
||||
If you'd like to disable some plugin that's enabled in `.vimrc`, you can use `set no<extension-name>`
|
||||
in `~/.ideavimrc`.
|
||||
|
||||
Available extensions:
|
||||
|
||||
@@ -20,18 +28,52 @@ Available extensions:
|
||||
## surround
|
||||
|
||||
* Setup: `set surround`
|
||||
* <details>
|
||||
<summary>Alternative vim-plug / vundle syntax</summary>
|
||||
<code>Plug 'https://github.com/tpope/vim-surround'</code>
|
||||
<br/>
|
||||
<code>Plug 'tpope/vim-surround'</code>
|
||||
<br/>
|
||||
<code>Plug 'vim-surround'</code>
|
||||
<br/>
|
||||
<code>Plug 'https://www.vim.org/scripts/script.php?script_id=1697'</code>
|
||||
</details>
|
||||
* Emulates [vim-surround](https://github.com/tpope/vim-surround)
|
||||
* Commands: `ys`, `cs`, `ds`, `S`
|
||||
|
||||
## multiple-cursors
|
||||
|
||||
* Setup: `set multiple-cursors`
|
||||
* <details>
|
||||
<summary>Alternative vim-plug / vundle syntax</summary>
|
||||
<code>Plug 'https://github.com/terryma/vim-multiple-cursors'</code>
|
||||
<br/>
|
||||
<code>Plug 'terryma/vim-multiple-cursors'</code>
|
||||
<br/>
|
||||
<code>Plug 'vim-multiple-cursors'</code>
|
||||
</details>
|
||||
* Emulates [vim-multiple-cursors](https://github.com/terryma/vim-multiple-cursors)
|
||||
* Commands: `<A-n>`, `<A-x>`, `<A-p>`, `g<A-n>`
|
||||
|
||||
## commentary
|
||||
|
||||
* Setup: `set commentary`
|
||||
* <details>
|
||||
<summary>Alternative vim-plug / vundle syntax</summary>
|
||||
<code>Plug 'https://github.com/tpope/vim-commentary'</code>
|
||||
<br/>
|
||||
<code>Plug 'tpope/vim-commentary'</code>
|
||||
<br/>
|
||||
<code>Plug 'vim-commentary'</code>
|
||||
<br/>
|
||||
<code>Plug 'https://www.vim.org/scripts/script.php?script_id=3695'</code>
|
||||
<br/>
|
||||
<code>Plug 'tomtom/tcomment_vim'</code>
|
||||
<br/>
|
||||
<code>Plug 'tcomment_vim'</code>
|
||||
<br/>
|
||||
<code>Plug 'https://www.vim.org/scripts/script.php?script_id=1173'</code>
|
||||
</details>
|
||||
* Emulates [commentary.vim](https://github.com/tpope/vim-commentary)
|
||||
* Commands: `gcc`, `gc + motion`, `v_gc`
|
||||
* By [Daniel Leong](https://github.com/dhleong)
|
||||
@@ -39,6 +81,22 @@ Available extensions:
|
||||
## ReplaceWithRegister
|
||||
|
||||
* Setup: `set ReplaceWithRegister`
|
||||
* <details>
|
||||
<summary>Alternative vim-plug / vundle syntax</summary>
|
||||
<code>Plug 'https://github.com/vim-scripts/ReplaceWithRegister'</code>
|
||||
<br/>
|
||||
<code>Plug 'vim-scripts/ReplaceWithRegister'</code>
|
||||
<br/>
|
||||
<code>Plug 'ReplaceWithRegister'</code>
|
||||
<br/>
|
||||
<code>Plug 'https://github.com/inkarkat/vim-ReplaceWithRegister'</code>
|
||||
<br/>
|
||||
<code>Plug 'inkarkat/vim-ReplaceWithRegister'</code>
|
||||
<br/>
|
||||
<code>Plug 'vim-ReplaceWithRegister'</code>
|
||||
<br/>
|
||||
<code>Plug 'https://www.vim.org/scripts/script.php?script_id=2703'</code>
|
||||
</details>
|
||||
* Emulates [ReplaceWithRegister](https://github.com/vim-scripts/ReplaceWithRegister)
|
||||
* Commands: `gr`, `grr`
|
||||
* By [igrekster](https://github.com/igrekster)
|
||||
@@ -47,6 +105,16 @@ Available extensions:
|
||||
|
||||
* Setup:
|
||||
* `set argtextobj`
|
||||
* <details>
|
||||
<summary>Alternative vim-plug / vundle syntax</summary>
|
||||
<code>Plug 'https://github.com/vim-scripts/argtextobj.vim'</code>
|
||||
<br/>
|
||||
<code>Plug 'vim-scripts/argtextobj.vim'</code>
|
||||
<br/>
|
||||
<code>Plug 'argtextobj.vim'</code>
|
||||
<br/>
|
||||
<code>Plug 'https://www.vim.org/scripts/script.php?script_id=2699'</code>
|
||||
</details>
|
||||
* By default, only the arguments inside parenthesis are considered. To extend the functionality
|
||||
to other types of brackets, set `g:argtextobj_pairs` variable to a comma-separated
|
||||
list of colon-separated pairs (same as VIM's `matchpairs` option), like
|
||||
@@ -59,6 +127,14 @@ Available extensions:
|
||||
## exchange
|
||||
|
||||
* Setup: `set exchange`
|
||||
* <details>
|
||||
<summary>Alternative vim-plug / vundle syntax</summary>
|
||||
<code>Plug 'https://github.com/tommcdo/vim-exchange'</code>
|
||||
<br/>
|
||||
<code>Plug 'tommcdo/vim-exchange'</code>
|
||||
<br/>
|
||||
<code>Plug 'vim-exchange'</code>
|
||||
</details>
|
||||
* Emulates [vim-exchange](https://github.com/tommcdo/vim-exchange)
|
||||
* Commands: `cx`, `cxx`, `X`, `cxc`
|
||||
* By [fan-tom](https://github.com/fan-tom)
|
||||
@@ -66,6 +142,16 @@ Available extensions:
|
||||
## textobj-entire
|
||||
|
||||
* Setup: `set textobj-entire`
|
||||
* <details>
|
||||
<summary>Alternative vim-plug / vundle syntax</summary>
|
||||
<code>Plug 'https://github.com/kana/vim-textobj-entire'</code>
|
||||
<br/>
|
||||
<code>Plug 'kana/vim-textobj-entire'</code>
|
||||
<br/>
|
||||
<code>Plug 'vim-textobj-entire'</code>
|
||||
<br/>
|
||||
<code>Plug 'https://www.vim.org/scripts/script.php?script_id=2610'</code>
|
||||
</details>
|
||||
* Emulates [vim-textobj-entire](https://github.com/kana/vim-textobj-entire)
|
||||
* Additional text objects: `ae`, `ie`
|
||||
* By [Alexandre Grison](https://github.com/agrison)
|
||||
@@ -74,6 +160,14 @@ Available extensions:
|
||||
|
||||
* Setup:
|
||||
* `set highlightedyank`
|
||||
* <details>
|
||||
<summary>Alternative vim-plug / vundle syntax</summary>
|
||||
<code>Plug 'https://github.com/machakann/vim-highlightedyank'</code>
|
||||
<br/>
|
||||
<code>Plug 'machakann/vim-highlightedyank'</code>
|
||||
<br/>
|
||||
<code>Plug 'vim-highlightedyank'</code>
|
||||
</details>
|
||||
* if you want to optimize highlight duration, assign a time in milliseconds:
|
||||
`let g:highlightedyank_highlight_duration = "1000"`
|
||||
A negative number makes the highlight persistent.
|
||||
|
@@ -125,7 +125,7 @@ The following `:set` commands can appear in `~/.ideavimrc` or be set manually in
|
||||
"<C-Down>", "<C-Up>", "<PageUp>", "<PageDown>",
|
||||
"<C-J>", "<C-Q>"
|
||||
|
||||
`ideaenabledbufs` `ideaenabledbufs` List of strings (default "dialog") [To Be Released]
|
||||
`ideavimsupport` `ideavimsupport` List of strings (default "dialog")
|
||||
|
||||
Define the list of additional buffers where IdeaVim is enabled.
|
||||
|
||||
|
@@ -28,9 +28,9 @@
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionRightMatchCharAction" mappingModes="NXO" keys="f"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionRightTillMatchCharAction" mappingModes="NXO" keys="t"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionHomeAction" mappingModes="NV" keys="«Home»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftHomeAction" mappingModes="NV" keys="«S-Home»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftHomeAction" mappingModes="INV" keys="«S-Home»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionEndAction" mappingModes="NVO" keys="«End»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftEndAction" mappingModes="NV" keys="«S-End»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftEndAction" mappingModes="INV" keys="«S-End»"/>
|
||||
<!-- Up/Down -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionDownAction" mappingModes="NXO" keys="j"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionDownCtrlNAction" mappingModes="NXO" keys="«C-N»"/>
|
||||
@@ -152,10 +152,10 @@
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollColumnRightAction" mappingModes="NXO" keys="zh,z«Left»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollHalfWidthLeftAction" mappingModes="NXO" keys="zL"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollHalfWidthRightAction" mappingModes="NXO" keys="zH"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionShiftDownAction" mappingModes="NV" keys="«S-Down»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionShiftUpAction" mappingModes="NV" keys="«S-Up»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftRightAction" mappingModes="NV" keys="«S-Right»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftLeftAction" mappingModes="NV" keys="«S-Left»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionShiftDownAction" mappingModes="INV" keys="«S-Down»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionShiftUpAction" mappingModes="INV" keys="«S-Up»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftRightAction" mappingModes="INV" keys="«S-Right»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftLeftAction" mappingModes="INV" keys="«S-Left»"/>
|
||||
<!-- Visual -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.visual.VisualExitModeAction" mappingModes="X" keys="«Esc»,«C-[»,«C-C»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.visual.VisualToggleCharacterModeAction" mappingModes="NX" keys="v"/>
|
||||
|
@@ -25,7 +25,9 @@
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.JoinLinesHandler" names="j[oin]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.JumpsHandler" names="ju[mps]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.LetHandler" names="let"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.MapHandler"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.mapping.MapHandler"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.mapping.UnMapHandler"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.mapping.MapClearHandler"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.MarkHandler" names="ma[rk],k"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.MarksHandler" names="marks"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.MoveTextHandler" names="m[ove]"/>
|
||||
@@ -64,5 +66,6 @@
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.TabCloseHandler" names="tabc[lose]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.BufferListHandler" names="buffers,ls,files"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.BufferHandler" names="b[uffer]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.PlugHandler" names="Plug[in]"/>
|
||||
</extensions>
|
||||
</idea-plugin>
|
||||
|
@@ -1,12 +1,84 @@
|
||||
<idea-plugin>
|
||||
<extensions defaultExtensionNs="IdeaVIM">
|
||||
<vimExtension implementation="com.maddyhome.idea.vim.extension.surround.VimSurroundExtension"/>
|
||||
<vimExtension implementation="com.maddyhome.idea.vim.extension.multiplecursors.VimMultipleCursorsExtension"/>
|
||||
<vimExtension implementation="com.maddyhome.idea.vim.extension.commentary.CommentaryExtension"/>
|
||||
<vimExtension implementation="com.maddyhome.idea.vim.extension.textobjentire.VimTextObjEntireExtension"/>
|
||||
<vimExtension implementation="com.maddyhome.idea.vim.extension.argtextobj.VimArgTextObjExtension"/>
|
||||
<vimExtension implementation="com.maddyhome.idea.vim.extension.replacewithregister.ReplaceWithRegister"/>
|
||||
<vimExtension implementation="com.maddyhome.idea.vim.extension.exchange.VimExchangeExtension"/>
|
||||
<vimExtension implementation="com.maddyhome.idea.vim.extension.highlightedyank.VimHighlightedYank"/>
|
||||
<vimExtension implementation="com.maddyhome.idea.vim.extension.surround.VimSurroundExtension" name="surround">
|
||||
<aliases>
|
||||
<alias name="https://github.com/tpope/vim-surround"/>
|
||||
<alias name="tpope/vim-surround"/>
|
||||
<alias name="vim-surround"/>
|
||||
<alias name="https://www.vim.org/scripts/script.php?script_id=1697"/>
|
||||
</aliases>
|
||||
</vimExtension>
|
||||
|
||||
<vimExtension implementation="com.maddyhome.idea.vim.extension.multiplecursors.VimMultipleCursorsExtension"
|
||||
name="multiple-cursors">
|
||||
<aliases>
|
||||
<alias name="https://github.com/terryma/vim-multiple-cursors"/>
|
||||
<alias name="terryma/vim-multiple-cursors"/>
|
||||
<alias name="vim-multiple-cursors"/>
|
||||
</aliases>
|
||||
</vimExtension>
|
||||
|
||||
<vimExtension implementation="com.maddyhome.idea.vim.extension.commentary.CommentaryExtension" name="commentary">
|
||||
<aliases>
|
||||
<alias name="https://github.com/tpope/vim-commentary"/>
|
||||
<alias name="tpope/vim-commentary"/>
|
||||
<alias name="vim-commentary"/>
|
||||
<alias name="https://www.vim.org/scripts/script.php?script_id=3695"/>
|
||||
<alias name="https://github.com/tomtom/tcomment_vim"/>
|
||||
<alias name="tomtom/tcomment_vim"/>
|
||||
<alias name="tcomment_vim"/>
|
||||
<alias name="https://www.vim.org/scripts/script.php?script_id=1173"/>
|
||||
</aliases>
|
||||
</vimExtension>
|
||||
|
||||
<vimExtension implementation="com.maddyhome.idea.vim.extension.textobjentire.VimTextObjEntireExtension"
|
||||
name="textobj-entire">
|
||||
<aliases>
|
||||
<alias name="https://github.com/kana/vim-textobj-entire"/>
|
||||
<alias name="kana/vim-textobj-entire"/>
|
||||
<alias name="vim-textobj-entire"/>
|
||||
<alias name="https://www.vim.org/scripts/script.php?script_id=2610"/>
|
||||
</aliases>
|
||||
</vimExtension>
|
||||
|
||||
<vimExtension implementation="com.maddyhome.idea.vim.extension.argtextobj.VimArgTextObjExtension"
|
||||
name="argtextobj">
|
||||
<aliases>
|
||||
<alias name="https://github.com/vim-scripts/argtextobj.vim"/>
|
||||
<alias name="vim-scripts/argtextobj.vim"/>
|
||||
<alias name="argtextobj.vim"/>
|
||||
<alias name="https://www.vim.org/scripts/script.php?script_id=2699"/>
|
||||
</aliases>
|
||||
</vimExtension>
|
||||
|
||||
<vimExtension implementation="com.maddyhome.idea.vim.extension.replacewithregister.ReplaceWithRegister"
|
||||
name="ReplaceWithRegister">
|
||||
<aliases>
|
||||
<alias name="https://github.com/vim-scripts/ReplaceWithRegister"/>
|
||||
<alias name="vim-scripts/ReplaceWithRegister"/>
|
||||
<alias name="ReplaceWithRegister"/>
|
||||
<alias name="https://github.com/inkarkat/vim-ReplaceWithRegister"/>
|
||||
<alias name="inkarkat/vim-ReplaceWithRegister"/>
|
||||
<alias name="vim-ReplaceWithRegister"/>
|
||||
<alias name="https://www.vim.org/scripts/script.php?script_id=2703"/>
|
||||
</aliases>
|
||||
</vimExtension>
|
||||
|
||||
<vimExtension implementation="com.maddyhome.idea.vim.extension.exchange.VimExchangeExtension" name="exchange">
|
||||
<aliases>
|
||||
<alias name="https://github.com/tommcdo/vim-exchange"/>
|
||||
<alias name="tommcdo/vim-exchange"/>
|
||||
<alias name="vim-exchange"/>
|
||||
</aliases>
|
||||
</vimExtension>
|
||||
|
||||
<vimExtension implementation="com.maddyhome.idea.vim.extension.highlightedyank.VimHighlightedYank"
|
||||
name="highlightedyank">
|
||||
<aliases>
|
||||
<alias name="https://github.com/machakann/vim-highlightedyank"/>
|
||||
<alias name="machakann/vim-highlightedyank"/>
|
||||
<alias name="vim-highlightedyank"/>
|
||||
</aliases>
|
||||
</vimExtension>
|
||||
</extensions>
|
||||
</idea-plugin>
|
||||
|
@@ -1,6 +1,8 @@
|
||||
<idea-plugin>
|
||||
<applicationListeners>
|
||||
<listener class="com.maddyhome.idea.vim.ui.ExEntryPanel$LafListener"
|
||||
<listener class="com.maddyhome.idea.vim.ui.ex.ExEntryPanel$LafListener"
|
||||
topic="com.intellij.ide.ui.LafManagerListener"/>
|
||||
<listener class="com.maddyhome.idea.vim.extension.highlightedyank.HighlightColorResetter"
|
||||
topic="com.intellij.ide.ui.LafManagerListener"/>
|
||||
</applicationListeners>
|
||||
<projectListeners>
|
||||
|
@@ -2,18 +2,70 @@
|
||||
<name>IdeaVim</name>
|
||||
<id>IdeaVIM</id>
|
||||
<change-notes><![CDATA[
|
||||
<h3>Features:</h3>
|
||||
<ul>
|
||||
<li>Fix ESC in dialogs</li>
|
||||
<li>Add option to disable IdeaVim in dialogs and single line editors</li>
|
||||
<li>Ability to map IDE actions via the <Action> keyword.</li>
|
||||
<li>"IdeaVim: track action Ids" command to find action ids for the :action command.
|
||||
Enable this option in "Search everywhere" (double shift).</li>
|
||||
<li>Support <code>unmap</code> and <code>mapclear</code> commands
|
||||
<a href="https://youtrack.jetbrains.com/issue/VIM-1491">VIM-1491</a>
|
||||
</li>
|
||||
<li>Support mappings in ex panel (<code>cmap</code>)
|
||||
<a href="https://youtrack.jetbrains.com/issue/VIM-1227">VIM-1227</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Fixes:</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://youtrack.jetbrains.com/issue/VIM-2113">VIM-2113</a>
|
||||
Fix <code>cit</code> for empty tags
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://youtrack.jetbrains.com/issue/VIM-2114">VIM-2114</a>
|
||||
Unnamed register isn't changed after deleting empty tag
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://youtrack.jetbrains.com/issue/VIM-1475">VIM-1475</a>
|
||||
Enable block caret to be used in insert mode.
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://youtrack.jetbrains.com/issue/VIM-2170">VIM-2170</a>
|
||||
Fix an alternative range format for <code>s</code> command
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Merged PRs:</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://github.com/JetBrains/ideavim/pull/249">249</a>
|
||||
by <a href="https://github.com/jpalus">Jan Palus</a>: VIM-2113 Increase tag range only in visual mode
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://github.com/JetBrains/ideavim/pull/250">250</a>
|
||||
by <a href="https://github.com/jpalus">Jan Palus</a>: VIM-2114 Do not override registers when deleting empty range
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://github.com/JetBrains/ideavim/pull/256">256</a>
|
||||
by <a href="https://github.com/brandoncc">Brandon Conway</a>: Fix typo
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://github.com/JetBrains/ideavim/pull/254">254</a>
|
||||
by <a href="https://github.com/antekone">Grzegorz Antoniak</a>: VIM-1475: Add an option to use block caret in insert
|
||||
mode
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://github.com/JetBrains/ideavim/pull/225">225</a>
|
||||
by <a href="https://github.com/sumoooru2">sumoooru2</a>: Implement cmap
|
||||
</li>
|
||||
</ul>
|
||||
<br/>
|
||||
<p>See also the complete <a href="https://github.com/JetBrains/ideavim/blob/master/CHANGES.md">changelog</a>.</p>
|
||||
]]></change-notes>
|
||||
]]>
|
||||
</change-notes>
|
||||
<description><![CDATA[
|
||||
<p>Vim emulation plug-in for IDEs based on the IntelliJ platform.</p>
|
||||
<p>IdeaVim supports many Vim features including normal/insert/visual modes, motion keys, deletion/changing, marks, registers, some Ex commands, Vim regexps, configuration via ~/.ideavimrc, macros, window commands, etc.</p>
|
||||
<p>Vim emulation plugin for IntelliJ Platform-based IDEs.</p>
|
||||
<br/>
|
||||
<p>IdeaVim supports many Vim features including normal/insert/visual modes, motion keys, deletion/changing,
|
||||
marks, registers, some Ex commands, Vim regexps, configuration via ~/.ideavimrc, macros, Vim plugins, etc.</p>
|
||||
<br/>
|
||||
<p>See also:</p>
|
||||
<ul>
|
||||
<li><a href="https://github.com/JetBrains/ideavim">GitHub repository</a>: documentation and contributing</li>
|
||||
@@ -25,11 +77,11 @@
|
||||
|
||||
<!-- Please search for "[VERSION UPDATE]" in project in case you update the since-build version -->
|
||||
<!-- Check for [Version Update] tag in YouTrack as well -->
|
||||
<idea-version since-build="201.5985.32"/>
|
||||
<idea-version since-build="201.5985.41"/>
|
||||
|
||||
<!-- Mark the plugin as compatible with RubyMine and other products based on the IntelliJ platform -->
|
||||
<depends>com.intellij.modules.lang</depends>
|
||||
<resource-bundle xmlns="">messages</resource-bundle>
|
||||
<resource-bundle>messages.IdeaVimBundle</resource-bundle>
|
||||
|
||||
<application-components>
|
||||
<component>
|
||||
@@ -38,7 +90,10 @@
|
||||
</application-components>
|
||||
|
||||
<extensionPoints>
|
||||
<extensionPoint name="vimExtension" interface="com.maddyhome.idea.vim.extension.VimExtension" dynamic="true"/>
|
||||
<extensionPoint name="vimExtension" beanClass="com.maddyhome.idea.vim.extension.ExtensionBeanClass" dynamic="true">
|
||||
<with attribute="implementation" implements="com.maddyhome.idea.vim.extension.VimExtension"/>
|
||||
|
||||
</extensionPoint>
|
||||
|
||||
<!-- For internal use only -->
|
||||
<extensionPoint name="vimExCommand" beanClass="com.maddyhome.idea.vim.ex.ExBeanClass" dynamic="true">
|
||||
@@ -56,7 +111,6 @@
|
||||
<statusBarWidgetFactory implementation="com.maddyhome.idea.vim.ui.StatusBarIconFactory"/>
|
||||
<statusBarWidgetFactory implementation="com.maddyhome.idea.vim.ui.ShowCmdStatusBarWidgetFactory" order="first"/>
|
||||
|
||||
<applicationService serviceImplementation="com.maddyhome.idea.vim.config.VimLocalConfig"/>
|
||||
<applicationService serviceImplementation="com.maddyhome.idea.vim.VimPlugin"/>
|
||||
|
||||
<!-- Initialise as early as possible so that we're ready to edit quickly. This is especially important for Rider,
|
||||
@@ -73,7 +127,7 @@
|
||||
<xi:include href="/META-INF/includes/VimExtensions.xml" xpointer="xpointer(/idea-plugin/*)"/>
|
||||
<xi:include href="/META-INF/includes/VimListeners.xml" xpointer="xpointer(/idea-plugin/*)"/>
|
||||
|
||||
<actions>
|
||||
<actions resource-bundle="messages.IdeaVimBundle">
|
||||
<action id="VimPluginToggle" class="com.maddyhome.idea.vim.action.VimPluginToggleAction">
|
||||
<add-to-group group-id="ToolsMenu" anchor="last"/>
|
||||
</action>
|
||||
@@ -99,8 +153,6 @@
|
||||
</action>
|
||||
</group>
|
||||
|
||||
<action id="VimFindActionIdAction"
|
||||
class="com.maddyhome.idea.vim.listener.FindActionIdAction" text="IdeaVim: Track Action Ids"
|
||||
description="Starts tracking ids of executed actions"/>
|
||||
<action id="VimFindActionIdAction" class="com.maddyhome.idea.vim.listener.FindActionIdAction"/>
|
||||
</actions>
|
||||
</idea-plugin>
|
||||
|
BIN
resources/contributing/configurations.png
Normal file
BIN
resources/contributing/configurations.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
@@ -72,8 +72,54 @@ E475=E475: Invalid argument: {0}
|
||||
E774=E774: 'operatorfunc' is empty
|
||||
|
||||
action.VimPluginToggle.text=Vim Emulator
|
||||
description.VimPluginToggle.description=Toggle the vim plugin On/off
|
||||
action.VimPluginToggle.description=Toggle the vim plugin On/Off
|
||||
action.VimPluginToggle.enabled=Enabled
|
||||
action.VimPluginToggle.enable=Enable
|
||||
|
||||
action.VimShortcutKeyAction.text=Shortcuts
|
||||
|
||||
action.VimActions.text=Vim Actions
|
||||
action.not.found.0=Action not found: {0}
|
||||
|
||||
action.VimFindActionIdAction.text=IdeaVim: Track Action Ids
|
||||
action.VimFindActionIdAction.description=Starts tracking ids of executed actions
|
||||
|
||||
ex.show.all.actions.0.1=--- Actions ---{0}{1}
|
||||
e471.argument.required=E471: Argument required
|
||||
|
||||
buffer.0.does.not.exist=Buffer {0} does not exist
|
||||
no.matching.buffer.for.0=No matching buffer for {0}
|
||||
no.write.since.last.change.add.to.override=No write since last change (add ! to override)
|
||||
more.than.one.match.for.0=More than one match for {0}
|
||||
e176.invalid.number.of.arguments=E176: Invalid number of arguments
|
||||
e183.user.defined.commands.must.start.with.an.uppercase.letter=E183: User defined commands must start with an uppercase letter
|
||||
e841.reserved.name.cannot.be.used.for.user.defined.command=E841: Reserved name, cannot be used for user defined command
|
||||
e174.command.already.exists.add.to.replace.it=E174: Command already exists: add ! to replace it
|
||||
recursion.detected.maximum.alias.depth.reached=Recursion detected, maximum alias depth reached.
|
||||
show.mode.recording=recording
|
||||
e184.no.such.user.defined.command.0=E184: No such user-defined command: {0}
|
||||
unable.to.find.0=Unable to find {0}
|
||||
more.ret.line.space.page.d.half.page.q.quit=-- MORE -- (RET: line, SPACE: page, d: half page, q: quit)
|
||||
hit.enter.or.type.command.to.continue=Hit ENTER or type command to continue
|
||||
ex.output.panel.more=-- MORE --
|
||||
command.name.vim.macro.playback=Vim Macro Playback
|
||||
action.no.changes.text=No Changes
|
||||
action.reload.text=Reload
|
||||
replace.with.0=Replace with {0} (y/n/a/q/l)?
|
||||
error.invalid.command.argument=Error: invalid command argument
|
||||
argtextobj.invalid.value.of.g.argtextobj.pairs.0=argtextobj: Invalid value of g:argtextobj_pairs -- {0}
|
||||
highlightedyank.invalid.value.of.0.1=highlightedyank: Invalid value of {0} -- {1}
|
||||
could.not.find.file.0=Could not find file: {0}
|
||||
popup.advertisement.version=Version {0}
|
||||
action.eap.choice.active.text=EAP{0, choice, 0# (Active)|1#}
|
||||
action.about.eap.text=About EAP...
|
||||
action.contacts.help.text=Contacts && Help
|
||||
action.contact.on.twitter.text=Contact on Twitter
|
||||
action.create.issue.text=Create an Issue
|
||||
action.contribute.on.github.text=Contribute on GitHub
|
||||
action.settings.text=Settings...
|
||||
action.finish.eap.text=Finish EAP
|
||||
action.subscribe.to.eap.text=Subscribe to EAP
|
||||
configurable.name.vim.emulation=Vim Emulation
|
||||
border.title.shortcut.conflicts.for.active.keymap=Shortcut Conflicts for Active Keymap
|
||||
message.no.more.matches=No more matches
|
@@ -140,6 +140,6 @@ public class EventFacade {
|
||||
}
|
||||
|
||||
private @NotNull TypedAction getTypedAction() {
|
||||
return EditorActionManager.getInstance().getTypedAction();
|
||||
return TypedAction.getInstance();
|
||||
}
|
||||
}
|
||||
|
@@ -26,10 +26,8 @@ import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ModalityState;
|
||||
import com.intellij.openapi.command.CommandProcessor;
|
||||
import com.intellij.openapi.command.UndoConfirmationPolicy;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.ActionPlan;
|
||||
import com.intellij.openapi.editor.actionSystem.CaretSpecificDataContext;
|
||||
import com.intellij.openapi.editor.actionSystem.DocCommandGroupId;
|
||||
import com.intellij.openapi.editor.actionSystem.TypedActionHandler;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -40,17 +38,14 @@ import com.maddyhome.idea.vim.action.change.insert.InsertCompletedDigraphAction;
|
||||
import com.maddyhome.idea.vim.action.change.insert.InsertCompletedLiteralAction;
|
||||
import com.maddyhome.idea.vim.action.macro.ToggleRecordingAction;
|
||||
import com.maddyhome.idea.vim.command.*;
|
||||
import com.maddyhome.idea.vim.extension.VimExtensionHandler;
|
||||
import com.maddyhome.idea.vim.group.ChangeGroup;
|
||||
import com.maddyhome.idea.vim.group.RegisterGroup;
|
||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
||||
import com.maddyhome.idea.vim.group.visual.VisualGroupKt;
|
||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
||||
import com.maddyhome.idea.vim.helper.*;
|
||||
import com.maddyhome.idea.vim.key.*;
|
||||
import com.maddyhome.idea.vim.listener.SelectionVimListenerSuppressor;
|
||||
import com.maddyhome.idea.vim.listener.VimListenerSuppressor;
|
||||
import com.maddyhome.idea.vim.option.OptionsManager;
|
||||
import com.maddyhome.idea.vim.ui.ex.ExEntryPanel;
|
||||
import com.maddyhome.idea.vim.ui.ShowCmd;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
@@ -59,13 +54,12 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.intellij.openapi.actionSystem.CommonDataKeys.*;
|
||||
import static com.intellij.openapi.actionSystem.PlatformDataKeys.PROJECT_FILE_DIRECTORY;
|
||||
@@ -599,6 +593,22 @@ public class KeyHandler {
|
||||
}
|
||||
|
||||
DigraphResult res = editorState.processDigraphKey(key, editor);
|
||||
if (ExEntryPanel.getInstance().isActive()) {
|
||||
switch (res.getResult()) {
|
||||
case DigraphResult.RES_HANDLED:
|
||||
setPromptCharacterEx(commandBuilder.isPuttingLiteral() ? '^' : key.getKeyChar());
|
||||
break;
|
||||
case DigraphResult.RES_DONE:
|
||||
case DigraphResult.RES_BAD:
|
||||
if (key.getKeyCode() == KeyEvent.VK_C && (key.getModifiers() & InputEvent.CTRL_DOWN_MASK) != 0) {
|
||||
return false;
|
||||
} else {
|
||||
ExEntryPanel.getInstance().getEntry().clearCurrentAction();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch (res.getResult()) {
|
||||
case DigraphResult.RES_HANDLED:
|
||||
editorState.getCommandBuilder().addKey(key);
|
||||
@@ -753,8 +763,10 @@ public class KeyHandler {
|
||||
// the key handler when it's complete.
|
||||
if (action instanceof InsertCompletedDigraphAction) {
|
||||
editorState.startDigraphSequence();
|
||||
setPromptCharacterEx('?');
|
||||
} else if (action instanceof InsertCompletedLiteralAction) {
|
||||
editorState.startLiteralSequence();
|
||||
setPromptCharacterEx('^');
|
||||
}
|
||||
break;
|
||||
case EX_STRING:
|
||||
@@ -777,7 +789,7 @@ public class KeyHandler {
|
||||
* @param name The name of the action to execute
|
||||
* @param context The context to run it in
|
||||
*/
|
||||
public static boolean executeAction(@NotNull String name, @NotNull DataContext context) {
|
||||
public static boolean executeAction(@NotNull @NonNls String name, @NotNull DataContext context) {
|
||||
ActionManager aMgr = ActionManager.getInstance();
|
||||
AnAction action = aMgr.getAction(name);
|
||||
return action != null && executeAction(action, context);
|
||||
@@ -849,6 +861,13 @@ public class KeyHandler {
|
||||
|
||||
}
|
||||
|
||||
private void setPromptCharacterEx(final char promptCharacter) {
|
||||
final ExEntryPanel exEntryPanel = ExEntryPanel.getInstance();
|
||||
if (exEntryPanel.isActive()) {
|
||||
exEntryPanel.getEntry().setCurrentActionPromptCharacter(promptCharacter);
|
||||
}
|
||||
}
|
||||
|
||||
// This class is copied from com.intellij.openapi.editor.actionSystem.DialogAwareDataContext.DialogAwareDataContext
|
||||
private static final class DialogAwareDataContext implements DataContext {
|
||||
@SuppressWarnings("rawtypes")
|
||||
@@ -915,10 +934,13 @@ public class KeyHandler {
|
||||
if (editorState.getSubMode() == CommandState.SubMode.SINGLE_COMMAND &&
|
||||
(!cmd.getFlags().contains(CommandFlags.FLAG_EXPECT_MORE))) {
|
||||
editorState.popModes();
|
||||
VisualGroupKt.resetShape(CommandStateHelper.getMode(editor), editor);
|
||||
}
|
||||
|
||||
if (editorState.getCommandBuilder().isDone()) {
|
||||
KeyHandler.getInstance().reset(editor);
|
||||
}
|
||||
}
|
||||
|
||||
private final Editor editor;
|
||||
private final DataContext context;
|
||||
|
@@ -19,6 +19,7 @@ package com.maddyhome.idea.vim;
|
||||
|
||||
import com.intellij.ide.plugins.IdeaPluginDescriptor;
|
||||
import com.intellij.ide.plugins.PluginManager;
|
||||
import com.intellij.ide.plugins.PluginManagerCore;
|
||||
import com.intellij.notification.Notification;
|
||||
import com.intellij.notification.NotificationListener;
|
||||
import com.intellij.openapi.Disposable;
|
||||
@@ -40,7 +41,6 @@ import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.wm.StatusBar;
|
||||
import com.intellij.openapi.wm.WindowManager;
|
||||
import com.maddyhome.idea.vim.config.VimLocalConfig;
|
||||
import com.maddyhome.idea.vim.config.VimState;
|
||||
import com.maddyhome.idea.vim.config.migration.ApplicationConfigurationMigrator;
|
||||
import com.maddyhome.idea.vim.ex.CommandParser;
|
||||
@@ -53,7 +53,7 @@ import com.maddyhome.idea.vim.group.visual.VisualMotionGroup;
|
||||
import com.maddyhome.idea.vim.helper.MacKeyRepeat;
|
||||
import com.maddyhome.idea.vim.listener.VimListenerManager;
|
||||
import com.maddyhome.idea.vim.option.OptionsManager;
|
||||
import com.maddyhome.idea.vim.ui.ExEntryPanel;
|
||||
import com.maddyhome.idea.vim.ui.ex.ExEntryPanel;
|
||||
import com.maddyhome.idea.vim.ui.StatusBarIconFactory;
|
||||
import com.maddyhome.idea.vim.ui.VimEmulationConfigurable;
|
||||
import com.maddyhome.idea.vim.ui.VimRcFileState;
|
||||
@@ -105,11 +105,6 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable
|
||||
public void initialize() {
|
||||
LOG.debug("initComponent");
|
||||
|
||||
// Initialize a legacy local config.
|
||||
if (previousStateVersion == 5) {
|
||||
//noinspection deprecation
|
||||
VimLocalConfig.Companion.initialize();
|
||||
}
|
||||
if (enabled) {
|
||||
Application application = ApplicationManager.getApplication();
|
||||
if (application.isUnitTestMode()) {
|
||||
@@ -168,7 +163,7 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable
|
||||
}
|
||||
|
||||
public static @Nullable RegisterGroup getRegisterIfCreated() {
|
||||
return ServiceManager.getServiceIfCreated(RegisterGroup.class);
|
||||
return ApplicationManager.getApplication().getServiceIfCreated(RegisterGroup.class);
|
||||
}
|
||||
|
||||
public static @NotNull FileGroup getFile() {
|
||||
@@ -180,7 +175,7 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable
|
||||
}
|
||||
|
||||
public static @Nullable SearchGroup getSearchIfCreated() {
|
||||
return ServiceManager.getServiceIfCreated(SearchGroup.class);
|
||||
return ApplicationManager.getApplication().getServiceIfCreated(SearchGroup.class);
|
||||
}
|
||||
|
||||
public static @NotNull ProcessGroup getProcess() {
|
||||
@@ -204,7 +199,7 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable
|
||||
}
|
||||
|
||||
public static @Nullable KeyGroup getKeyIfCreated() {
|
||||
return ServiceManager.getServiceIfCreated(KeyGroup.class);
|
||||
return ApplicationManager.getApplication().getServiceIfCreated(KeyGroup.class);
|
||||
}
|
||||
|
||||
public static @NotNull WindowGroup getWindow() {
|
||||
@@ -216,7 +211,7 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable
|
||||
}
|
||||
|
||||
public static @Nullable EditorGroup getEditorIfCreated() {
|
||||
return ServiceManager.getServiceIfCreated(EditorGroup.class);
|
||||
return ApplicationManager.getApplication().getServiceIfCreated(EditorGroup.class);
|
||||
}
|
||||
|
||||
public static @NotNull VisualMotionGroup getVisualMotion() {
|
||||
@@ -263,7 +258,7 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable
|
||||
}
|
||||
|
||||
public static @NotNull String getVersion() {
|
||||
final IdeaPluginDescriptor plugin = PluginManager.getPlugin(getPluginId());
|
||||
final IdeaPluginDescriptor plugin = PluginManagerCore.getPlugin(getPluginId());
|
||||
if (!ApplicationManager.getApplication().isInternal()) {
|
||||
return plugin != null ? plugin.getVersion() : "SNAPSHOT";
|
||||
}
|
||||
@@ -327,7 +322,7 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable
|
||||
showMessage(msg);
|
||||
}
|
||||
|
||||
public static void showMessage(@Nls @Nullable String msg) {
|
||||
public static void showMessage(@Nls(capitalization = Nls.Capitalization.Sentence) @Nullable String msg) {
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
getInstance().message = msg;
|
||||
}
|
||||
|
@@ -20,15 +20,29 @@ package com.maddyhome.idea.vim.action
|
||||
import com.intellij.openapi.actionSystem.DataContext
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.maddyhome.idea.vim.KeyHandler
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.CommandState
|
||||
import com.maddyhome.idea.vim.group.MotionGroup
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import com.maddyhome.idea.vim.helper.getTopLevelEditor
|
||||
import com.maddyhome.idea.vim.helper.mode
|
||||
import com.maddyhome.idea.vim.helper.vimForEachCaret
|
||||
|
||||
class ResetModeAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_WRITABLE
|
||||
|
||||
override fun execute(editor: Editor, context: DataContext, cmd: Command): Boolean {
|
||||
val modeBeforeReset = editor.mode
|
||||
KeyHandler.getInstance().fullReset(editor.getTopLevelEditor())
|
||||
|
||||
if (modeBeforeReset == CommandState.Mode.INSERT) {
|
||||
editor.vimForEachCaret { caret ->
|
||||
val position = VimPlugin.getMotion().getOffsetOfHorizontalMotion(editor, caret, -1, false)
|
||||
MotionGroup.moveCaret(editor, caret, position)
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
@@ -21,6 +21,7 @@ package com.maddyhome.idea.vim.action
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||
import com.intellij.openapi.project.DumbAwareToggleAction
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.helper.MessageHelper
|
||||
import com.maddyhome.idea.vim.ui.VimActions
|
||||
|
||||
/**
|
||||
@@ -38,7 +39,7 @@ class VimPluginToggleAction : DumbAwareToggleAction() {
|
||||
super.update(e)
|
||||
|
||||
e.presentation.text = if (VimActions.actionPlace == e.place) {
|
||||
if (VimPlugin.isEnabled()) "Enabled" else "Enable"
|
||||
} else "Vim Emulator"
|
||||
if (VimPlugin.isEnabled()) MessageHelper.message("action.VimPluginToggle.enabled") else MessageHelper.message("action.VimPluginToggle.enable")
|
||||
} else MessageHelper.message("action.VimPluginToggle.text")
|
||||
}
|
||||
}
|
||||
|
@@ -41,6 +41,7 @@ import com.maddyhome.idea.vim.helper.isIdeaVimDisabledHere
|
||||
import com.maddyhome.idea.vim.helper.isPrimaryEditor
|
||||
import com.maddyhome.idea.vim.helper.isTemplateActive
|
||||
import com.maddyhome.idea.vim.key.ShortcutOwner
|
||||
import com.maddyhome.idea.vim.listener.IdeaSpecifics.AppCodeTemplates.appCodeTemplateCaptured
|
||||
import com.maddyhome.idea.vim.listener.IdeaSpecifics.aceJumpActive
|
||||
import com.maddyhome.idea.vim.option.OptionsManager
|
||||
import java.awt.event.InputEvent
|
||||
@@ -99,6 +100,8 @@ class VimShortcutKeyAction : AnAction(), DumbAware {
|
||||
|
||||
if (keyCode == KeyEvent.VK_TAB && editor.isTemplateActive()) return false
|
||||
|
||||
if ((keyCode == KeyEvent.VK_TAB || keyCode == KeyEvent.VK_ENTER) && editor.appCodeTemplateCaptured()) return false
|
||||
|
||||
if (editor.inInsertMode) { // XXX: <Tab> won't be recorded in macros
|
||||
if (keyCode == KeyEvent.VK_TAB) {
|
||||
VimPlugin.getChange().tabAction = true
|
||||
@@ -128,7 +131,7 @@ class VimShortcutKeyAction : AnAction(), DumbAware {
|
||||
private fun isEnabledForEscape(editor: Editor): Boolean {
|
||||
return editor.isPrimaryEditor()
|
||||
|| EditorHelper.isFileEditor(editor) && !editor.inNormalMode
|
||||
|| OptionsManager.ideaenabledbufs.contains("dialog") && !editor.inNormalMode
|
||||
|| OptionsManager.ideavimsupport.contains("dialog") && !editor.inNormalMode
|
||||
}
|
||||
|
||||
private fun isShortcutConflict(keyStroke: KeyStroke): Boolean {
|
||||
|
@@ -28,7 +28,7 @@ import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
sealed class IncNumber(val inc: Int, val avalanche: Boolean) : VisualOperatorActionHandler.ForEachCaret() {
|
||||
sealed class IncNumber(val inc: Int, private val avalanche: Boolean) : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_EXIT_VISUAL)
|
||||
|
||||
|
@@ -10,7 +10,7 @@ import javax.swing.KeyStroke
|
||||
|
||||
class InsertCompletedDigraphAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
override val argumentType: Argument.Type? = Argument.Type.DIGRAPH
|
||||
override val argumentType: Argument.Type = Argument.Type.DIGRAPH
|
||||
|
||||
override fun execute(editor: Editor, context: DataContext, cmd: Command): Boolean {
|
||||
// The converted digraph character has been captured as an argument, push it back through key handler
|
||||
|
@@ -10,7 +10,7 @@ import javax.swing.KeyStroke
|
||||
|
||||
class InsertCompletedLiteralAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
override val argumentType: Argument.Type? = Argument.Type.DIGRAPH
|
||||
override val argumentType: Argument.Type = Argument.Type.DIGRAPH
|
||||
|
||||
override fun execute(editor: Editor, context: DataContext, cmd: Command): Boolean {
|
||||
// The converted literal character has been captured as an argument, push it back through key handler
|
||||
|
@@ -26,6 +26,7 @@ import com.intellij.openapi.actionSystem.DataContext
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.editor.VisualPosition
|
||||
import com.maddyhome.idea.vim.helper.EditorHelper
|
||||
import com.maddyhome.idea.vim.helper.VimNlsSafe
|
||||
import java.util.*
|
||||
import kotlin.math.max
|
||||
|
||||
@@ -43,7 +44,10 @@ class AddInlineInlaysAction : AnAction() {
|
||||
val lineLength = EditorHelper.getLineLength(editor, EditorHelper.visualLineToLogicalLine(editor, currentVisualLine))
|
||||
while (i < lineLength) {
|
||||
val relatesToPrecedingText = random.nextInt(10) > 7
|
||||
|
||||
@VimNlsSafe
|
||||
val text = "a".repeat(max(1, random.nextInt(7)))
|
||||
|
||||
val offset = EditorHelper.visualPositionToOffset(editor, VisualPosition(currentVisualLine, i))
|
||||
// We don't need a custom renderer, just use the standard parameter hint renderer
|
||||
inlayModel.addInlineElement(offset, relatesToPrecedingText, HintRenderer(if (relatesToPrecedingText) ":$text" else "$text:"))
|
||||
|
@@ -27,6 +27,7 @@ import com.maddyhome.idea.vim.command.Argument
|
||||
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.group.RegisterGroup
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
|
||||
class PlaybackRegisterAction : VimActionHandler.SingleExecution() {
|
||||
@@ -44,7 +45,7 @@ class PlaybackRegisterAction : VimActionHandler.SingleExecution() {
|
||||
'@' -> {
|
||||
application.runWriteAction { res.set(VimPlugin.getMacro().playbackLastRegister(editor, context, project, cmd.count)) }
|
||||
}
|
||||
':' -> { // No write action
|
||||
RegisterGroup.LAST_COMMAND_REGISTER -> { // No write action
|
||||
try {
|
||||
res.set(CommandParser.getInstance().processLastCommand(editor, context, cmd.count))
|
||||
} catch (e: ExException) {
|
||||
|
@@ -37,7 +37,7 @@ class MotionInnerSentenceAction : TextObjectActionHandler() {
|
||||
|
||||
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
|
||||
|
||||
override fun getRange(editor: Editor, caret: Caret, context: DataContext, count: Int, rawCount: Int, argument: Argument?): TextRange? {
|
||||
override fun getRange(editor: Editor, caret: Caret, context: DataContext, count: Int, rawCount: Int, argument: Argument?): TextRange {
|
||||
return VimPlugin.getMotion().getSentenceRange(editor, caret, count, false)
|
||||
}
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@ class MotionInnerWordAction : TextObjectActionHandler() {
|
||||
|
||||
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
|
||||
|
||||
override fun getRange(editor: Editor, caret: Caret, context: DataContext, count: Int, rawCount: Int, argument: Argument?): TextRange? {
|
||||
override fun getRange(editor: Editor, caret: Caret, context: DataContext, count: Int, rawCount: Int, argument: Argument?): TextRange {
|
||||
return VimPlugin.getMotion().getWordRange(editor, caret, count, false, false)
|
||||
}
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ class MotionOuterBigWordAction : TextObjectActionHandler() {
|
||||
|
||||
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
|
||||
|
||||
override fun getRange(editor: Editor, caret: Caret, context: DataContext, count: Int, rawCount: Int, argument: Argument?): TextRange? {
|
||||
override fun getRange(editor: Editor, caret: Caret, context: DataContext, count: Int, rawCount: Int, argument: Argument?): TextRange {
|
||||
return VimPlugin.getMotion().getWordRange(editor, caret, count, true, true)
|
||||
}
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@ class MotionOuterSentenceAction : TextObjectActionHandler() {
|
||||
|
||||
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
|
||||
|
||||
override fun getRange(editor: Editor, caret: Caret, context: DataContext, count: Int, rawCount: Int, argument: Argument?): TextRange? {
|
||||
override fun getRange(editor: Editor, caret: Caret, context: DataContext, count: Int, rawCount: Int, argument: Argument?): TextRange {
|
||||
return VimPlugin.getMotion().getSentenceRange(editor, caret, count, true)
|
||||
}
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ class MotionOuterWordAction : TextObjectActionHandler() {
|
||||
|
||||
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
|
||||
|
||||
override fun getRange(editor: Editor, caret: Caret, context: DataContext, count: Int, rawCount: Int, argument: Argument?): TextRange? {
|
||||
override fun getRange(editor: Editor, caret: Caret, context: DataContext, count: Int, rawCount: Int, argument: Argument?): TextRange {
|
||||
return VimPlugin.getMotion().getWordRange(editor, caret, count, true, false)
|
||||
}
|
||||
}
|
||||
|
@@ -47,9 +47,7 @@ class MotionScrollPageDownAction : VimActionHandler.SingleExecution() {
|
||||
class MotionScrollPageDownInsertModeAction : VimActionHandler.SingleExecution(), ComplicatedKeysAction {
|
||||
|
||||
override val keyStrokesSet: Set<List<KeyStroke>> = setOf(
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0)),
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, KeyEvent.SHIFT_DOWN_MASK)),
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_KP_DOWN, KeyEvent.SHIFT_DOWN_MASK))
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0))
|
||||
)
|
||||
|
||||
override val type: Command.Type = Command.Type.OTHER_READONLY
|
||||
|
@@ -47,9 +47,7 @@ class MotionScrollPageUpAction : VimActionHandler.SingleExecution() {
|
||||
class MotionScrollPageUpInsertModeAction : VimActionHandler.SingleExecution(), ComplicatedKeysAction {
|
||||
|
||||
override val keyStrokesSet: Set<List<KeyStroke>> = setOf(
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0)),
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_UP, KeyEvent.SHIFT_DOWN_MASK)),
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_KP_UP, KeyEvent.SHIFT_DOWN_MASK))
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0))
|
||||
)
|
||||
|
||||
override val type: Command.Type = Command.Type.OTHER_READONLY
|
||||
|
@@ -25,6 +25,7 @@ import com.maddyhome.idea.vim.command.Argument
|
||||
import com.maddyhome.idea.vim.command.CommandFlags
|
||||
import com.maddyhome.idea.vim.command.MotionType
|
||||
import com.maddyhome.idea.vim.handler.MotionActionHandler
|
||||
import com.maddyhome.idea.vim.helper.Direction
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
@@ -37,7 +38,7 @@ class SearchWholeWordBackwardAction : MotionActionHandler.ForEachCaret() {
|
||||
count: Int,
|
||||
rawCount: Int,
|
||||
argument: Argument?): Int {
|
||||
return VimPlugin.getSearch().searchWord(editor, caret, count, true, -1)
|
||||
return VimPlugin.getSearch().searchWord(editor, caret, count, true, Direction.BACKWARDS)
|
||||
}
|
||||
|
||||
override val motionType: MotionType = MotionType.EXCLUSIVE
|
||||
|
@@ -25,6 +25,7 @@ import com.maddyhome.idea.vim.command.Argument
|
||||
import com.maddyhome.idea.vim.command.CommandFlags
|
||||
import com.maddyhome.idea.vim.command.MotionType
|
||||
import com.maddyhome.idea.vim.handler.MotionActionHandler
|
||||
import com.maddyhome.idea.vim.helper.Direction
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
@@ -37,7 +38,7 @@ class SearchWholeWordForwardAction : MotionActionHandler.ForEachCaret() {
|
||||
count: Int,
|
||||
rawCount: Int,
|
||||
argument: Argument?): Int {
|
||||
return VimPlugin.getSearch().searchWord(editor, caret, count, true, 1)
|
||||
return VimPlugin.getSearch().searchWord(editor, caret, count, true, Direction.FORWARDS)
|
||||
}
|
||||
|
||||
override val motionType: MotionType = MotionType.EXCLUSIVE
|
||||
|
@@ -25,6 +25,7 @@ import com.maddyhome.idea.vim.command.Argument
|
||||
import com.maddyhome.idea.vim.command.CommandFlags
|
||||
import com.maddyhome.idea.vim.command.MotionType
|
||||
import com.maddyhome.idea.vim.handler.MotionActionHandler
|
||||
import com.maddyhome.idea.vim.helper.Direction
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
@@ -37,7 +38,7 @@ class SearchWordBackwardAction : MotionActionHandler.ForEachCaret() {
|
||||
count: Int,
|
||||
rawCount: Int,
|
||||
argument: Argument?): Int {
|
||||
return VimPlugin.getSearch().searchWord(editor, caret, count, false, -1)
|
||||
return VimPlugin.getSearch().searchWord(editor, caret, count, false, Direction.BACKWARDS)
|
||||
}
|
||||
|
||||
override val motionType: MotionType = MotionType.EXCLUSIVE
|
||||
|
@@ -25,6 +25,7 @@ import com.maddyhome.idea.vim.command.Argument
|
||||
import com.maddyhome.idea.vim.command.CommandFlags
|
||||
import com.maddyhome.idea.vim.command.MotionType
|
||||
import com.maddyhome.idea.vim.handler.MotionActionHandler
|
||||
import com.maddyhome.idea.vim.helper.Direction
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
@@ -37,7 +38,7 @@ class SearchWordForwardAction : MotionActionHandler.ForEachCaret() {
|
||||
count: Int,
|
||||
rawCount: Int,
|
||||
argument: Argument?): Int {
|
||||
return VimPlugin.getSearch().searchWord(editor, caret, count, false, 1)
|
||||
return VimPlugin.getSearch().searchWord(editor, caret, count, false, Direction.FORWARDS)
|
||||
}
|
||||
|
||||
override val motionType: MotionType = MotionType.EXCLUSIVE
|
||||
|
@@ -23,10 +23,10 @@ import com.intellij.openapi.editor.Editor
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.CommandState
|
||||
import com.maddyhome.idea.vim.helper.moveToInlayAwareOffset
|
||||
import com.maddyhome.idea.vim.group.visual.vimSetSystemSelectionSilently
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import com.maddyhome.idea.vim.helper.EditorHelper
|
||||
import com.maddyhome.idea.vim.helper.moveToInlayAwareOffset
|
||||
import com.maddyhome.idea.vim.helper.vimLastColumn
|
||||
|
||||
/**
|
||||
|
@@ -23,10 +23,10 @@ import com.intellij.openapi.editor.Editor
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.CommandState
|
||||
import com.maddyhome.idea.vim.helper.moveToInlayAwareOffset
|
||||
import com.maddyhome.idea.vim.group.visual.vimSetSystemSelectionSilently
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import com.maddyhome.idea.vim.helper.EditorHelper
|
||||
import com.maddyhome.idea.vim.helper.moveToInlayAwareOffset
|
||||
import com.maddyhome.idea.vim.helper.vimLastColumn
|
||||
|
||||
/**
|
||||
|
@@ -23,10 +23,10 @@ import com.intellij.openapi.editor.Editor
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.CommandState
|
||||
import com.maddyhome.idea.vim.helper.moveToInlayAwareOffset
|
||||
import com.maddyhome.idea.vim.group.visual.updateCaretState
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import com.maddyhome.idea.vim.helper.commandState
|
||||
import com.maddyhome.idea.vim.helper.moveToInlayAwareOffset
|
||||
|
||||
/**
|
||||
* @author Alex Plate
|
||||
|
@@ -42,12 +42,12 @@ class SelectMotionLeftAction : MotionActionHandler.ForEachCaret() {
|
||||
override fun getOffset(editor: Editor, caret: Caret, context: DataContext, count: Int, rawCount: Int, argument: Argument?): Int {
|
||||
val keymodel = OptionsManager.keymodel
|
||||
if (KeyModelOptionData.stopsel in keymodel || KeyModelOptionData.stopselect in keymodel) {
|
||||
logger.info("Keymodel option has stopselect. Exiting select mode")
|
||||
logger.debug("Keymodel option has stopselect. Exiting select mode")
|
||||
val startSelection = caret.selectionStart
|
||||
val endSelection = caret.selectionEnd
|
||||
editor.exitSelectMode(false)
|
||||
if (editor.isTemplateActive()) {
|
||||
logger.info("Template is active. Activate insert mode")
|
||||
logger.debug("Template is active. Activate insert mode")
|
||||
VimPlugin.getChange().insertBeforeCursor(editor, context)
|
||||
if (caret.offset in startSelection..endSelection) {
|
||||
return startSelection
|
||||
|
@@ -42,12 +42,12 @@ class SelectMotionRightAction : MotionActionHandler.ForEachCaret() {
|
||||
override fun getOffset(editor: Editor, caret: Caret, context: DataContext, count: Int, rawCount: Int, argument: Argument?): Int {
|
||||
val keymodel = OptionsManager.keymodel
|
||||
if (KeyModelOptionData.stopsel in keymodel || KeyModelOptionData.stopselect in keymodel) {
|
||||
logger.info("Keymodel option has stopselect. Exiting select mode")
|
||||
logger.debug("Keymodel option has stopselect. Exiting select mode")
|
||||
val startSelection = caret.selectionStart
|
||||
val endSelection = caret.selectionEnd
|
||||
editor.exitSelectMode(false)
|
||||
if (editor.isTemplateActive()) {
|
||||
logger.info("Template is active. Activate insert mode")
|
||||
logger.debug("Template is active. Activate insert mode")
|
||||
VimPlugin.getChange().insertBeforeCursor(editor, context)
|
||||
if (caret.offset in startSelection..endSelection) {
|
||||
return endSelection
|
||||
|
@@ -51,9 +51,7 @@ class MotionWordLeftInsertAction : MotionActionHandler.ForEachCaret(), Complicat
|
||||
|
||||
override val keyStrokesSet: Set<List<KeyStroke>> = setOf(
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, KeyEvent.CTRL_DOWN_MASK)),
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_KP_LEFT, KeyEvent.CTRL_DOWN_MASK)),
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, KeyEvent.SHIFT_DOWN_MASK)),
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_KP_LEFT, KeyEvent.SHIFT_DOWN_MASK))
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_KP_LEFT, KeyEvent.CTRL_DOWN_MASK))
|
||||
)
|
||||
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_SAVE_STROKE)
|
||||
|
@@ -51,9 +51,7 @@ class MotionWordRightInsertAction : MotionActionHandler.ForEachCaret(), Complica
|
||||
|
||||
override val keyStrokesSet: Set<List<KeyStroke>> = setOf(
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.CTRL_DOWN_MASK)),
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_KP_RIGHT, KeyEvent.CTRL_DOWN_MASK)),
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.SHIFT_DOWN_MASK)),
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_KP_RIGHT, KeyEvent.SHIFT_DOWN_MASK))
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_KP_RIGHT, KeyEvent.CTRL_DOWN_MASK))
|
||||
)
|
||||
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_SAVE_STROKE)
|
||||
|
@@ -19,10 +19,14 @@ package com.maddyhome.idea.vim.action.motion.visual
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.group.MotionGroup
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import com.maddyhome.idea.vim.helper.EditorHelper
|
||||
import com.maddyhome.idea.vim.helper.exitVisualMode
|
||||
import com.maddyhome.idea.vim.helper.getTopLevelEditor
|
||||
import com.maddyhome.idea.vim.helper.vimForEachCaret
|
||||
|
||||
/**
|
||||
* @author vlan
|
||||
@@ -32,6 +36,16 @@ class VisualExitModeAction : VimActionHandler.SingleExecution() {
|
||||
|
||||
override fun execute(editor: Editor, context: DataContext, cmd: Command): Boolean {
|
||||
editor.getTopLevelEditor().exitVisualMode()
|
||||
|
||||
// Should it be in [exitVisualMode]?
|
||||
editor.vimForEachCaret { caret ->
|
||||
val lineEnd = EditorHelper.getLineEndForOffset(editor, caret.offset)
|
||||
if (lineEnd == caret.offset) {
|
||||
val position = VimPlugin.getMotion().getOffsetOfHorizontalMotion(editor, caret, -1, false)
|
||||
MotionGroup.moveCaret(editor, caret, position)
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,9 @@
|
||||
package com.maddyhome.idea.vim.command
|
||||
|
||||
import com.maddyhome.idea.vim.action.DuplicableOperatorAction
|
||||
import com.maddyhome.idea.vim.action.ResetModeAction
|
||||
import com.maddyhome.idea.vim.action.change.insert.InsertCompletedDigraphAction
|
||||
import com.maddyhome.idea.vim.action.change.insert.InsertCompletedLiteralAction
|
||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase
|
||||
import com.maddyhome.idea.vim.key.CommandPartNode
|
||||
import com.maddyhome.idea.vim.key.Node
|
||||
@@ -24,6 +27,9 @@ class CommandBuilder(private var currentCommandPartNode: CommandPartNode) {
|
||||
var expectedArgumentType: Argument.Type? = null
|
||||
private set
|
||||
|
||||
var prevExpectedArgumentType: Argument.Type? = null
|
||||
private set
|
||||
|
||||
val isReady get() = commandState == CurrentCommandState.READY
|
||||
val isBad get() = commandState == CurrentCommandState.BAD_COMMAND
|
||||
val isEmpty get() = commandParts.isEmpty()
|
||||
@@ -38,6 +44,7 @@ class CommandBuilder(private var currentCommandPartNode: CommandPartNode) {
|
||||
|
||||
fun pushCommandPart(action: EditorActionHandlerBase) {
|
||||
commandParts.add(Command(count, action, action.type, action.flags))
|
||||
prevExpectedArgumentType = expectedArgumentType
|
||||
expectedArgumentType = action.argumentType
|
||||
count = 0
|
||||
}
|
||||
@@ -106,6 +113,14 @@ class CommandBuilder(private var currentCommandPartNode: CommandPartNode) {
|
||||
return currentCommandPartNode !is RootNode
|
||||
}
|
||||
|
||||
fun isPuttingLiteral(): Boolean {
|
||||
return !commandParts.isEmpty() && commandParts.last.action is InsertCompletedLiteralAction
|
||||
}
|
||||
|
||||
fun isDone(): Boolean {
|
||||
return commandParts.isEmpty()
|
||||
}
|
||||
|
||||
fun completeCommandPart(argument: Argument) {
|
||||
commandParts.peekLast().argument = argument
|
||||
commandState = CurrentCommandState.READY
|
||||
@@ -121,6 +136,11 @@ class CommandBuilder(private var currentCommandPartNode: CommandPartNode) {
|
||||
}
|
||||
|
||||
fun buildCommand(): Command {
|
||||
if (commandParts.last.action is InsertCompletedDigraphAction || commandParts.last.action is ResetModeAction) {
|
||||
expectedArgumentType = prevExpectedArgumentType
|
||||
prevExpectedArgumentType = null
|
||||
return commandParts.removeLast()
|
||||
}
|
||||
|
||||
var command: Command = commandParts.removeFirst()
|
||||
while (commandParts.size > 0) {
|
||||
@@ -147,6 +167,7 @@ class CommandBuilder(private var currentCommandPartNode: CommandPartNode) {
|
||||
commandParts.clear()
|
||||
keyList.clear()
|
||||
expectedArgumentType = null
|
||||
prevExpectedArgumentType = null
|
||||
}
|
||||
|
||||
fun resetInProgressCommandPart(commandPartNode: CommandPartNode) {
|
||||
|
@@ -23,6 +23,8 @@ import com.intellij.openapi.editor.Editor
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.helper.DigraphResult
|
||||
import com.maddyhome.idea.vim.helper.DigraphSequence
|
||||
import com.maddyhome.idea.vim.helper.MessageHelper
|
||||
import com.maddyhome.idea.vim.helper.VimNlsSafe
|
||||
import com.maddyhome.idea.vim.helper.noneOfEnum
|
||||
import com.maddyhome.idea.vim.helper.vimCommandState
|
||||
import com.maddyhome.idea.vim.key.CommandPartNode
|
||||
@@ -75,7 +77,7 @@ class CommandState private constructor() {
|
||||
|
||||
fun pushModes(mode: Mode, submode: SubMode) {
|
||||
val newModeState = ModeState(mode, submode)
|
||||
logger.info("Push new mode state: ${newModeState.toSimpleString()}")
|
||||
logger.debug("Push new mode state: ${newModeState.toSimpleString()}")
|
||||
logger.debug { "Stack of mode states before push: ${toSimpleString()}" }
|
||||
modeStates.push(newModeState)
|
||||
setMappingMode()
|
||||
@@ -86,7 +88,7 @@ class CommandState private constructor() {
|
||||
val popped = modeStates.pop()
|
||||
setMappingMode()
|
||||
updateStatus()
|
||||
logger.info("Popped mode state: ${popped.toSimpleString()}")
|
||||
logger.debug("Popped mode state: ${popped.toSimpleString()}")
|
||||
logger.debug { "Stack of mode states after pop: ${toSimpleString()}" }
|
||||
}
|
||||
|
||||
@@ -178,7 +180,7 @@ class CommandState private constructor() {
|
||||
executingCommand = null
|
||||
resetModes()
|
||||
commandBuilder.resetInProgressCommandPart(getKeyRootNode(mappingState.mappingMode))
|
||||
startDigraphSequence()
|
||||
digraphSequence.reset()
|
||||
updateStatus()
|
||||
}
|
||||
|
||||
@@ -232,6 +234,7 @@ class CommandState private constructor() {
|
||||
* be added. It's better not to compare the whole string but only
|
||||
* the leading character(s).
|
||||
*/
|
||||
@VimNlsSafe
|
||||
fun toVimNotation(): String {
|
||||
return when (mode) {
|
||||
Mode.COMMAND -> "n"
|
||||
@@ -266,7 +269,7 @@ class CommandState private constructor() {
|
||||
if (msg.isNotEmpty()) {
|
||||
msg.append(" - ")
|
||||
}
|
||||
msg.append("recording")
|
||||
msg.append(MessageHelper.message("show.mode.recording"))
|
||||
}
|
||||
VimPlugin.showMode(msg.toString())
|
||||
}
|
||||
|
@@ -19,6 +19,8 @@
|
||||
package com.maddyhome.idea.vim.common
|
||||
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.helper.MessageHelper
|
||||
import org.jetbrains.annotations.NonNls
|
||||
|
||||
/**
|
||||
* @author Elliot Courant
|
||||
@@ -39,10 +41,10 @@ class Alias(
|
||||
}
|
||||
|
||||
private companion object {
|
||||
const val LessThan = "<lt>"
|
||||
const val Count = "<count>"
|
||||
const val Arguments = "<args>"
|
||||
const val QuotedArguments = "<q-args>"
|
||||
@NonNls const val LessThan = "<lt>"
|
||||
@NonNls const val Count = "<count>"
|
||||
@NonNls const val Arguments = "<args>"
|
||||
@NonNls const val QuotedArguments = "<q-args>"
|
||||
}
|
||||
|
||||
fun getCommand(input: String, count: Int): String {
|
||||
@@ -52,7 +54,7 @@ class Alias(
|
||||
var compiledCommand = this.command
|
||||
val cleanedInput = input.trim().removePrefix(name).trim()
|
||||
if (minimumNumberOfArguments > 0 && cleanedInput.isEmpty()) {
|
||||
VimPlugin.showMessage("E471: Argument required")
|
||||
VimPlugin.showMessage(MessageHelper.message("e471.argument.required"))
|
||||
VimPlugin.indicateError()
|
||||
return ""
|
||||
}
|
||||
|
@@ -22,6 +22,7 @@ import com.intellij.ide.bookmarks.Bookmark
|
||||
import com.intellij.ide.bookmarks.BookmarkManager
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.maddyhome.idea.vim.group.MarkGroup
|
||||
import org.jetbrains.annotations.NonNls
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
interface Mark {
|
||||
@@ -35,7 +36,7 @@ interface Mark {
|
||||
fun clear()
|
||||
|
||||
object KeySorter : Comparator<Mark> {
|
||||
private const val ORDER = "'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\"[]^.<>"
|
||||
@NonNls private const val ORDER = "'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\"[]^.<>"
|
||||
|
||||
override fun compare(o1: Mark, o2: Mark): Int {
|
||||
return ORDER.indexOf(o1.key) - ORDER.indexOf(o2.key)
|
||||
|
@@ -20,8 +20,8 @@ package com.maddyhome.idea.vim.common
|
||||
import com.intellij.codeInsight.editorActions.TextBlockTransferableData
|
||||
import com.maddyhome.idea.vim.command.SelectionType
|
||||
import com.maddyhome.idea.vim.helper.StringHelper
|
||||
import org.jetbrains.annotations.NonNls
|
||||
import java.awt.event.KeyEvent
|
||||
import java.util.*
|
||||
import javax.swing.KeyStroke
|
||||
|
||||
class Register {
|
||||
@@ -81,7 +81,7 @@ class Register {
|
||||
}
|
||||
|
||||
object KeySorter : Comparator<Register> {
|
||||
private const val ORDER = "\"0123456789abcdefghijklmnopqrstuvwxyz-*+.:%#/="
|
||||
@NonNls private const val ORDER = "\"0123456789abcdefghijklmnopqrstuvwxyz-*+.:%#/="
|
||||
|
||||
override fun compare(o1: Register, o2: Register): Int {
|
||||
return ORDER.indexOf(o1.name.toLowerCase()) - ORDER.indexOf(o2.name.toLowerCase())
|
||||
|
@@ -18,6 +18,7 @@
|
||||
package com.maddyhome.idea.vim.common
|
||||
|
||||
import org.jetbrains.annotations.Contract
|
||||
import org.jetbrains.annotations.NonNls
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
|
||||
@@ -85,7 +86,7 @@ class TextRange(val startOffsets: IntArray, val endOffsets: IntArray) {
|
||||
operator fun contains(offset: Int): Boolean = if (isMultiple) false else offset in startOffset until endOffset
|
||||
|
||||
override fun toString(): String {
|
||||
val sb = StringBuilder()
|
||||
@NonNls val sb = StringBuilder()
|
||||
sb.append("TextRange")
|
||||
sb.append("{starts=")
|
||||
|
||||
|
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2020 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.maddyhome.idea.vim.config
|
||||
|
||||
import com.intellij.openapi.components.PersistentStateComponent
|
||||
import com.intellij.openapi.components.RoamingType
|
||||
import com.intellij.openapi.components.ServiceManager
|
||||
import com.intellij.openapi.components.State
|
||||
import com.intellij.openapi.components.Storage
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import org.jdom.Element
|
||||
|
||||
/**
|
||||
* @author Alex Plate
|
||||
*/
|
||||
|
||||
@State(name = "VimLocalSettings", storages = [
|
||||
Storage("\$APP_CONFIG$$/vim_local_settings.xml", roamingType = RoamingType.DISABLED, deprecated = true),
|
||||
Storage("\$APP_CONFIG$/vim_local_settings.xml", roamingType = RoamingType.DISABLED, deprecated = true)
|
||||
])
|
||||
@Deprecated("The data from this class will be stored in vim_settings")
|
||||
class VimLocalConfig : PersistentStateComponent<Element> {
|
||||
override fun getState(): Element? = null
|
||||
|
||||
override fun loadState(state: Element) {
|
||||
// This is initialization of state from the legacy configuration structure.
|
||||
// This code should be performed only once on settings migration.
|
||||
// After the migration is done, the file with settings gets removed and this method won't be called again.
|
||||
VimPlugin.getMark().readData(state)
|
||||
VimPlugin.getRegister().readData(state)
|
||||
VimPlugin.getSearch().readData(state)
|
||||
VimPlugin.getHistory().readData(state)
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun initialize() {
|
||||
@Suppress("DEPRECATION")
|
||||
ServiceManager.getService(VimLocalConfig::class.java)
|
||||
}
|
||||
}
|
||||
}
|
@@ -60,7 +60,7 @@ class MigrationComponents(
|
||||
@Service
|
||||
class ApplicationConfigurationMigrator(migrationComponents: MigrationComponents) {
|
||||
|
||||
@Suppress("unused")
|
||||
@Suppress("unused", "HardCodedStringLiteral")
|
||||
constructor() : this(productionMigrationComponents)
|
||||
|
||||
private val migrators = migrationComponents.groupedMigrators
|
||||
|
@@ -21,6 +21,7 @@
|
||||
package com.maddyhome.idea.vim.config.migration
|
||||
|
||||
import com.intellij.openapi.application.PathManager
|
||||
import org.jetbrains.annotations.NonNls
|
||||
|
||||
interface VersionDetector {
|
||||
fun extractVersion(): Int?
|
||||
@@ -28,7 +29,7 @@ interface VersionDetector {
|
||||
|
||||
object `Detect versions 3, 4, 5, 6` : VersionDetector {
|
||||
|
||||
val pattern = "state version=\"(.)\"".toRegex()
|
||||
@NonNls val pattern = "state version=\"(.)\"".toRegex()
|
||||
|
||||
override fun extractVersion(): Int? {
|
||||
val configFile = PathManager.getOptionsFile("vim_settings")
|
||||
|
@@ -121,31 +121,8 @@ sealed class CommandHandler {
|
||||
@Throws(ExException::class)
|
||||
fun process(editor: Editor, context: DataContext, cmd: ExCommand, count: Int): Boolean {
|
||||
|
||||
// No range allowed
|
||||
if (RangeFlag.RANGE_FORBIDDEN == argFlags.rangeFlag && cmd.ranges.size() != 0) {
|
||||
VimPlugin.showMessage(MessageHelper.message(Msg.e_norange))
|
||||
throw NoRangeAllowedException()
|
||||
}
|
||||
checkArgs(cmd)
|
||||
|
||||
if (RangeFlag.RANGE_REQUIRED == argFlags.rangeFlag && cmd.ranges.size() == 0) {
|
||||
VimPlugin.showMessage(MessageHelper.message(Msg.e_rangereq))
|
||||
throw MissingRangeException()
|
||||
}
|
||||
|
||||
if (RangeFlag.RANGE_IS_COUNT == argFlags.rangeFlag) {
|
||||
cmd.ranges.setDefaultLine(1)
|
||||
}
|
||||
|
||||
// Argument required
|
||||
if (ArgumentFlag.ARGUMENT_REQUIRED == argFlags.argumentFlag && cmd.argument.isEmpty()) {
|
||||
VimPlugin.showMessage(MessageHelper.message(Msg.e_argreq))
|
||||
throw MissingArgumentException()
|
||||
}
|
||||
|
||||
if (ArgumentFlag.ARGUMENT_FORBIDDEN == argFlags.argumentFlag && cmd.argument.isNotEmpty()) {
|
||||
VimPlugin.showMessage(MessageHelper.message(Msg.e_argforb))
|
||||
throw NoArgumentAllowedException()
|
||||
}
|
||||
if (editor.inVisualMode && Flag.SAVE_VISUAL !in argFlags.flags) {
|
||||
editor.exitVisualMode()
|
||||
}
|
||||
@@ -179,6 +156,34 @@ sealed class CommandHandler {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkArgs(cmd: ExCommand) {
|
||||
// No range allowed
|
||||
if (RangeFlag.RANGE_FORBIDDEN == argFlags.rangeFlag && cmd.ranges.size() != 0) {
|
||||
VimPlugin.showMessage(MessageHelper.message(Msg.e_norange))
|
||||
throw NoRangeAllowedException()
|
||||
}
|
||||
|
||||
if (RangeFlag.RANGE_REQUIRED == argFlags.rangeFlag && cmd.ranges.size() == 0) {
|
||||
VimPlugin.showMessage(MessageHelper.message(Msg.e_rangereq))
|
||||
throw MissingRangeException()
|
||||
}
|
||||
|
||||
if (RangeFlag.RANGE_IS_COUNT == argFlags.rangeFlag) {
|
||||
cmd.ranges.setDefaultLine(1)
|
||||
}
|
||||
|
||||
// Argument required
|
||||
if (ArgumentFlag.ARGUMENT_REQUIRED == argFlags.argumentFlag && cmd.argument.isEmpty()) {
|
||||
VimPlugin.showMessage(MessageHelper.message(Msg.e_argreq))
|
||||
throw MissingArgumentException()
|
||||
}
|
||||
|
||||
if (ArgumentFlag.ARGUMENT_FORBIDDEN == argFlags.argumentFlag && cmd.argument.isNotEmpty()) {
|
||||
VimPlugin.showMessage(MessageHelper.message(Msg.e_argforb))
|
||||
throw NoArgumentAllowedException()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
data class CommandHandlerFlags(
|
||||
|
@@ -18,8 +18,6 @@
|
||||
|
||||
package com.maddyhome.idea.vim.ex
|
||||
|
||||
import java.util.*
|
||||
|
||||
class CommandNode(command: ExBeanClass? = null) {
|
||||
|
||||
var commandHandler: ExBeanClass? = command
|
||||
|
@@ -26,11 +26,11 @@ import com.intellij.openapi.util.ThrowableComputable;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.SelectionType;
|
||||
import com.maddyhome.idea.vim.common.Register;
|
||||
import com.maddyhome.idea.vim.common.TextRange;
|
||||
import com.maddyhome.idea.vim.ex.handler.GotoLineHandler;
|
||||
import com.maddyhome.idea.vim.ex.ranges.Range;
|
||||
import com.maddyhome.idea.vim.ex.ranges.Ranges;
|
||||
import com.maddyhome.idea.vim.group.HistoryGroup;
|
||||
import com.maddyhome.idea.vim.group.RegisterGroup;
|
||||
import com.maddyhome.idea.vim.helper.MessageHelper;
|
||||
import com.maddyhome.idea.vim.helper.Msg;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -126,7 +126,6 @@ public class CommandParser {
|
||||
private void processCommand(@NotNull Editor editor, @NotNull DataContext context, @NotNull String cmd,
|
||||
int count, int aliasCountdown) throws ExException {
|
||||
// Nothing entered
|
||||
int result = 0;
|
||||
if (cmd.length() == 0) {
|
||||
logger.warn("CMD is empty");
|
||||
return;
|
||||
@@ -151,7 +150,7 @@ public class CommandParser {
|
||||
}
|
||||
processCommand(editor, context, commandAlias, count, aliasCountdown - 1);
|
||||
} else {
|
||||
VimPlugin.showMessage("Recursion detected, maximum alias depth reached.");
|
||||
VimPlugin.showMessage(MessageHelper.message("recursion.detected.maximum.alias.depth.reached"));
|
||||
VimPlugin.indicateError();
|
||||
logger.warn("Recursion detected, maximum alias depth reached. ");
|
||||
}
|
||||
@@ -178,8 +177,7 @@ public class CommandParser {
|
||||
ThrowableComputable<Object, ExException> runCommand = () -> {
|
||||
boolean ok = handler.process(editor, context, command, count);
|
||||
if (ok && !handler.getArgFlags().getFlags().contains(CommandHandler.Flag.DONT_SAVE_LAST)) {
|
||||
VimPlugin.getRegister().storeTextInternal(editor, new TextRange(-1, -1), cmd,
|
||||
SelectionType.CHARACTER_WISE, ':', false);
|
||||
VimPlugin.getRegister().storeTextSpecial(RegisterGroup.LAST_COMMAND_REGISTER, cmd);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
@@ -308,6 +306,10 @@ public class CommandParser {
|
||||
state = State.RANGE_SHORT_PATTERN;
|
||||
reprocess = false;
|
||||
}
|
||||
else if (ch == ',') {
|
||||
location.append('.');
|
||||
state = State.RANGE_MAYBE_DONE;
|
||||
}
|
||||
else if (ch == '/' || ch == '?') {
|
||||
location.append(ch);
|
||||
patternType = ch;
|
||||
@@ -326,13 +328,12 @@ public class CommandParser {
|
||||
if (ch == '/' || ch == '?' || ch == '&') {
|
||||
location.append(ch);
|
||||
state = State.RANGE_PATTERN_MAYBE_DONE;
|
||||
reprocess = false;
|
||||
}
|
||||
else {
|
||||
error = MessageHelper.message(Msg.e_backslash);
|
||||
state = State.ERROR;
|
||||
reprocess = false;
|
||||
}
|
||||
reprocess = false;
|
||||
break;
|
||||
case RANGE_PATTERN: // Reading a pattern range
|
||||
// No trailing / or ? required if there is no command so look for newline to tell us we are done
|
||||
|
@@ -33,6 +33,7 @@ import com.maddyhome.idea.vim.ex.CommandHandler.RangeFlag.RANGE_OPTIONAL
|
||||
import com.maddyhome.idea.vim.ex.CommandHandlerFlags
|
||||
import com.maddyhome.idea.vim.ex.ExCommand
|
||||
import com.maddyhome.idea.vim.ex.flags
|
||||
import com.maddyhome.idea.vim.helper.MessageHelper
|
||||
import com.maddyhome.idea.vim.helper.runAfterGotFocus
|
||||
|
||||
/**
|
||||
@@ -45,7 +46,7 @@ class ActionHandler : CommandHandler.SingleExecution() {
|
||||
override fun execute(editor: Editor, context: DataContext, cmd: ExCommand): Boolean {
|
||||
val actionName = cmd.argument.trim()
|
||||
val action = ActionManager.getInstance().getAction(actionName) ?: run {
|
||||
VimPlugin.showMessage("Action not found: $actionName")
|
||||
VimPlugin.showMessage(MessageHelper.message("action.not.found.0", actionName))
|
||||
return false
|
||||
}
|
||||
val application = ApplicationManager.getApplication()
|
||||
|
@@ -30,6 +30,7 @@ import com.maddyhome.idea.vim.ex.CommandHandlerFlags
|
||||
import com.maddyhome.idea.vim.ex.ExCommand
|
||||
import com.maddyhome.idea.vim.ex.ExOutputModel
|
||||
import com.maddyhome.idea.vim.ex.flags
|
||||
import com.maddyhome.idea.vim.helper.MessageHelper
|
||||
import com.maddyhome.idea.vim.helper.StringHelper
|
||||
|
||||
/**
|
||||
@@ -55,7 +56,7 @@ class ActionListHandler : CommandHandler.SingleExecution() {
|
||||
.joinToString(lineSeparator)
|
||||
|
||||
|
||||
ExOutputModel.getInstance(editor).output("--- Actions ---$lineSeparator$actions")
|
||||
ExOutputModel.getInstance(editor).output(MessageHelper.message("ex.show.all.actions.0.1", lineSeparator, actions))
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
@@ -27,6 +27,7 @@ import com.maddyhome.idea.vim.ex.CommandHandler
|
||||
import com.maddyhome.idea.vim.ex.ExCommand
|
||||
import com.maddyhome.idea.vim.ex.flags
|
||||
import com.maddyhome.idea.vim.helper.EditorHelper
|
||||
import com.maddyhome.idea.vim.helper.MessageHelper
|
||||
|
||||
/**
|
||||
* Handles buffer, buf, bu, b.
|
||||
@@ -47,7 +48,7 @@ class BufferHandler : CommandHandler.SingleExecution() {
|
||||
val bufNum = buffer.toInt() - 1
|
||||
|
||||
if (!VimPlugin.getFile().selectFile(bufNum, context)) {
|
||||
VimPlugin.showMessage("Buffer $bufNum does not exist")
|
||||
VimPlugin.showMessage(MessageHelper.message("buffer.0.does.not.exist", bufNum))
|
||||
result = false
|
||||
}
|
||||
} else {
|
||||
@@ -55,12 +56,12 @@ class BufferHandler : CommandHandler.SingleExecution() {
|
||||
|
||||
when(editors.size) {
|
||||
0 -> {
|
||||
VimPlugin.showMessage("No matching buffer for $buffer")
|
||||
VimPlugin.showMessage(MessageHelper.message("no.matching.buffer.for.0", buffer))
|
||||
result = false
|
||||
}
|
||||
1 -> {
|
||||
if (EditorHelper.hasUnsavedChanges(editor) && !overrideModified) {
|
||||
VimPlugin.showMessage("No write since last change (add ! to override)")
|
||||
VimPlugin.showMessage(MessageHelper.message("no.write.since.last.change.add.to.override"))
|
||||
result = false
|
||||
}
|
||||
else {
|
||||
@@ -68,7 +69,7 @@ class BufferHandler : CommandHandler.SingleExecution() {
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
VimPlugin.showMessage("More than one match for $buffer")
|
||||
VimPlugin.showMessage(MessageHelper.message("more.than.one.match.for.0", buffer))
|
||||
result = false
|
||||
}
|
||||
}
|
||||
|
@@ -31,6 +31,7 @@ import com.maddyhome.idea.vim.ex.ExCommand
|
||||
import com.maddyhome.idea.vim.ex.ExOutputModel
|
||||
import com.maddyhome.idea.vim.ex.flags
|
||||
import com.maddyhome.idea.vim.helper.EditorHelper
|
||||
import org.jetbrains.annotations.NonNls
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
@@ -115,7 +116,7 @@ class BufferListHandler : CommandHandler.SingleExecution() {
|
||||
}
|
||||
|
||||
private fun getBufferStatus(editor: Editor, file: VirtualFile, currentFile: VirtualFile, previousFile: VirtualFile?): String {
|
||||
val bufStatus = StringBuilder()
|
||||
@NonNls val bufStatus = StringBuilder()
|
||||
|
||||
when(file) {
|
||||
currentFile -> bufStatus.append("%a ")
|
||||
|
@@ -34,7 +34,7 @@ import java.io.IOException
|
||||
class CmdFilterHandler : CommandHandler.SingleExecution() {
|
||||
override val argFlags = flags(RangeFlag.RANGE_OPTIONAL, ArgumentFlag.ARGUMENT_OPTIONAL, Access.WRITABLE)
|
||||
override fun execute(editor: Editor, context: DataContext, cmd: ExCommand): Boolean {
|
||||
logger.info("execute")
|
||||
logger.debug("execute")
|
||||
|
||||
var command = cmd.argument
|
||||
if (command.isEmpty()) {
|
||||
|
@@ -32,6 +32,8 @@ import com.maddyhome.idea.vim.ex.ExOutputModel
|
||||
import com.maddyhome.idea.vim.ex.flags
|
||||
import com.maddyhome.idea.vim.ex.vimscript.VimScriptCommandHandler
|
||||
import com.maddyhome.idea.vim.group.CommandGroup.Companion.BLACKLISTED_ALIASES
|
||||
import com.maddyhome.idea.vim.helper.MessageHelper
|
||||
import org.jetbrains.annotations.NonNls
|
||||
|
||||
/**
|
||||
* @author Elliot Courant
|
||||
@@ -42,16 +44,13 @@ class CmdHandler : CommandHandler.SingleExecution(), VimScriptCommandHandler {
|
||||
// Static definitions needed for aliases.
|
||||
private companion object {
|
||||
const val overridePrefix = "!"
|
||||
const val argsPrefix = "-nargs"
|
||||
|
||||
// [VERSION UPDATE] 203+ Annotation should be replaced with @NlsSafe
|
||||
@NonNls const val argsPrefix = "-nargs"
|
||||
|
||||
const val anyNumberOfArguments = "*"
|
||||
const val zeroOrOneArguments = "?"
|
||||
const val moreThanZeroArguments = "+"
|
||||
|
||||
const val errorInvalidNumberOfArguments = "E176: Invalid number of arguments"
|
||||
const val errorCannotStartWithLowercase = "E183: User defined commands must start with an uppercase letter"
|
||||
const val errorReservedName = "E841: Reserved name, cannot be used for user defined command"
|
||||
const val errorCommandAlreadyExists = "E174: Command already exists: add ! to replace it"
|
||||
}
|
||||
|
||||
override fun execute(cmd: ExCommand) {
|
||||
@@ -95,7 +94,7 @@ class CmdHandler : CommandHandler.SingleExecution(), VimScriptCommandHandler {
|
||||
// in the actual alias being created, and we don't want to parse that one.
|
||||
val trimmedInput = argument.takeWhile { it != ' ' }
|
||||
val pattern = Regex("(?>-nargs=((|[-])\\d+|[?]|[+]|[*]))").find(trimmedInput) ?: run {
|
||||
VimPlugin.showMessage(errorInvalidNumberOfArguments)
|
||||
VimPlugin.showMessage(MessageHelper.message("e176.invalid.number.of.arguments"))
|
||||
return false
|
||||
}
|
||||
val nargForTrim = pattern.groupValues[0]
|
||||
@@ -118,7 +117,7 @@ class CmdHandler : CommandHandler.SingleExecution(), VimScriptCommandHandler {
|
||||
// I missed something, since the regex limits the value to be ? + * or
|
||||
// a valid number, its not possible (as far as I know) to have another value
|
||||
// that regex would accept that is not valid.
|
||||
VimPlugin.showMessage(errorInvalidNumberOfArguments)
|
||||
VimPlugin.showMessage(MessageHelper.message("e176.invalid.number.of.arguments"))
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -126,7 +125,7 @@ class CmdHandler : CommandHandler.SingleExecution(), VimScriptCommandHandler {
|
||||
// Not sure why this isn't documented, but if you try to create a command in vim
|
||||
// with an explicit number of arguments greater than 1 it returns this error.
|
||||
if (argNum > 1 || argNum < 0) {
|
||||
VimPlugin.showMessage(errorInvalidNumberOfArguments)
|
||||
VimPlugin.showMessage(MessageHelper.message("e176.invalid.number.of.arguments"))
|
||||
return false
|
||||
}
|
||||
minNumberOfArgs = argNum
|
||||
@@ -148,12 +147,12 @@ class CmdHandler : CommandHandler.SingleExecution(), VimScriptCommandHandler {
|
||||
|
||||
// User-aliases need to begin with an uppercase character.
|
||||
if (!alias[0].isUpperCase()) {
|
||||
VimPlugin.showMessage(errorCannotStartWithLowercase)
|
||||
VimPlugin.showMessage(MessageHelper.message("e183.user.defined.commands.must.start.with.an.uppercase.letter"))
|
||||
return false
|
||||
}
|
||||
|
||||
if (alias in BLACKLISTED_ALIASES) {
|
||||
VimPlugin.showMessage(errorReservedName)
|
||||
VimPlugin.showMessage(MessageHelper.message("e841.reserved.name.cannot.be.used.for.user.defined.command"))
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -169,7 +168,7 @@ class CmdHandler : CommandHandler.SingleExecution(), VimScriptCommandHandler {
|
||||
// If we are not over-writing existing aliases, and an alias with the same command
|
||||
// already exists then we want to do nothing.
|
||||
if (!overrideAlias && VimPlugin.getCommand().hasAlias(alias)) {
|
||||
VimPlugin.showMessage(errorCommandAlreadyExists)
|
||||
VimPlugin.showMessage(MessageHelper.message("e174.command.already.exists.add.to.replace.it"))
|
||||
return false
|
||||
}
|
||||
|
||||
|
@@ -24,12 +24,13 @@ import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.ex.CommandHandler
|
||||
import com.maddyhome.idea.vim.ex.ExCommand
|
||||
import com.maddyhome.idea.vim.ex.flags
|
||||
import com.maddyhome.idea.vim.helper.MessageHelper
|
||||
|
||||
class DelCmdHandler : CommandHandler.SingleExecution() {
|
||||
override val argFlags = flags(RangeFlag.RANGE_FORBIDDEN, ArgumentFlag.ARGUMENT_REQUIRED, Access.READ_ONLY)
|
||||
override fun execute(editor: Editor, context: DataContext, cmd: ExCommand): Boolean {
|
||||
if (!VimPlugin.getCommand().hasAlias(cmd.argument)) {
|
||||
VimPlugin.showMessage("E184: No such user-defined command: ${cmd.argument}")
|
||||
VimPlugin.showMessage(MessageHelper.message("e184.no.such.user.defined.command.0", cmd.argument))
|
||||
return false
|
||||
}
|
||||
|
||||
|
@@ -24,6 +24,7 @@ import com.intellij.openapi.editor.Editor
|
||||
import com.maddyhome.idea.vim.ex.CommandHandler
|
||||
import com.maddyhome.idea.vim.ex.ExCommand
|
||||
import com.maddyhome.idea.vim.ex.flags
|
||||
import org.jetbrains.annotations.NonNls
|
||||
import java.io.UnsupportedEncodingException
|
||||
import java.net.URLEncoder
|
||||
|
||||
@@ -37,6 +38,7 @@ class HelpHandler : CommandHandler.SingleExecution() {
|
||||
return true
|
||||
}
|
||||
|
||||
@NonNls
|
||||
private fun helpTopicUrl(topic: String): String {
|
||||
if (topic.isBlank()) return HELP_ROOT_URL
|
||||
|
||||
|
@@ -36,7 +36,6 @@ import com.maddyhome.idea.vim.helper.EditorHelper
|
||||
import com.maddyhome.idea.vim.helper.MessageHelper
|
||||
import com.maddyhome.idea.vim.helper.Msg
|
||||
import com.maddyhome.idea.vim.helper.fileSize
|
||||
import java.util.*
|
||||
import kotlin.math.min
|
||||
|
||||
class MoveTextHandler : CommandHandler.SingleExecution() {
|
||||
|
56
src/com/maddyhome/idea/vim/ex/handler/PlugHandler.kt
Normal file
56
src/com/maddyhome/idea/vim/ex/handler/PlugHandler.kt
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2020 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.maddyhome.idea.vim.ex.handler
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.maddyhome.idea.vim.ex.CommandHandler
|
||||
import com.maddyhome.idea.vim.ex.CommandHandler.Access.READ_ONLY
|
||||
import com.maddyhome.idea.vim.ex.CommandHandler.ArgumentFlag.ARGUMENT_REQUIRED
|
||||
import com.maddyhome.idea.vim.ex.CommandHandler.RangeFlag.RANGE_FORBIDDEN
|
||||
import com.maddyhome.idea.vim.ex.CommandHandlerFlags
|
||||
import com.maddyhome.idea.vim.ex.ExCommand
|
||||
import com.maddyhome.idea.vim.ex.flags
|
||||
import com.maddyhome.idea.vim.ex.vimscript.VimScriptCommandHandler
|
||||
import com.maddyhome.idea.vim.extension.VimExtensionRegistrar
|
||||
|
||||
/**
|
||||
* This handler is created to support `Plug` command from vim-plug and `Plugin` command from vundle.
|
||||
*/
|
||||
class PlugHandler : CommandHandler.SingleExecution(), VimScriptCommandHandler {
|
||||
override val argFlags: CommandHandlerFlags = flags(RANGE_FORBIDDEN, ARGUMENT_REQUIRED, READ_ONLY)
|
||||
|
||||
override fun execute(editor: Editor, context: DataContext, cmd: ExCommand): Boolean = doExecute(cmd)
|
||||
|
||||
override fun execute(cmd: ExCommand) {
|
||||
doExecute(cmd)
|
||||
}
|
||||
|
||||
private fun doExecute(cmd: ExCommand): Boolean {
|
||||
val argument = cmd.argument
|
||||
val firstChar = argument[0]
|
||||
if (firstChar != '"' && firstChar != '\'') return false
|
||||
|
||||
val pluginAlias = argument.drop(1).takeWhile { it != firstChar }
|
||||
val option = VimExtensionRegistrar.getToggleByAlias(pluginAlias) ?: return false
|
||||
option.set()
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
@@ -28,9 +28,8 @@ import com.maddyhome.idea.vim.ex.ExCommand
|
||||
import com.maddyhome.idea.vim.ex.ExException
|
||||
import com.maddyhome.idea.vim.ex.flags
|
||||
import com.maddyhome.idea.vim.ex.ranges.LineRange
|
||||
import com.maddyhome.idea.vim.helper.moveToInlayAwareOffset
|
||||
import com.maddyhome.idea.vim.helper.inBlockSubMode
|
||||
import java.util.*
|
||||
import com.maddyhome.idea.vim.helper.moveToInlayAwareOffset
|
||||
|
||||
/**
|
||||
* @author Alex Selesse
|
||||
|
@@ -24,11 +24,14 @@ import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.ex.CommandHandler
|
||||
import com.maddyhome.idea.vim.ex.ExCommand
|
||||
import com.maddyhome.idea.vim.ex.flags
|
||||
import org.jetbrains.annotations.NonNls
|
||||
|
||||
class SplitHandler : CommandHandler.SingleExecution() {
|
||||
override val argFlags = flags(RangeFlag.RANGE_FORBIDDEN, ArgumentFlag.ARGUMENT_OPTIONAL, Access.READ_ONLY)
|
||||
@NonNls private val visualSplitPrefix = "v"
|
||||
|
||||
override fun execute(editor: Editor, context: DataContext, cmd: ExCommand): Boolean {
|
||||
if (cmd.command.startsWith("v")) {
|
||||
if (cmd.command.startsWith(visualSplitPrefix)) {
|
||||
VimPlugin.getWindow().splitWindowVertical(context, cmd.argument)
|
||||
} else {
|
||||
VimPlugin.getWindow().splitWindowHorizontal(context, cmd.argument)
|
||||
|
@@ -26,6 +26,7 @@ import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.ex.CommandHandler
|
||||
import com.maddyhome.idea.vim.ex.ExCommand
|
||||
import com.maddyhome.idea.vim.ex.flags
|
||||
import com.maddyhome.idea.vim.helper.MessageHelper
|
||||
|
||||
/**
|
||||
* @author Rieon Ke
|
||||
@@ -51,7 +52,7 @@ class TabCloseHandler : CommandHandler.SingleExecution() {
|
||||
val select = if (index == current) index + 1 else current
|
||||
tabbedPane.removeTabAt(index, select)
|
||||
} else {
|
||||
VimPlugin.showMessage("Error: invalid command argument")
|
||||
VimPlugin.showMessage(MessageHelper.message("error.invalid.command.argument"))
|
||||
}
|
||||
|
||||
return true
|
||||
|
31
src/com/maddyhome/idea/vim/ex/handler/mapping/CommandInfo.kt
Normal file
31
src/com/maddyhome/idea/vim/ex/handler/mapping/CommandInfo.kt
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2020 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.maddyhome.idea.vim.ex.handler.mapping
|
||||
|
||||
import com.maddyhome.idea.vim.command.MappingMode
|
||||
import org.jetbrains.annotations.NonNls
|
||||
|
||||
internal class CommandInfo(
|
||||
@NonNls val prefix: String,
|
||||
@NonNls suffix: String,
|
||||
val mappingModes: Set<MappingMode>,
|
||||
val isRecursive: Boolean
|
||||
) {
|
||||
val command = if (suffix.isBlank()) prefix else "$prefix[$suffix]"
|
||||
}
|
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2020 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.maddyhome.idea.vim.ex.handler.mapping
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.command.MappingMode
|
||||
import com.maddyhome.idea.vim.ex.CommandHandler
|
||||
import com.maddyhome.idea.vim.ex.CommandHandler.Access.READ_ONLY
|
||||
import com.maddyhome.idea.vim.ex.CommandHandler.ArgumentFlag.ARGUMENT_FORBIDDEN
|
||||
import com.maddyhome.idea.vim.ex.CommandHandler.RangeFlag.RANGE_FORBIDDEN
|
||||
import com.maddyhome.idea.vim.ex.CommandHandlerFlags
|
||||
import com.maddyhome.idea.vim.ex.CommandName
|
||||
import com.maddyhome.idea.vim.ex.ComplicatedNameExCommand
|
||||
import com.maddyhome.idea.vim.ex.ExCommand
|
||||
import com.maddyhome.idea.vim.ex.commands
|
||||
import com.maddyhome.idea.vim.ex.flags
|
||||
import com.maddyhome.idea.vim.ex.vimscript.VimScriptCommandHandler
|
||||
|
||||
class MapClearHandler : CommandHandler.SingleExecution(), VimScriptCommandHandler, ComplicatedNameExCommand {
|
||||
override val argFlags: CommandHandlerFlags = flags(RANGE_FORBIDDEN, ARGUMENT_FORBIDDEN, READ_ONLY)
|
||||
override val names: Array<CommandName> = COMMAND_NAMES
|
||||
|
||||
override fun execute(editor: Editor, context: DataContext, cmd: ExCommand): Boolean = executeCommand(cmd)
|
||||
|
||||
override fun execute(cmd: ExCommand) {
|
||||
executeCommand(cmd)
|
||||
}
|
||||
|
||||
private fun executeCommand(cmd: ExCommand): Boolean {
|
||||
val commandInfo = COMMAND_INFOS.find { cmd.command.startsWith(it.prefix) } ?: return false
|
||||
|
||||
VimPlugin.getKey().removeKeyMapping(commandInfo.mappingModes)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val COMMAND_INFOS = arrayOf(
|
||||
CommandInfo("mapc", "lear", MappingMode.NVO, false),
|
||||
CommandInfo("nmapc", "lear", MappingMode.N, false),
|
||||
CommandInfo("vmapc", "lear", MappingMode.V, false),
|
||||
CommandInfo("xmapc", "lear", MappingMode.X, false),
|
||||
CommandInfo("smapc", "lear", MappingMode.S, false),
|
||||
CommandInfo("omapc", "lear", MappingMode.O, false),
|
||||
CommandInfo("imapc", "lear", MappingMode.I, false),
|
||||
CommandInfo("cmapc", "lear", MappingMode.C, false)
|
||||
)
|
||||
|
||||
val COMMAND_NAMES = commands(*COMMAND_INFOS.map { it.command }.toTypedArray())
|
||||
}
|
||||
}
|
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.maddyhome.idea.vim.ex.handler
|
||||
package com.maddyhome.idea.vim.ex.handler.mapping
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext
|
||||
import com.intellij.openapi.editor.Editor
|
||||
@@ -30,11 +30,12 @@ import com.maddyhome.idea.vim.ex.ExCommand
|
||||
import com.maddyhome.idea.vim.ex.ExException
|
||||
import com.maddyhome.idea.vim.ex.commands
|
||||
import com.maddyhome.idea.vim.ex.flags
|
||||
import com.maddyhome.idea.vim.ex.handler.MapHandler.SpecialArgument.EXPR
|
||||
import com.maddyhome.idea.vim.ex.handler.MapHandler.SpecialArgument.SCRIPT
|
||||
import com.maddyhome.idea.vim.ex.handler.mapping.MapHandler.SpecialArgument.EXPR
|
||||
import com.maddyhome.idea.vim.ex.handler.mapping.MapHandler.SpecialArgument.SCRIPT
|
||||
import com.maddyhome.idea.vim.ex.vimscript.VimScriptCommandHandler
|
||||
import com.maddyhome.idea.vim.helper.StringHelper.parseKeys
|
||||
import com.maddyhome.idea.vim.key.MappingOwner
|
||||
import org.jetbrains.annotations.NonNls
|
||||
import java.util.*
|
||||
import javax.swing.KeyStroke
|
||||
|
||||
@@ -57,34 +58,32 @@ class MapHandler : CommandHandler.SingleExecution(), VimScriptCommandHandler, Co
|
||||
|
||||
@Throws(ExException::class)
|
||||
private fun executeCommand(cmd: ExCommand, editor: Editor?): Boolean {
|
||||
val commandInfo = COMMAND_INFOS.find { cmd.command.startsWith(it.prefix) }
|
||||
if (commandInfo != null) {
|
||||
val commandInfo = COMMAND_INFOS.find { cmd.command.startsWith(it.prefix) } ?: return false
|
||||
val argument = cmd.argument
|
||||
val modes = commandInfo.mappingModes
|
||||
if (argument.isEmpty()) {
|
||||
return editor != null && VimPlugin.getKey().showKeyMappings(modes, editor)
|
||||
} else {
|
||||
|
||||
if (argument.isEmpty()) return editor != null && VimPlugin.getKey().showKeyMappings(modes, editor)
|
||||
|
||||
val arguments = try {
|
||||
parseCommandArguments(argument)
|
||||
parseCommandArguments(argument) ?: return false
|
||||
} catch (ignored: IllegalArgumentException) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (arguments != null) {
|
||||
for (unsupportedArgument in UNSUPPORTED_SPECIAL_ARGUMENTS) {
|
||||
if (unsupportedArgument in arguments.specialArguments) {
|
||||
throw ExException("Unsupported map argument: $unsupportedArgument")
|
||||
}
|
||||
}
|
||||
VimPlugin.getKey().putKeyMapping(modes, arguments.fromKeys, MappingOwner.IdeaVim, arguments.toKeys, commandInfo.isRecursive)
|
||||
|
||||
VimPlugin.getKey()
|
||||
.putKeyMapping(modes, arguments.fromKeys, MappingOwner.IdeaVim, arguments.toKeys, commandInfo.isRecursive)
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
@Suppress("unused")
|
||||
@NonNls
|
||||
private enum class SpecialArgument(val myName: String) {
|
||||
BUFFER("<buffer>"),
|
||||
NOWAIT("<nowait>"),
|
||||
@@ -113,10 +112,6 @@ class MapHandler : CommandHandler.SingleExecution(), VimScriptCommandHandler, Co
|
||||
private class CommandArguments(val specialArguments: Set<SpecialArgument>, val fromKeys: List<KeyStroke>,
|
||||
val toKeys: List<KeyStroke>)
|
||||
|
||||
private class CommandInfo(val prefix: String, suffix: String, val mappingModes: Set<MappingMode>, val isRecursive: Boolean) {
|
||||
val command = if (suffix.isBlank()) prefix else "$prefix[$suffix]"
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val CTRL_V = '\u0016'
|
||||
private val COMMAND_INFOS = arrayOf(
|
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2020 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.maddyhome.idea.vim.ex.handler.mapping
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.command.MappingMode
|
||||
import com.maddyhome.idea.vim.ex.CommandHandler
|
||||
import com.maddyhome.idea.vim.ex.CommandHandler.Access.READ_ONLY
|
||||
import com.maddyhome.idea.vim.ex.CommandHandler.ArgumentFlag.ARGUMENT_REQUIRED
|
||||
import com.maddyhome.idea.vim.ex.CommandHandler.RangeFlag.RANGE_FORBIDDEN
|
||||
import com.maddyhome.idea.vim.ex.CommandHandlerFlags
|
||||
import com.maddyhome.idea.vim.ex.CommandName
|
||||
import com.maddyhome.idea.vim.ex.ComplicatedNameExCommand
|
||||
import com.maddyhome.idea.vim.ex.ExCommand
|
||||
import com.maddyhome.idea.vim.ex.commands
|
||||
import com.maddyhome.idea.vim.ex.flags
|
||||
import com.maddyhome.idea.vim.ex.vimscript.VimScriptCommandHandler
|
||||
import com.maddyhome.idea.vim.helper.StringHelper.parseKeys
|
||||
|
||||
class UnMapHandler : CommandHandler.SingleExecution(), VimScriptCommandHandler, ComplicatedNameExCommand {
|
||||
override val argFlags: CommandHandlerFlags = flags(RANGE_FORBIDDEN, ARGUMENT_REQUIRED, READ_ONLY)
|
||||
override val names: Array<CommandName> = COMMAND_NAMES
|
||||
|
||||
override fun execute(editor: Editor, context: DataContext, cmd: ExCommand): Boolean = executeCommand(cmd)
|
||||
|
||||
override fun execute(cmd: ExCommand) {
|
||||
executeCommand(cmd)
|
||||
}
|
||||
|
||||
private fun executeCommand(cmd: ExCommand): Boolean {
|
||||
val commandInfo = COMMAND_INFOS.find { cmd.command.startsWith(it.prefix) } ?: return false
|
||||
val argument = cmd.argument
|
||||
|
||||
if (argument.isEmpty()) return false
|
||||
|
||||
val parsedKeys = parseKeys(argument.trimStart())
|
||||
|
||||
VimPlugin.getKey().removeKeyMapping(commandInfo.mappingModes, parsedKeys)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val COMMAND_INFOS = arrayOf(
|
||||
CommandInfo("unm", "ap", MappingMode.NVO, false),
|
||||
CommandInfo("nun", "map", MappingMode.N, false),
|
||||
CommandInfo("vu", "nmap", MappingMode.V, false),
|
||||
CommandInfo("xu", "nmap", MappingMode.X, false),
|
||||
CommandInfo("sunm", "ap", MappingMode.S, false),
|
||||
CommandInfo("ou", "nmap", MappingMode.O, false),
|
||||
CommandInfo("iu", "nmap", MappingMode.I, false),
|
||||
CommandInfo("cu", "nmap", MappingMode.C, false)
|
||||
)
|
||||
|
||||
val COMMAND_NAMES = commands(*COMMAND_INFOS.map { it.command }.toTypedArray())
|
||||
}
|
||||
}
|
@@ -24,6 +24,7 @@ import com.maddyhome.idea.vim.common.TextRange
|
||||
import com.maddyhome.idea.vim.group.MotionGroup
|
||||
import com.maddyhome.idea.vim.helper.EditorHelper
|
||||
import com.maddyhome.idea.vim.helper.fileSize
|
||||
import org.jetbrains.annotations.NonNls
|
||||
import kotlin.math.min
|
||||
|
||||
/**
|
||||
@@ -179,6 +180,7 @@ class Ranges {
|
||||
count = 0
|
||||
}
|
||||
|
||||
@NonNls
|
||||
override fun toString(): String = "Ranges[ranges=$ranges]"
|
||||
|
||||
private var startLine = 0
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user