Commit Graph
2264 Commits
Author SHA1 Message Date
chylex ffd5ccbc81 Fix backwards motions to unmatched parenthesis/brace consuming the character 2026-10-15 08:54:29 +02:00
chylex 183a20c936 Prevent caret from moving left when exiting insert mode at end of empty line 2026-10-14 20:47:01 +02:00
chylex 7658d83564 Make g0/g^/g$ work with soft wraps 2026-10-14 20:47:00 +02:00
chylex 8d0b403c50 Make gj/gk jump over soft wraps 2026-10-14 17:37:23 +02:00
chylex c4362ddc01 Make camelCase motions adjust based on direction of visual selection 2026-10-14 17:37:22 +02:00
chylex 500270f1ec Stop macro execution after a failed search 2026-10-14 17:37:22 +02:00
chylex 08cf6701ed Fix losing yanked text when number of carets changes 2026-10-14 17:37:22 +02:00
chylex 273beba127 Update search register when using f/t 2026-10-14 17:37:22 +02:00
chylex d57361ba0c Add support for count for visual and line motion surround 2026-10-14 17:37:22 +02:00
chylex ddd83eac56 Make 'map' not affect Select mode 2026-10-14 17:37:22 +02:00
AndDe-gourav bb18bb5356 fix none selction on toggling visual form select mode on empty line and test for supporting selecting new line char 2026-10-14 08:31:08 +02:00
AndDe-gourav 2201617e81 join tests and passes deleteJoinRange an exculsive range 2026-10-14 08:31:08 +02:00
AndDe-gourav fe78002de0 fixed caret resting on new line char 2026-10-14 08:31:08 +02:00
AndDe-gourav d2ac6b9fd8 fixed getRange for character wise selection 2026-10-14 08:31:08 +02:00
AndDe-gourav 8914f1da2d fix 'zf' collapse next line in visual mode 2026-10-14 08:31:08 +02:00
AndDe-gourav 3fdb747969 remove todo comment of not selecting new line char 2026-10-14 08:31:08 +02:00
AndDe-gourav f4272fe350 fix 'D' on empty(only new line char) visual line 2026-10-14 08:31:08 +02:00
AndDe-gourav 8b97cd8bed remove restriction not selecting new line char 2026-10-14 08:31:08 +02:00
dependabot[bot] 1033626866 Bump org.junit.vintage:junit-vintage-engine from 6.1.2 to 6.1.3
Bumps [org.junit.vintage:junit-vintage-engine](https://github.com/junit-team/junit-framework) from 6.1.2 to 6.1.3.
- [Release notes](https://github.com/junit-team/junit-framework/releases)
- [Commits](https://github.com/junit-team/junit-framework/compare/r6.1.2...r6.1.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-13 10:57:32 +00:00
claude[bot]andClaude Opus 5.5 7cccaaa814 Support "?" as search history name in history functions
Vim's `:help hist-names` lists "?" alongside "/" as an alias for the
search history, but getTypeByString only recognised "/". As a result,
histadd('?', ...), histdel('?'), histget('?') and histnr('?') failed
instead of operating on the search history.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 12:36:15 +02:00
1grzyb1 06778f5380 Generate ideavim_extensions.json only in root module 2026-10-13 12:16:43 +02:00
1grzyb1 bd0f361afa VIM-4341 Run search count on background thread
For large files running search count blocked edt which caused IDE freezes.
Now we first try to quickly show coutn and if we are not able in given threshold move it to other thread and later on update UI accordingly.
Additionally added tests for large files
2026-10-13 10:37:34 +02:00
claude[bot]andClaude Opus 5.5 644f9cf628 Fix: IndexOutOfBoundsException on % in an empty document
findMatchingPairOnCurrentLine read the character at the caret offset
without checking that the current line has any characters. On an empty
document this indexed past the end of the text. An empty line has no
pair characters to match, so return no match there, as Vim does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 12:30:02 +02:00
claude[bot]andClaude Opus 5 1e46befc77 Keep replaceText character-wise for partial line ranges
determineSelectionType classified every range spanning more than one line as
line-wise. replaceText then built a line-wise VimSelection from it, which
expands to whole lines, so the text before startOffset on the first line and
after endOffset on the last one was silently discarded.

    // "one two three\nfour five six\nseven eight"
    replaceText(8, 18, "XXX")   // "three\nfour"
    // was:      "XXX\nseven eight"
    // expected: "one two XXX five six\nseven eight"

A multi-line range is now line-wise only when it actually covers those lines
completely, which is what ReplaceWithRegister's `2grr` needs; anything that
starts or ends mid-line stays character-wise and replaces exactly the
requested range.

This also drops the `isLine` check that the old code computed but could never
observe as true: it required the range to end with a line break while start
and end sat on the same line, and it was only consulted on the
startLine == endLine branch, where that cannot hold.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-10-09 12:18:29 +02:00
claude[bot]andClaude Opus 5 3058a337d4 Honour allowEnd in CaretTransaction's getLineEndOffset
CaretTransactionImpl declared its own getLineStartOffset, getLineEndOffset
and getLine, duplicating the implementations it already inherits through
`EditorAccessor by EditorAccessorImpl(projectId)`. The copies had drifted:
getLineEndOffset dropped the allowEnd argument and always called the
single-argument VimEditor.getLineEndOffset, so it behaved as allowEnd = true
regardless of what the caller asked for.

The visible effect is that the same EditorAccessor function disagrees with
itself depending on how deeply it is nested:

    change {
      getLineEndOffset(line, allowEnd = false)                  // last character
      withPrimaryCaret { getLineEndOffset(line, allowEnd = false) }  // line break
    }

ReadScopeImpl and TransactionImpl both rely on the delegate, so dropping the
three redundant overrides fixes the argument handling and removes the
duplication that let them drift apart in the first place.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-10-09 12:18:29 +02:00
1grzyb1 21ffd15bdb Add missing function command description 2026-10-09 11:40:31 +02:00
claude[bot]andClaude Opus 5 86e9130d87 Fix slice() treating an end index of zero as the whole collection
`VimList.slice` and `VimString.substring` treated an exclusive end index
of zero as "count from the end", i.e. as the size of the collection. That
convention exists only because `SublistExpression` has to convert Vim's
*inclusive* end index (which defaults to -1, the last item) into an
exclusive one, so `endInclusive + 1` legitimately produces zero for the
common `list[1:]` and `list[1:-1]` cases.

`slice()`, however, takes an end index that is already exclusive, so
`slice([1, 2, 3, 4, 5], 0, 0)` must be an empty list, and
`slice([1, 2, 3, 4, 5], 0, -5)` likewise resolves to an exclusive end of
zero. Both returned the entire collection instead. (See Vim's
`list_slice_or_index` / `eval_index_inner`, which decrement the end index
when it is exclusive and produce an empty result once it drops below
zero.)

Make the end index of `slice`/`substring` an unambiguous absolute index
and move the resolution of Vim's negative indices into the two call
sites, where the inclusive/exclusive distinction is known.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-10-09 10:46:17 +02:00
claude[bot]andClaude Opus 5.5 1a2cc3c401 Fix :tags failing when the line jumped from was deleted
Tag stack entries keep the line number they were recorded with and are not
adjusted on edits. When that line no longer exists, :tags called
getLineText() with an out-of-range line and failed with
"Incorrect line: N, out of M". Show empty text for such entries instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-09 10:40:55 +02:00
claude[bot]andClaude Opus 5.5 5e6c95c187 Fix: crash on empty search range such as :/ or :?
A search range consisting of a single delimiter made SearchAddress call
substring(1, 0), throwing StringIndexOutOfBoundsException. An empty
pattern now uses the last search pattern, as in Vim, and reports E35
when there is none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 10:39:32 +02:00
claude[bot]andClaude Opus 5.5 c78d2f326c Fix infinite loop on :continue inside :for over a List
In ForLoop (List iterable) and ForLoopWithList, the Continue branch used
Kotlin's `continue`, which jumped back to the `while` condition and
skipped `index += 1`. As a result `for x in [1, 2] | continue | endfor`
never terminated. Fall through to the increment instead.

Add regression tests for continue/break when iterating over lists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 10:30:23 +02:00
Matt Ellis ac52d3a0e4 Handle incomplete function definition command 2026-10-09 10:16:30 +02:00
Matt Ellis 165b9b1fa5 Report lambda functions in function command 2026-10-09 10:16:30 +02:00
Matt Ellis 2b5f5401ac Restart anonymous function names from 1 in tests 2026-10-09 10:16:30 +02:00
Matt Ellis 6620891534 Add the function command to list global functions 2026-10-09 10:16:30 +02:00
Matt Ellis f51223ffbb Fix red code referencing generated ANTLR code 2026-10-09 10:16:30 +02:00
1grzyb1 1e3c671c0c VIM-2524 calculate indent after cc
set proper indent after performing cc. previously we were just using that was already set not from code style
2026-10-09 09:49:32 +02:00
1grzyb1 2282456ddd VIM-720 allow pass enter and arrows to IDE 2026-10-06 11:46:19 +02:00
1grzyb1 6f48fd9903 Complete action command ideavimrc file 2026-10-05 12:04:26 +02:00
1grzyb1 fe7bc72193 Complete action command in command line 2026-10-05 12:04:26 +02:00
1grzyb1 ccb0fb1677 Add descriptions to all commands
Each @ExCommand and @CommandOrMotion now describes what it does in IdeaVim, the text is rendered into the help file.
2026-10-05 10:57:50 +02:00
1grzyb1 c1d9ee7378 Generate the help file that :help opens from command annotations
Commands describe themselves in @ExCommand/@CommandOrMotion, generateHelp renders the Vim-style help file and a workflow keeps it up to date on master.
2026-10-05 10:57:50 +02:00
Grzybek e27ffe0549 VIM-1894 include collapsed region during visual selection (#2098) 2026-10-02 08:35:07 +00:00
1grzyb1 2ec828b529 VIM-1314 Replace mode paste with cmd+v
To be vim compatible we need to wrap idea paste during replace mode.
Vim is pasting and replacing text and we were inserting it before cursor.
So to this we wrap paste action handler and in replace mode we handle it by ourselves
2026-10-01 11:54:35 +02:00
Grzybek b00370888a VIM-1306 Add keylog extension (#2096)
Extension that logs all typed keys
2026-10-01 10:56:08 +02:00
Grzybek d99f46937f VIM-1153 replay all keystrokes during . (#2088)
* VIM-1153 replay all keystrokes during .

we were storing actions and commands to replay during . repeat. Due to that we had to do a lot of strange logic to move cursor after ide chagnes. Becouse of that renaming tag element didn't work.

To make it work and more vim like we store real keystrokes and replay them

* VIM-1153 replay autocomplete

in new mechanism C-Y was working on active lookup and during replay there was no lookup. to fix that we go through action path which adds those keys by itself but we need to drop C-Y from RedoBuffer stack as it's replaved by actruall charachters

* VIM-1153 Fix other lookup actions

* VIM-1153 keep lookup commands as separate ones

Extracted all lookup commands as separate handlers as it was confusing to have seprate paths depending on isActiveLookup in handlers
2026-09-29 10:31:40 +00:00
Grzybek 60d17b0c83 VIM-4331 keep the indent of a new line when leaving Insert mode (#2084)
`didAutoIndent` was set for `o`, `O` and Enter as well as for `cc` and `S`,
so leaving Insert mode without typing anything deleted the indent of a line
that had just been opened.

Vim does delete it, and it does so for an indent computed by 'indentexpr' or
'cindent' too (`fixthisline()` in indent.c). This is a deliberate difference:
in the IDE the indent comes from language support, and a line you have just
opened is expected to stay where it is. `cc` and `S` still follow Vim, since
there the line held text a moment ago and its leftover indent is noise.
2026-09-25 10:40:17 +02:00
Grzybek f5fd057ba1 VIM-748 changing multiple commands with | (#2082)
* VIM-748 changing multiple commands with |

Added generic mechanism for chainging multiple commands with |
Main issue was with comamnds like `s` which might have | inside replaced regex
That's why we've adde whole machinery that split it in CommandVisitor.
We couldn't do it it antlr grammar itself as it would require having backwards state of grammer what antlr doesn't allow

* VIM-748 bump ksp version to 2.3.7
2026-09-24 12:36:34 +02:00
grzybekandClaude Opus 5 c7149c3129 VIM-3093 Give search highlights a single owner per editor
Nothing kept the vimLastHighlighters list and the markup model in step, and nothing could answer which part of the document is currently highlighted - both of which scoping the highlights to the viewport needs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 11:58:29 +02:00
grzybek 46cf018d32 VIM-4326 run mapping from select mode in visual mode
Vim when mapping is run on select mode it runs it in visual and then restores
2026-09-18 09:19:01 +02:00
grzybek f13c3e333c VIM-4318 Adjust Visual mark columns when lines merge 2026-09-17 13:17:33 +02:00