1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2026-05-04 11:03:08 +02:00
Commit Graph

9697 Commits

Author SHA1 Message Date
Alex Plate
4c8c1cfcf2 Fix map/noremap/unmap to only affect nvo modes
The map/noremap/unmap functions should only affect Normal, Visual, Select,
and Operator-pending modes (nvo), not all modes including Insert and
Command-line. This matches Vim's behavior where :map affects nvo modes only.

Changed from MappingMode.ALL to MappingMode.NVO.
2025-10-27 11:00:04 +02:00
Alex Plate
2c383b4ad8 Reorganize MappingScope functions by mode type
Group mapping functions by mode instead of by operation type for better
organization and readability. Each mode group now contains:
- Recursive mapping (map variants)
- Non-recursive mapping (noremap variants)
- Unmap function

Order: map, nmap, vmap, xmap, smap, omap, imap, cmap

This makes the API more discoverable and easier to navigate.
2025-10-27 11:00:04 +02:00
Alex Plate
e71e9714c2 Remove incorrect 3-argument mapping functions from API
The 3-argument mapping functions (e.g., nmap(keys, actionName, action)) had
incorrect implementation that used recursive mappings for both sub-mappings.
Also, this approach makes it impossible to implement other mapping features
such as skipping mapping registration if the mapping is already defined in
.ideavimrc.

A different solution for convenient mapping patterns will be implemented later.

Changes:
- Remove 16 three-argument function declarations from MappingScope interface
- Remove 16 three-argument function implementations from MappingScopeImpl
- Update ReplaceWithRegister plugins to use correct 2-step pattern:
  1. nnoremap("<Plug>...") for non-recursive <Plug> → action
  2. nmap("key", "<Plug>...") for recursive key → <Plug>

Total: 374 lines deleted, 18 lines added
2025-10-27 11:00:03 +02:00
IdeaVim Bot
80f30f3f20 Add github-actions[bot], azjf to contributors list 2025-10-25 09:01:55 +00:00
Xinhe Wang
7b561bc275 Support hints for status bar widgets
The project switching and version control menus in the top-left corner remain unavailable due to accessibility issues (failure to implement the Accessible interface, specifically) with the ToolbarComboButton component in the IntelliJ platform.
2025-10-24 15:41:30 +03:00
Xinhe Wang
057a54c63d Specify hint action in HintGenerator instead of actionPerformed 2025-10-24 15:41:30 +03:00
Xinhe Wang
5893718c1b Click target center instead of invoking accessible action if hint is selected 2025-10-24 15:41:30 +03:00
1a8d5e0b66 Improve support for recording macros with code completion (#1332)
Fixes wrong recorded inputs when code completion introduces an import.

Fixes wrong recorded inputs when completing a static member with a partial type name. Example: `WiE.A` -> `WindowEvent.ACTION_EVENT_MASK`

Co-authored-by: Alex Plãte <aleksei.plate@jetbrains.com>
2025-10-24 15:24:43 +03:00
claude[bot]
cc3c132ccb Maintenance: Java tests - Improve null safety in fold region handling
Replace unsafe non-null assertions (!!) with explicit null checks that provide
meaningful error messages when fold regions are not found. This makes test
failures easier to debug by clearly indicating what was expected.

Changes:
- ChangeActionJavaTest: Fixed 4 instances in testInsertAfterToggleFold and testInsertBeforeFold
- VisualInsertActionJavaTest: Fixed 1 instance in test block insert after folds

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 14:39:39 +03:00
claude[bot]
13fb2d53f1 Maintenance: LenFunctionTest - Address review feedback
- Remove duplicate empty dictionary test (already covered at line 28)
- Rename 'test len with zero' to 'test len with zero number' for clarity
- Rename 'test len with negative number' to 'test len with negative numbers' (plural)

Co-authored-by: Alex Plãte <AlexPl292@users.noreply.github.com>
2025-10-24 14:38:49 +03:00
claude[bot]
c803a1cf24 Maintenance: LenFunctionTest - Add comprehensive edge case coverage
What was inspected:
- LenFunctionTest.kt and its corresponding implementation LenFunctionHandler.kt

Issues found:
- Test coverage was limited to basic happy path scenarios
- Missing tests for important edge cases: empty strings, zero, negative numbers,
  large numbers, empty collections, and special character handling
- No tests distinguishing between single-quoted and double-quoted string behavior
  in Vimscript

Changes made:
- Added 9 new test methods covering:
  * Empty strings (both single and double quoted)
  * Empty lists and dictionaries
  * Zero and negative numbers
  * Large numbers
  * Multi-element collections
  * Strings with escape sequences (documenting Vim's single vs double quote behavior)

Why this improves the code:
- Ensures len() function handles all data type edge cases correctly
- Documents expected behavior for Vimscript string quoting conventions
- Provides regression protection against future changes
- Aligns with testing best practices by covering boundary conditions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 14:38:49 +03:00
Alex Plate
1d60e47bb8 Remove the PR pre-fetch 2025-10-24 14:38:37 +03:00
Alex Plate
664c433ee9 Add test for Visual mode inclusive caret positioning in templates
Adds a test to verify that when using 'idearefactormode=visual' with
inclusive selection (default), the caret is correctly positioned at the
inclusive end of the selection (on the last character) rather than the
exclusive end (after the last character).

This test covers the caret adjustment logic in IdeaSpecifics.kt that
moves the caret from IntelliJ's exclusive end position to Vim's
inclusive end position for Visual mode when 'selection' doesn't contain
"exclusive".
2025-10-24 14:32:03 +03:00
Alex Plate
67a44b4d25 Fix boundary check and null safety in mapleader parsing
Adds length validation before accessing string indices and replaces unsafe
!! operator with proper null handling to prevent crashes on invalid mapleader values.
2025-10-24 14:31:23 +03:00
Matt Ellis
b4915d08cd Remove redundant code
The template listener is called immediately for the first variable, which will do the same thing.
2025-10-24 14:29:58 +03:00
Matt Ellis
6b7b18d947 Switch to Normal when accepting an inline rename
The 'idearefactormode' default of Select would leave an inline rename in Insert mode, and hitting Escape to return to Normal frequently cancelled the rename.

Also fixes various edge cases when moving between template variables. Often, this works due to a change in selection, but if there's an empty template variable and no current selection, there's no change in selection, and the mode isn't updated.
2025-10-24 14:29:58 +03:00
Matt Ellis
54cc89f641 Fix missing read action exceptions 2025-10-24 14:29:58 +03:00
Matt Ellis
1048d06586 Remove no longer used 'ideaglobalmode' text 2025-10-24 14:29:58 +03:00
azjf
7f0ab93ea7 Return \<${specialKeyBuilder} for VimStringParserBase#parseVimScriptString(string: String) 2025-10-24 13:44:57 +03:00
azjf
a0f923512a Add support for non-control-character mapleader such as \<C-Space> 2025-10-24 13:44:57 +03:00
Alex Plate
d60af9afa1 Remove the checkout from the manual command 2025-10-24 13:14:32 +03:00
Alex Plate
1ef919f73a Add checkout step 2025-10-24 13:05:03 +03:00
Alex Plate
f6947d73f6 Trying to disable oidc for forkes 2025-10-24 11:22:14 +03:00
Alex Plate
54c12470f3 Claude Code now has an ability to create inline comments 2025-10-24 11:10:51 +03:00
Alex Plate
8aa8725a8d Update Claude Code workflow
I'm mostly trying to force Claude Code to work with the forks
2025-10-24 11:08:35 +03:00
IdeaVim Bot
1e1bbbac2a Add github-actions[bot] to contributors list 2025-10-20 09:01:57 +00:00
claude[bot]
0bb3524118 Maintenance: IjVimMessages - Fix redundant toString() call and improve null safety
In clearStatusBarMessage(), the mutable 'message' property was being
accessed multiple times without capturing it in a local variable. This
could theoretically cause issues if the property changed between the
null check and the usage. Additionally, calling toString() on a String
is redundant and creates an unnecessary allocation.

Fixed by capturing the message in a local variable at the start of the
method, which allows Kotlin's smart cast to work properly and removes
the need for the redundant toString() call.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 08:45:45 +03:00
claude[bot]
12596540e9 Maintenance: Line matchers - Add defensive bounds checking
Added bounds checking to EndOfLineMatcher and StartOfLineMatcher to
prevent potential IndexOutOfBoundsException when index is outside the
valid text range. This follows the defensive programming pattern used
in other matchers like CharacterMatcher, DotMatcher, StartOfWordMatcher,
and EndOfWordMatcher.

Changes:
- EndOfLineMatcher: Added check for index > length before array access
- StartOfLineMatcher: Added check for index < 0 or index > length

While the NFA engine should prevent invalid indices, these defensive
checks improve code safety and consistency across all matcher
implementations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 08:44:51 +03:00
IdeaVim Bot
3eadff6401 Add github-actions[bot] to contributors list 2025-10-18 09:01:56 +00:00
claude[bot]
52f4c24b1e Docs: Add regression testing guideline to maintenance instructions
Added a new bullet point under the Testing section that instructs
maintainers to write regression tests when fixing bugs. These tests
should:
- Fail with the buggy implementation
- Pass with the fix
- Document what bug they're testing
- Test the specific boundary condition that exposed the bug

This ensures bugs don't resurface during future refactorings and
provides clear documentation of the expected behavior.

Co-authored-by: Alex Plãte <AlexPl292@users.noreply.github.com>
2025-10-17 21:15:47 +03:00
claude[bot]
7de2ea0e0b Add regression test for string indexing boundary condition
This test validates the off-by-one error fix in IndexedExpression.kt:56.
When accessing a string at index equal to its length, the code should
return an empty string rather than throwing IndexOutOfBoundsException.

The old condition (idx > text.length) would allow idx == text.length to
pass through, causing an exception. The new condition (idx >= text.length)
correctly treats this as out of bounds.

Test case: 'hello'[5] should return '' since 'hello'.length == 5

Co-authored-by: Alex Plãte <AlexPl292@users.noreply.github.com>
2025-10-17 21:15:47 +03:00
claude[bot]
a9fc2c58a6 Maintenance: IndexedExpression - Fix off-by-one error and variable shadowing
Fixed three issues in IndexedExpression.kt:
1. Off-by-one error: Changed condition from `idx > text.length` to `idx >= text.length` to properly handle boundary cases when indexing strings
2. Redundant evaluation: Reused `indexValue` instead of re-evaluating `index.evaluate()` in the string indexing path
3. Variable shadowing: Renamed local variable from `index` to `indexNum` in `assignToListItem` to avoid shadowing the property

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-17 21:15:47 +03:00
claude[bot]
1aa586484f Maintenance: Change actions - Remove wildcard imports
Replace wildcard import `java.util.*` with explicit import `java.util.EnumSet`
in 9 action classes in the change/change package. This improves code clarity
and follows the project's convention of avoiding wildcard imports.

Files updated:
- AutoIndentLinesVisualAction
- ChangeCharactersAction
- ChangeEndOfLineAction
- ChangeLineAction
- ChangeMotionAction
- ChangeVisualLinesAction
- ChangeVisualLinesEndAction
- FilterMotionAction
- ReformatCodeVisualAction

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-17 12:41:03 +03:00
Alex Plate
aa24d53b18 Get rid of the deprecated method in the configuration 2025-10-17 12:39:18 +03:00
Alex Plate
c396d98022 Add RandomOrderTests configuration to TeamCity project
Introduce a new build type `RandomOrderTests` for detecting order-dependent bugs. Update project to include the new build type.
2025-10-17 12:38:55 +03:00
Alex Plate
db767f534f Remove an unclear test 2025-10-17 12:30:29 +03:00
Alex Plate
d955b1b85c Fix an exception that we try to record wrong characters 2025-10-17 12:21:57 +03:00
IdeaVim Bot
0fdfc04068 Add github-actions[bot] to contributors list 2025-10-14 09:01:55 +00:00
claude[bot]
244d13a3cc Maintenance: HintGenerator - Fix variable shadowing and remove wildcard import
Fixed a variable shadowing bug in the hint generation logic where the lambda
parameter name 'it' was being shadowed in nested lambda, causing incorrect
logic when checking for hint conflicts. The code now uses explicit parameter
names 'candidateHint' and 'existingHint' to make the logic clear and correct.

Also replaced wildcard import (java.util.*) with explicit import of
WeakHashMap, following project conventions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 10:23:36 +03:00
claude[bot]
4a2600738f Maintenance: RangeFunctionTest - Fix missing assertion and improve imports
Fixed a missing assertion in the test case "test range negative with start
past end throws error" that was not verifying the error condition actually
occurred. Also cleaned up imports by adding a proper import for assertTrue
instead of using the fully qualified kotlin.test.assertTrue.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-13 18:01:47 +03:00
claude[bot]
82ed26a701 Maintenance: PrintLineNumberCommand - Fix out-of-bounds range handling
Add bounds checking to clamp line numbers to the last line of the document,
preventing potential exceptions when accessing line text with out-of-bounds
ranges like `:$+100=`. This matches the behavior of other commands like
GoToLineCommand.

Also add tests to verify the edge case behavior with and without flags.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-13 18:00:49 +03:00
Alex Plate
cf5dce3ce7 Remove "getSelectionModel" from VimRegex.kt 2025-10-13 17:37:23 +03:00
Alex Plate
c68e216c87 Add copyright year policy to maintenance instructions
Clarify that copyright years should only be updated when making
substantive changes to files, and should not be mentioned in commits.
2025-10-13 16:22:16 +03:00
IdeaVim Bot
c12f4a75ac Add github-actions[bot] to contributors list 2025-10-10 09:01:54 +00:00
claude[bot]
9a069e5ef8 Maintenance: ExPanelBorder - Update copyright and remove redundant modifier
- Update copyright year from 2023 to 2025
- Remove redundant 'internal constructor()' modifier (already implied by internal class)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-09 15:51:32 +03:00
Alex Plate
27f2e56635 Update codebase maintenance workflow to run daily
Change schedule from weekly (Monday) to daily execution at 6 AM UTC to enable more frequent code quality checks.
2025-10-09 14:26:32 +02:00
Alex Plate
7a0bdb8f3d Add reference to CONTRIBUTING.md in maintenance instructions
Expand the architecture reference to include more details about what contributors can find in CONTRIBUTING.md: architecture overview, testing guidelines, patterns, and awards program information.
2025-10-09 14:16:36 +02:00
Alex Plate
1d9bb6ec70 Expand testing corner cases in contribution guide
Add comprehensive corner case categories for testing Vim commands including position-based, content-based, selection-based, motion-based, buffer state, and boundary conditions to help contributors write more thorough tests.
2025-10-09 14:16:36 +02:00
claude[bot]
bb62dcdc15 Maintenance: DeletePreviousWordAction - Update copyright and add test
Update copyright year to 2025 and add test coverage for edge case when
caret is at the beginning of the command line.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-09 15:15:59 +03:00
Alex Plate
fdcb954e31 Remove the VimSelectionModel as it's not used anywhere 2025-10-09 13:14:49 +02:00