Also VimFuncref. This is required to protect against unbounded recursion in generated equals and hashCode functions when the list or dictionary contains internally recursive references
Add tests for previously uncovered edge cases in the index() function:
- Start index beyond list size
- Start index at list size boundary
- Negative start beyond list size
- Nested list comparisons
- Float value comparisons
- Float vs int type distinction
- ignoreCase parameter with non-string types
These tests ensure the implementation correctly handles boundary
conditions and type distinctions, improving test coverage and
preventing regressions.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Remove redundant `.toVimString()` conversions in `compareValues()` methods
of IndexFunctionHandler and CountFunctionHandler. When we already know
`expr is VimString` from the type check, calling `.toVimString()` again
is unnecessary.
This improves code clarity and removes a redundant method call.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
The removeTabAt method was incorrectly passing indexToDelete twice
instead of using the indexToSelect parameter. This caused the wrong
tab to be selected after closing a tab.
The TabCloseCommand calculates which tab should be selected after
deletion (either index + 1 if closing current tab, or keep current
selection), but this information was being ignored.
This fix ensures the correct tab is selected after :tabclose, matching
expected Vim behavior.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add test case for when caret is at the beginning of the command line
to ensure the action correctly handles this edge case without side effects.
This matches test coverage patterns in similar actions like
DeletePreviousWordActionTest and DeletePreviousCharActionTest.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add early return when caret is at position 0 to match the pattern used by
similar command line delete actions (DeletePreviousWordAction,
DeletePreviousCharAction). This makes the intent clearer and avoids
unnecessary calls to deleteText with length 0.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
The condition was checking `maximumNumberOfArguments` twice instead of
checking both `minimumNumberOfArguments` and `maximumNumberOfArguments`.
This prevented the early return optimization from working correctly for
aliases with zero required and zero maximum arguments.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add writability check in initInsert() to prevent insert mode entry for read-only files. Shows dialog for temporarily read-only files(e.g., ~/ideavimrc) or blocks entry for non-writable files
Signed-off-by: NaMinhyeok <nmh9097@gmail.com>
Fix potential ConcurrentModificationException in statistics collection by using thread-safe collections.
Issues found:
- VimscriptState.Util and PluginState.Util used non-thread-safe HashSets
- Collections were modified from EDT/user actions but read from getMetrics()
- IntelliJ's ApplicationUsagesCollector.getMetrics() may be called on background threads
- Race conditions could cause ConcurrentModificationException or data corruption
Changes:
- Replace HashSet with ConcurrentHashMap.newKeySet() for thread-safe add/read operations
- Add @Volatile annotations to boolean flags to ensure visibility across threads
- This ensures safe concurrent access between statistics writers and collectors
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This breaks a specific construct: `echo(42)(999)`. The `echo` command can parse multiple expressions without separating whitespace. IdeaVim now treats this example as a function call of the resul of the `(42)` expression, which is, of course, invalid. Vim evaluates expressions as it is parsing and declines to apply the `(999)` subscript because it knows the first expression is not a funcref/partial.
IdeaVim does not have this context, so cannot know that this is two expressions and not a function call.
I think it is better to support the `expr10(expr1, ...)` syntax and break this (what feels like niche) functionality than not have function calls through expression results at all.
The only change to the rules themselves is to add unary plus/minus to IntExpression and FloatExpression. This matches Vim's precedence, where the unary operator applies to numeric constants at a higher precedence than to other expressions. E.g. `-4->abs()` invokes `abs` on `-4`, while `-a->abs()` is the negative value of `abs(a)`.
The companion function `modeToMappingMode` was not used anywhere in the codebase.
The extension function `toMappingMode()` serves the same purpose and is used throughout.
Also removed unused import and extra blank line for cleaner code formatting.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
VimEditorGroupBase has been unused since its creation in April 2022. Unlike other
*Base classes in the api package (VimApplicationBase, VimMessagesBase, etc.),
VimEditorGroupBase is never extended. The actual EditorGroup implementation
directly implements the VimEditorGroup interface instead of extending this base class.
This removal cleans up dead code and reduces maintenance overhead.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>