Commit Graph
2227 Commits
Author SHA1 Message Date
claude[bot]andClaude 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
claude[bot]andClaude 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
Alex Plate 448c19af47 Fix SortCommand to use caret selection instead of editor selection model
The SortCommand was incorrectly using editor.getSelectionModel() which
returns the editor's global selection model. This is problematic in
multi-caret scenarios where each caret has its own independent selection.

Changed to use caret.hasSelection(), caret.selectionStart, and
caret.selectionEnd directly, which correctly handles per-caret selections.

This also removes the only meaningful usage of VimEditor.getSelectionModel()
in vim-engine, making that interface a candidate for removal in future
cleanup.
2025-10-09 13:09:38 +02:00
Alex Plate bdc29c3eb4 Add support for count(), index(), min(), max(), and range() vimscript functions
Implements five new vimscript list functions:
- count(): counts occurrences of a value in a list/dict
- index(): finds first index of a value in a list
- min()/max(): finds minimum/maximum value in a list/dict
- range(): generates a list of numbers with optional stride

Includes error handling for edge cases like zero stride and invalid ranges.
2025-10-03 20:59:29 +03:00
Alex Plate d46eb39635 Add support for repeat(), char2nr(), nr2char(), trim(), and reverse() vimscript functions
Implement five commonly used vimscript functions:

- repeat(expr, count): Repeats strings or lists multiple times
- char2nr(char): Converts character to Unicode code point
- nr2char(number): Converts code point to character
- trim(text, [mask], [dir]): Trims whitespace or custom characters
- reverse(object): Reverses lists in-place or returns reversed string

All functions include comprehensive test coverage and follow vim's
official behavior including edge cases.
2025-10-03 19:08:57 +03:00
Alex Plate a6c71d90bb Fix(VIM-4050): Implement getline vim function 2025-10-03 18:41:34 +03:00
Alex Plate 63c65c8b93 Migrate ExEntryPanel from Java to Kotlin and update related references 2025-10-03 13:30:19 +03:00
Alex Plate 330f24bf74 Update JUnit to version 6 and improve null safety in test utilities 2025-10-02 18:04:30 +03:00
Matt Ellis 6defddd24c Extract variable expression assignment 2025-10-02 17:26:38 +03:00
Matt Ellis a916b4de9c Rename Variable to VariableExpression 2025-10-02 17:26:38 +03:00
Matt Ellis 8a0bdfd18f Improve sublist expression compatibility 2025-10-02 17:26:38 +03:00
Matt Ellis db8736dcf4 Extract sublist expression assignment 2025-10-02 17:26:38 +03:00
Matt Ellis 4c3cefc1e6 Add typename for reporting purposes 2025-10-02 17:26:38 +03:00
Matt Ellis b11fc4895b Support assigning to negative index 2025-10-02 17:26:38 +03:00
Matt Ellis b7ce946af3 Extract sublist expression assignment
Also allows whitespace inside indexed expression
2025-10-02 17:26:38 +03:00
Matt Ellis 5a45f6d945 Improve evaluating indexed expressions
Support negative indexes, float indexes, and indexing numbers
2025-10-02 17:26:38 +03:00
Matt Ellis 6622f15ea3 Allow dictionary to be indexed by Float 2025-10-02 17:26:38 +03:00
Matt Ellis fd1fe51633 Extract indexed expression assignment 2025-10-02 17:26:38 +03:00
Matt Ellis 91459edf6c Rename OneElementSublistExpression 2025-10-02 17:26:38 +03:00
Matt Ellis 01d92acd40 Improve validation for concatenation 2025-10-02 17:26:38 +03:00
Matt Ellis 6d18288883 Fix validation for modulo operator 2025-10-02 17:26:38 +03:00
Matt Ellis 7ffca59450 Support double-dot concatenation assignment 2025-10-02 17:26:38 +03:00
Matt Ellis 61df4f342d Support Float in concatenation handler
Surprisingly Float is converted to String, and then concatenated. But this is only supported for the binary concatenation operator, not the compound assignment concatenation operator. This lead to improved validation and behaviour closer to Vim.
2025-10-02 17:26:38 +03:00
Matt Ellis 56d5af6bc9 Allow assigning Float to Register 2025-10-02 17:26:38 +03:00
Matt Ellis 1dbe3e4aa1 Update RegisterExpression to assign value 2025-10-02 17:26:38 +03:00
Matt Ellis 7256731572 Rename Register to RegisterExpression 2025-10-02 17:26:38 +03:00
Matt Ellis dc5b45a52d Update OptionExpression to match Vim behaviour 2025-10-02 17:26:38 +03:00
Matt Ellis 063317b0c9 Introduce LValueExpression, update OptionExpression 2025-10-02 17:26:38 +03:00
Matt Ellis 37b6768148 Rename LetCommand.variable to lvalue 2025-10-02 17:26:38 +03:00
Matt Ellis 7fe01cd885 Add string() Vim function 2025-10-02 17:26:38 +03:00
Matt Ellis 68f0e162e2 Update out of date error message 2025-10-02 17:26:38 +03:00
Alex Plate 2c6638fe37 Introduce a common getChar implementation in the injector 2025-10-02 17:05:06 +03:00
dependabot[bot] c2d7f40512 Bump org.mockito.kotlin:mockito-kotlin from 6.0.0 to 6.1.0
Bumps [org.mockito.kotlin:mockito-kotlin](https://github.com/mockito/mockito-kotlin) from 6.0.0 to 6.1.0.
- [Release notes](https://github.com/mockito/mockito-kotlin/releases)
- [Commits](https://github.com/mockito/mockito-kotlin/compare/v6.0.0...v6.1.0)

---
updated-dependencies:
- dependency-name: org.mockito.kotlin:mockito-kotlin
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-01 19:18:24 +03:00
dependabot[bot] ac4a55d245 Bump org.junit.vintage:junit-vintage-engine from 5.13.4 to 6.0.0
Bumps [org.junit.vintage:junit-vintage-engine](https://github.com/junit-team/junit-framework) from 5.13.4 to 6.0.0.
- [Release notes](https://github.com/junit-team/junit-framework/releases)
- [Commits](https://github.com/junit-team/junit-framework/compare/r5.13.4...r6.0.0)

---
updated-dependencies:
- dependency-name: org.junit.vintage:junit-vintage-engine
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-01 18:22:54 +03:00
Matt Ellis 6f259f5207 Extract E474 error message 2025-09-16 16:33:40 +03:00
Matt Ellis a9e503d13f Extract error messages from code 2025-09-16 16:33:40 +03:00
Matt Ellis 5297193649 Assert full error message, not partial
There's no good reason to only check a partial match. Make sure the entire string is correct.
2025-09-16 16:33:40 +03:00
Matt Ellis 4c84241d2a Remove unnecessary error text messages
Let the IDE do this from the code
2025-09-16 16:33:40 +03:00
Matt Ellis 612dfe321c Fix typo 2025-09-16 16:33:40 +03:00
Matt Ellis c0f9f0bcbc Rename cryptic error messages to error codes 2025-09-16 16:33:40 +03:00
Matt Ellis e7769e33d7 Remove or rename unnecessary messages 2025-09-16 16:33:40 +03:00
Matt Ellis c725447c00 Refactor messages for ActionListCommand 2025-09-16 16:33:40 +03:00
Matt Ellis 920ac0546e Replace custom errors with error codes 2025-09-16 16:33:40 +03:00
Matt Ellis c5e3c9ccf1 Rename messages to be more consistent 2025-09-16 16:33:40 +03:00
Matt Ellis f8d5d049bc Simplify code to remove duplicate error message 2025-09-16 16:33:40 +03:00
Matt Ellis 5c45c62c5b Rename some error message identifiers 2025-09-16 16:33:40 +03:00
Matt Ellis f1d0206c66 Refactor code to remove unnecessary messages
The code doesn't require nullable arguments, which removes null check error messages. Also removed some "not implemented" messages from resources. There's no need for them to be in resources, hopefully we'll implement them soon.
2025-09-16 16:33:40 +03:00
Matt Ellis fd6fe37c8f Remove unnecessary Msg class
Using string identifiers means the IntelliJ resource tooling works better
2025-09-16 16:33:40 +03:00