1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-07-25 14:59:02 +02:00
Commit Graph

1513 Commits

Author SHA1 Message Date
Alex Plate
916afd31b2
Fix(VIM-3870): Add missing write actions 2025-04-16 18:54:22 +03:00
Matt Ellis
a5efa5f9f2 Rename SAVE_VISUAL to SAVE_SELECTION
IdeaVim will still leave Visual mode, but the IDE's selection remains.
2025-04-10 19:32:29 +03:00
Matt Ellis
e86503798a Remove special case handling for Plug mapping
While it might not make sense to replay an incorrect `<Plug>` or `<Action>` mapping as characters where they are likely to cause unexpected behaviour as Normal commands, this is standard Vim behaviour (at least for `<Plug>`).

Note that `<Plug>` (and `<Action>`) is a special key code that cannot be typed. In Insert mode, Vim expands it to the text "<Plug>".
2025-04-10 19:32:29 +03:00
Matt Ellis
0b6ac4a9f4 Rename variable and add comments 2025-04-10 19:32:29 +03:00
Matt Ellis
2a6f7cc907 Remove unused mappingComplete parameter
Also makes all KeyConsumers internal
2025-04-10 19:32:29 +03:00
Matt Ellis
9b4f114d61 Refactor MappingProcessor
Extract single implementation for replaying unhandled keys and update to match the longest mapping that fits in the unhandled keys.
2025-04-10 19:32:29 +03:00
Matt Ellis
3155556832 Reformat and update comments for MappingProcessor
Minor refactorings, should be no changes in logic
2025-04-10 19:32:29 +03:00
Matt Ellis
07190f38c9 Fix :normal command with multi-letter mapping 2025-04-10 19:32:29 +03:00
Matt Ellis
db116faa32 Fix handling of modes in NormalCommand
All commands are called in Normal, so there is no need to check mode at execution time. The SAVE_VISUAL flag is perhaps poorly named, as it still change to Normal mode, but will save the current selection for commands that need (usually because they interact with IDE features). The `:normal` command does not need the current selection.
2025-04-10 19:32:29 +03:00
erotourtes
5a3d35f216 fix: typo & consistency 2025-04-07 10:47:41 +03:00
Matt Ellis
6d3bde3ad5 Fix incorrect implementation of DoesNotMatchHandler 2025-03-28 19:07:06 +02:00
Matt Ellis
3b2b863c88 Update truthy expressions 2025-03-28 19:07:06 +02:00
Matt Ellis
a7e1c08589 Simplify unary arithmetic operators 2025-03-28 19:07:06 +02:00
Matt Ellis
5aa5e82d59 Rename some operator handlers 2025-03-28 19:07:06 +02:00
Matt Ellis
0db9ad505b Remove unnecessary singleton classes 2025-03-28 19:07:06 +02:00
Matt Ellis
147eb99745 Simplify case sensitive binary operators 2025-03-28 19:07:06 +02:00
Matt Ellis
bb73bdfb4a Simplify case sensitive comparisons 2025-03-28 19:07:06 +02:00
Matt Ellis
9ab1044880 Migrate various string operators to toVimString
Make it explicit they only work with String values
2025-03-28 19:07:06 +02:00
Matt Ellis
e2cc9c648f Introduce toVimString to match toVimNumber 2025-03-28 19:07:06 +02:00
Matt Ellis
a322525c2a Be more explicit with is and isnot implementation 2025-03-28 19:07:06 +02:00
Matt Ellis
51ea947ccb Move comparison operator data rules to base class 2025-03-28 19:07:06 +02:00
Matt Ellis
f6810798ef Move binary operator conversion rules to base class 2025-03-28 19:07:06 +02:00
Matt Ellis
2fee525998 Refactor logical operators 2025-03-28 19:07:06 +02:00
Matt Ellis
9e3ab12451 Combine logical handlers into same file 2025-03-28 19:07:06 +02:00
Matt Ellis
5f8d552e8a Extract error message 2025-03-28 19:07:06 +02:00
Matt Ellis
4e847f8ef4 Merge arithmetic operators to same file 2025-03-28 19:07:06 +02:00
Matt Ellis
d5901fc2c9 Merge case-sensitive handlers to same file 2025-03-28 19:07:06 +02:00
Matt Ellis
3621b91321 Make operator handlers internal 2025-03-28 19:07:06 +02:00
Matt Ellis
021db84a21 Expand ~ to home directory in XDG_CONFIG_HOME
Addresses VIM-3844, VIM-2001
2025-03-28 18:18:32 +02:00
Matt Ellis
e232cb3ceb Support 32-bit Unicode codepoints in digraphs
Fixes VIM-3842
2025-03-28 18:13:14 +02:00
Matt Ellis
7917c83cb5 Add extra tests for line() function behaviour
It's not obvious that line('v') will return the opposite end of the current selection. Add some tests to highlight this.

Relates to VIM-3838
2025-03-28 17:23:41 +02:00
Matt Ellis
42229b285b Fix typo 2025-03-28 17:23:41 +02:00
Matt Ellis
dbd097a91a Fix caret position after :move command
Fixes VIM-3837
2025-03-28 17:23:41 +02:00
dependabot[bot]
3b8a830622 Bump org.junit.jupiter:junit-jupiter-api from 5.12.0 to 5.12.1
Bumps [org.junit.jupiter:junit-jupiter-api](https://github.com/junit-team/junit5) from 5.12.0 to 5.12.1.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.12.0...r5.12.1)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-api
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-26 17:41:17 +02:00
dependabot[bot]
4b3bba6a98 Bump org.junit.vintage:junit-vintage-engine from 5.12.0 to 5.12.1
Bumps [org.junit.vintage:junit-vintage-engine](https://github.com/junit-team/junit5) from 5.12.0 to 5.12.1.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.12.0...r5.12.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-19 18:34:51 +03:00
dependabot[bot]
f5269a56d6 Bump org.junit.jupiter:junit-jupiter-engine from 5.12.0 to 5.12.1
Bumps [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit5) from 5.12.0 to 5.12.1.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.12.0...r5.12.1)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-engine
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-19 18:34:13 +03:00
Alex Plate
f76b07521e
Fix(VIM-3827): Fix an incorrect implementation of the >= operator
As a note: This is the first bug in IdeaVim that was fixed by AI (with manual verification, of course).
2025-03-10 10:50:26 +02:00
Alex Plate
098243fb12
Fix vim-engine setup if no uploadUrl provided 2025-03-07 18:02:29 +02:00
Alex Plate
9ba0f5f47a
Add information when the characterwise motion changes to the linewise 2025-03-07 10:03:59 +02:00
Alex Plate
4a31e425e0
Support per-caret selection type during yanking 2025-03-07 10:01:36 +02:00
Alex Plate
017b36673b
Remove unused range argument from yank motion 2025-03-07 09:40:27 +02:00
Nath Tumlin
156fbcd60d Make yank motion respect exclusive-linewise
I used the code in VimChangeGroupBase.getDeleteRangeAndType to do the check.

For an example of what this fixes, with the document:
```
    ${c}Hello!
```
executing "y}llp" before this change yields
```
    HelHello!
    lo!
```
but doing it with this change yields
```
    Hello!
    Hello!
````
2025-03-07 09:07:53 +02:00
Alex Plate
cda85ae534
Fix missing offset adjusting
This issue was found by property test
2025-03-04 18:46:34 +02:00
Alex Plate
f88a1cbe06
Add more wrappings for read actions 2025-03-04 15:36:18 +02:00
Alex Plate
6f193d8026
Update kotlin API version in vim-engine 2025-02-28 20:15:09 +02:00
Alex Plate
38102afc0f
Upgrade version of kotlin to 2.0.21 2025-02-28 19:22:16 +02:00
Alex Plate
89e530276f
Get rid of the AppCode-specific code
AppCode was sunset, so there is no need to support it in IdeaVim
2025-02-28 17:14:06 +02:00
dependabot[bot]
0b817ba575 Bump org.junit.jupiter:junit-jupiter-engine from 5.10.5 to 5.12.0
Bumps [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit5) from 5.10.5 to 5.12.0.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.10.5...r5.12.0)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-engine
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-26 18:49:11 +02:00
dependabot[bot]
5b5ff852f1 Bump org.junit.vintage:junit-vintage-engine from 5.10.5 to 5.12.0
Bumps [org.junit.vintage:junit-vintage-engine](https://github.com/junit-team/junit5) from 5.10.5 to 5.12.0.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.10.5...r5.12.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-26 18:15:11 +02:00
dependabot[bot]
7cbc799298 Bump org.junit.jupiter:junit-jupiter-api from 5.10.5 to 5.12.0
Bumps [org.junit.jupiter:junit-jupiter-api](https://github.com/junit-team/junit5) from 5.10.5 to 5.12.0.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.10.5...r5.12.0)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-26 18:14:48 +02:00
Matt Ellis
ca4de6f317 Add missing shortcuts for WORD left/right in Select 2025-02-25 15:38:49 +02:00
Alex Plate
4ca25eed70
Remove the use of write action in macros 2025-02-24 14:31:14 +02:00
Alex Plate
a925676d64
Fix issues with command line prompt processing 2025-02-24 13:59:31 +02:00
Alex Plate
6feb1a4525
Remove the change of ordering inside the clearPromptCharacter 2025-02-24 12:43:39 +02:00
Alex Plate
4cf7685aaf
Fix incorrect condition in getting the actual text in command line 2025-02-24 12:21:34 +02:00
Alex Plate
e257a10525
Fix an issue that the highlighting was silently missing due to an error 2025-02-24 12:13:51 +02:00
Alex Plate
42d80f6866
Add write action in several places 2025-02-21 19:32:47 +02:00
Alex Plate
c9189ed7cb
Commands don't start the read and write actions automatically. See the explanation in the previous commit messages.
Related to the implementation of VIM-3376
2025-02-21 19:11:28 +02:00
Alex Plate
fedefea0aa
Remove the write action in several places 2025-02-21 18:56:52 +02:00
Alex Plate
437fa9a1a0
Remove the root write and read actions
Historically, IdeaVim was starting read or write action based on command type. However, this is incorrect because of several reasons:
- The command of different type may perform a write/read action
- The write lock with a lot of code inside does cause application freezes
- Since a large branching of code happens inside the write action, there is a chance of read action request, resulting in the deadlock

Also, now this prevents from implementing a proper execution of VIM-3376.
2025-02-21 18:44:51 +02:00
Alex Plate
564ab7d75e
Remove EDT and write action from the VimTestCase 2025-02-21 09:54:12 +02:00
Matt Ellis
24c0d31f14 Updated comment and defaults for word end action
The `ge` motion incorrectly had `stopAtEmptyLine` set to false, but `ge` always stops at empty lines. This option is only applicable for forward motion, so is ignored by the implementation of `findPreviousWordEndOne`.
2025-02-21 09:53:11 +02:00
Matt Ellis
43a2bd98db Reduce multiple implementations to one 2025-02-21 09:53:11 +02:00
Matt Ellis
c4f56c40fd Rename findWordUnderCursor to findWordObject
Starting to distinguish between the other findWordUnderCursor implementations!
2025-02-21 09:53:11 +02:00
Matt Ellis
1b4b66dbb1 Minor refactoring 2025-02-21 09:53:11 +02:00
Matt Ellis
4787a5e22a Rewrite backwards search for word under cursor 2025-02-21 09:53:11 +02:00
Matt Ellis
d2b85cbb10 Merge inner and outer motion implementations 2025-02-21 09:53:11 +02:00
Matt Ellis
0428c2aeff Rewrite inner motion to match outer motion
The implementations are so similar and can now be refactored/simplified
2025-02-21 09:53:11 +02:00
Matt Ellis
1a8789b50c Rewrite next/previous word motions and objects 2025-02-21 09:53:11 +02:00
Matt Ellis
b5937e885d Rewrite displayLocationInfo to avoid findNextWord
Simplifies and fixes counting words, especially when selection intersects words. Also moves implementation to engine and adds more tests.
2025-02-21 09:53:11 +02:00
Matt Ellis
8eef802ac7 Add notes on possible refactoring 2025-02-21 09:53:11 +02:00
Matt Ellis
cad6afdc9d Rewrite word end motions and word objects 2025-02-21 09:53:11 +02:00
Matt Ellis
426c2fd006 Handle blank and empty lines for text objects
Fixes VIM-1642
2025-02-21 09:53:11 +02:00
Matt Ellis
f25c56b545 Refactor checks for including following whitespace 2025-02-21 09:53:11 +02:00
Matt Ellis
960eb50d8c Fix incorrectly selected new line char with viw 2025-02-21 09:53:11 +02:00
Matt Ellis
18b4b76ebf Select trailing whitespace with viw
Inner word/WORD motions will select trailing whitespace at the end of a line without wrapping
2025-02-21 09:53:11 +02:00
Matt Ellis
d9e575d4a2 Select leading whitespace with viw
Inner word/WORD motions will select leading whitespace at the start of a line without wrapping
2025-02-21 09:53:11 +02:00
Matt Ellis
1769804c8a Select leading whitespace with vaw
Outer word/WORD motions will select leading whitespace at the start of a line
2025-02-21 09:53:11 +02:00
Matt Ellis
81e094ac8f Select trailing whitespace with vaw
Outer word/WORD motions will select trailing whitespace at the end of a line
2025-02-21 09:53:11 +02:00
Matt Ellis
4240c429ba Select preceding whitespace if no following (vaw)
Outer word/WORD text objects should select following whitespace, unless there isn't any, and then it should select preceding whitespace.
2025-02-21 09:53:11 +02:00
Matt Ellis
76f7d81129 Minor code cleanup. No logic changes 2025-02-21 09:53:11 +02:00
Matt Ellis
580764b30c Match empty line as word/WORD
Unless moving to end of word/WORD, in which case, skip all whitespace to get to end of the next set of word/WORD characters.

Fixes VIM-1650
2025-02-21 09:53:11 +02:00
Matt Ellis
afd69eef95 Fix end of file edge case deleting previous word
Adds extra tests to confirm that deleting previous word in Insert mode was already working as expected (relates to VIM-1650)

Also fixes an edge case for a test that was marked as behaving differently to Vim, but was actually showing buggy behaviour due to its unorthodox caret placement. It looked like the caret was placed at the end of the line, but it was actually placed _passed_ the last character in the file. Adding extra text below the caret placement would cause the action to behave as expected, and the test would then match Vim behaviour. However, it is possible to get this caret position in the editor and in Vim, with `virtualedit=onemore`, and the IdeaVim implementation was wrong. The test has been updated to provide the correct scenario, and the implementation has been fixed.
2025-02-21 09:53:11 +02:00
Matt Ellis
be1cc67566 Fix previous word end motion at start of file 2025-02-21 09:53:11 +02:00
Matt Ellis
b534708a99 Rename file to show it contains several actions 2025-02-21 09:53:11 +02:00
Matt Ellis
5740372df9 Add err_teapot function 2025-02-20 19:21:31 +02:00
Matt Ellis
06791b9378 Add float2nr function 2025-02-20 19:21:31 +02:00
Matt Ellis
91e927c913 Add fmod function 2025-02-20 19:21:31 +02:00
Matt Ellis
9a5c558060 Add float classification functions 2025-02-20 19:21:31 +02:00
Matt Ellis
d1127a5238 Add power functions 2025-02-20 19:21:31 +02:00
Matt Ellis
613a8b5792 Add exponential functions 2025-02-20 19:21:31 +02:00
Matt Ellis
6f63371e9b Add rounding functions 2025-02-20 19:21:31 +02:00
Matt Ellis
3b96e2eacd Add trigonometric and hyperbolic builtin functions 2025-02-20 19:21:31 +02:00
Matt Ellis
4453862ea0 Extract function tests 2025-02-20 19:21:31 +02:00
Matt Ellis
c631d0738e Group function handlers like in Vim help
See `:help function-list`
2025-02-20 19:21:31 +02:00
Matt Ellis
1bd7a7596b Support binary numbers in vimscript
Also supports octal with an `0o` or `0O` prefix.
2025-02-20 19:21:31 +02:00
Matt Ellis
23329cc522 Add bitwise functions 2025-02-20 19:21:31 +02:00
Alex Plate
ee548b52db
[VIM-3784] Store the information about the first version of IdeaVim for the user. 2025-01-27 11:09:47 +02:00
dependabot[bot]
3b1e319a8e Bump org.jetbrains:annotations from 26.0.1 to 26.0.2
Bumps [org.jetbrains:annotations](https://github.com/JetBrains/java-annotations) from 26.0.1 to 26.0.2.
- [Release notes](https://github.com/JetBrains/java-annotations/releases)
- [Changelog](https://github.com/JetBrains/java-annotations/blob/master/CHANGELOG.md)
- [Commits](https://github.com/JetBrains/java-annotations/compare/26.0.1...26.0.2)

---
updated-dependencies:
- dependency-name: org.jetbrains:annotations
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-22 18:08:22 +02:00
Matt Ellis
33b34b84b5 Add doc comment for inCommandLineModeWithVisual 2025-01-22 17:42:30 +02:00