Commit Graph
100 Commits
Author SHA1 Message Date
Matt EllisandAlex Plãte 1e3738314a Add support for := to print line number
Fixes VIM-3921
2025-06-06 15:15:13 +03:00
Matt EllisandAlex Plãte fd5af31247 Report cannot track intention action
If an alt+enter intention is invoked from Search Everywhere, IdeaVim's Track Action ID shows "Cannot detect action ID" instead of explaining that there is no action ID.

Relates to VIM-2541
2025-05-09 12:11:11 +02:00
Matt EllisandAlex Plãte df74b75570 Stop switching fragment editors to Insert mode
Fixes VIM-1217
2025-05-09 12:10:10 +02:00
Matt EllisandAlex Pláte 70d662fe28 Remove obsolete internal options 2025-04-22 15:48:19 +03:00
Matt EllisandAlex Pláte 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 EllisandAlex Pláte 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 EllisandAlex Pláte 0b6ac4a9f4 Rename variable and add comments 2025-04-10 19:32:29 +03:00
Matt EllisandAlex Pláte 2a6f7cc907 Remove unused mappingComplete parameter
Also makes all KeyConsumers internal
2025-04-10 19:32:29 +03:00
Matt EllisandAlex Pláte 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 EllisandAlex Pláte 3155556832 Reformat and update comments for MappingProcessor
Minor refactorings, should be no changes in logic
2025-04-10 19:32:29 +03:00
Matt EllisandAlex Pláte 07190f38c9 Fix :normal command with multi-letter mapping 2025-04-10 19:32:29 +03:00
Matt EllisandAlex Pláte 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
Matt EllisandAlex Pláte 58496fa1a1 Uncomment NormalCommandTest.kt 2025-04-10 19:32:29 +03:00
Matt EllisandAlex Pláte 6d3bde3ad5 Fix incorrect implementation of DoesNotMatchHandler 2025-03-28 19:07:06 +02:00
Matt EllisandAlex Pláte 3b2b863c88 Update truthy expressions 2025-03-28 19:07:06 +02:00
Matt EllisandAlex Pláte a7e1c08589 Simplify unary arithmetic operators 2025-03-28 19:07:06 +02:00
Matt EllisandAlex Pláte 5aa5e82d59 Rename some operator handlers 2025-03-28 19:07:06 +02:00
Matt EllisandAlex Pláte 0db9ad505b Remove unnecessary singleton classes 2025-03-28 19:07:06 +02:00
Matt EllisandAlex Pláte 147eb99745 Simplify case sensitive binary operators 2025-03-28 19:07:06 +02:00
Matt EllisandAlex Pláte bb73bdfb4a Simplify case sensitive comparisons 2025-03-28 19:07:06 +02:00
Matt EllisandAlex Pláte 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 EllisandAlex Pláte e2cc9c648f Introduce toVimString to match toVimNumber 2025-03-28 19:07:06 +02:00
Matt EllisandAlex Pláte a322525c2a Be more explicit with is and isnot implementation 2025-03-28 19:07:06 +02:00
Matt EllisandAlex Pláte 51ea947ccb Move comparison operator data rules to base class 2025-03-28 19:07:06 +02:00
Matt EllisandAlex Pláte f6810798ef Move binary operator conversion rules to base class 2025-03-28 19:07:06 +02:00
Matt EllisandAlex Pláte 2fee525998 Refactor logical operators 2025-03-28 19:07:06 +02:00
Matt EllisandAlex Pláte 9e3ab12451 Combine logical handlers into same file 2025-03-28 19:07:06 +02:00
Matt EllisandAlex Pláte 5f8d552e8a Extract error message 2025-03-28 19:07:06 +02:00
Matt EllisandAlex Pláte 4e847f8ef4 Merge arithmetic operators to same file 2025-03-28 19:07:06 +02:00
Matt EllisandAlex Pláte d5901fc2c9 Merge case-sensitive handlers to same file 2025-03-28 19:07:06 +02:00
Matt EllisandAlex Pláte 3621b91321 Make operator handlers internal 2025-03-28 19:07:06 +02:00
Matt EllisandAlex Pláte 021db84a21 Expand ~ to home directory in XDG_CONFIG_HOME
Addresses VIM-3844, VIM-2001
2025-03-28 18:18:32 +02:00
Matt EllisandAlex Pláte e232cb3ceb Support 32-bit Unicode codepoints in digraphs
Fixes VIM-3842
2025-03-28 18:13:14 +02:00
Matt EllisandAlex Pláte a33b3980ab Fix unhandled key stroke after surround operation
Fixes VIM-3841
2025-03-28 17:51:14 +02:00
Matt EllisandAlex Pláte 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 EllisandAlex Pláte 42229b285b Fix typo 2025-03-28 17:23:41 +02:00
Matt EllisandAlex Pláte 421c3bbfb8 Support <C-U> in commandToKeys 2025-03-28 17:23:41 +02:00
Matt EllisandAlex Pláte dbd097a91a Fix caret position after :move command
Fixes VIM-3837
2025-03-28 17:23:41 +02:00
Matt Ellis 3fa20dd417 Move status bar widgets after dotCover indicator
Rider's dotCover indicator is marked as "last" rather than relative to other dotnet icons. This position pushes out IdeaVim widgets, so make sure we're after "dotCoverIndicator"

See also DCVR-13021
2025-03-10 18:52:46 +00:00
Matt EllisandAlex Pláte ca4de6f317 Add missing shortcuts for WORD left/right in Select 2025-02-25 15:38:49 +02:00
Matt EllisandAlex Pláte 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 EllisandAlex Pláte 43a2bd98db Reduce multiple implementations to one 2025-02-21 09:53:11 +02:00
Matt EllisandAlex Pláte c4f56c40fd Rename findWordUnderCursor to findWordObject
Starting to distinguish between the other findWordUnderCursor implementations!
2025-02-21 09:53:11 +02:00
Matt EllisandAlex Pláte 1b4b66dbb1 Minor refactoring 2025-02-21 09:53:11 +02:00
Matt EllisandAlex Pláte 4787a5e22a Rewrite backwards search for word under cursor 2025-02-21 09:53:11 +02:00
Matt EllisandAlex Pláte d2b85cbb10 Merge inner and outer motion implementations 2025-02-21 09:53:11 +02:00
Matt EllisandAlex Pláte 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 EllisandAlex Pláte 1a8789b50c Rewrite next/previous word motions and objects 2025-02-21 09:53:11 +02:00
Matt EllisandAlex Pláte 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 EllisandAlex Pláte 8eef802ac7 Add notes on possible refactoring 2025-02-21 09:53:11 +02:00
Matt EllisandAlex Pláte cad6afdc9d Rewrite word end motions and word objects 2025-02-21 09:53:11 +02:00
Matt EllisandAlex Pláte 54ef691a98 Add tests for outer word motions and blank lines 2025-02-21 09:53:11 +02:00
Matt EllisandAlex Pláte 426c2fd006 Handle blank and empty lines for text objects
Fixes VIM-1642
2025-02-21 09:53:11 +02:00
Matt EllisandAlex Pláte f25c56b545 Refactor checks for including following whitespace 2025-02-21 09:53:11 +02:00
Matt EllisandAlex Pláte 960eb50d8c Fix incorrectly selected new line char with viw 2025-02-21 09:53:11 +02:00
Matt EllisandAlex Pláte 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 EllisandAlex Pláte 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 EllisandAlex Pláte 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 EllisandAlex Pláte 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 EllisandAlex Pláte 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 EllisandAlex Pláte 76f7d81129 Minor code cleanup. No logic changes 2025-02-21 09:53:11 +02:00
Matt EllisandAlex Pláte 2da77f0f11 Add tests for existing word/WORD text objects 2025-02-21 09:53:11 +02:00
Matt EllisandAlex Pláte 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 EllisandAlex Pláte 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 EllisandAlex Pláte be1cc67566 Fix previous word end motion at start of file 2025-02-21 09:53:11 +02:00
Matt EllisandAlex Pláte b534708a99 Rename file to show it contains several actions 2025-02-21 09:53:11 +02:00
Matt EllisandAlex Pláte 4bc75e0a9b Add tests for existing word/WORD motion behaviour 2025-02-21 09:53:11 +02:00
Matt EllisandAlex Pláte 5740372df9 Add err_teapot function 2025-02-20 19:21:31 +02:00
Matt EllisandAlex Pláte 06791b9378 Add float2nr function 2025-02-20 19:21:31 +02:00
Matt EllisandAlex Pláte 91e927c913 Add fmod function 2025-02-20 19:21:31 +02:00
Matt EllisandAlex Pláte 9a5c558060 Add float classification functions 2025-02-20 19:21:31 +02:00
Matt EllisandAlex Pláte d1127a5238 Add power functions 2025-02-20 19:21:31 +02:00
Matt EllisandAlex Pláte 613a8b5792 Add exponential functions 2025-02-20 19:21:31 +02:00
Matt EllisandAlex Pláte 6f63371e9b Add rounding functions 2025-02-20 19:21:31 +02:00
Matt EllisandAlex Pláte 3b96e2eacd Add trigonometric and hyperbolic builtin functions 2025-02-20 19:21:31 +02:00
Matt EllisandAlex Pláte ffdd6716f5 Refactor some moved tests 2025-02-20 19:21:31 +02:00
Matt EllisandAlex Pláte 4453862ea0 Extract function tests 2025-02-20 19:21:31 +02:00
Matt EllisandAlex Pláte c631d0738e Group function handlers like in Vim help
See `:help function-list`
2025-02-20 19:21:31 +02:00
Matt EllisandAlex Pláte 1bd7a7596b Support binary numbers in vimscript
Also supports octal with an `0o` or `0O` prefix.
2025-02-20 19:21:31 +02:00
Matt EllisandAlex Pláte 23329cc522 Add bitwise functions 2025-02-20 19:21:31 +02:00
Matt EllisandAlex Pláte 33b34b84b5 Add doc comment for inCommandLineModeWithVisual 2025-01-22 17:42:30 +02:00
Matt EllisandAlex Pláte 308996c4c1 Remove Visual when updating incsearch for a command 2025-01-22 17:42:30 +02:00
Matt EllisandAlex Pláte 1f68b756d5 Disable incsearch highlight in Visual mode 2025-01-22 17:42:30 +02:00
Matt EllisandAlex Pláte ed6789cb8b Add tests updating Visual while editing incsearch 2025-01-22 17:42:30 +02:00
Matt EllisandAlex Pláte e9e86b07fb Fix incsearch not updating empty selection
As a by-product, this also fixes an off-by-one error where incsearch would effectively treat all Visual searches as exclusive
2025-01-22 17:42:30 +02:00
Matt EllisandAlex Pláte a969b93ba6 Add tests for updating Visual selection with search 2025-01-22 17:42:30 +02:00
Matt EllisandAlex Pláte 970cfadaec Extract search highlighting related tests 2025-01-22 17:42:30 +02:00
Matt EllisandAlex Pláte 12ed60d88e Remove tests using obsolete newregex option 2025-01-22 17:42:30 +02:00
Matt EllisandAlex Pláte 7548b160ae Fix race condition resetting editor on focus gain
Fixes VIM-3773
2025-01-14 17:21:53 +01:00
Matt EllisandAlex Pláte 296288f428 Ensure correct caret position when exiting Select
Fixes VIM-3042
2025-01-13 18:10:01 +01:00
Matt EllisandAlex Pláte 1d5fc01d65 Fix Del and BS not working in Select mode
Fixes VIM-3618
2025-01-13 18:10:01 +01:00
Matt EllisandAlex Pláte 0b308769b1 Move select toggle implementation 2025-01-10 11:29:44 +03:00
Matt EllisandAlex Pláte eb19d9fb11 Refactor improper usages of toggleVisual 2025-01-10 11:29:44 +03:00
Matt EllisandAlex Pláte bfa271b089 Reorder functions in file. No code changes 2025-01-10 11:29:44 +03:00
Matt EllisandAlex Pláte e299b27a5c Update docs and remove unnecessary null parameter 2025-01-10 11:29:44 +03:00
Matt EllisandAlex Pláte 9306d93cbf Remove unnecessary pushVisualMode helper function 2025-01-10 11:29:44 +03:00
Matt EllisandAlex Pláte a28416dd9f Update mode widget text for Select pending 2025-01-10 11:29:44 +03:00
Matt EllisandAlex Pláte 63b3af3f65 Implement v_CTRL-O
From Select mode, enters Visual for a single command
2025-01-10 11:29:44 +03:00
Matt EllisandAlex Pláte fcc234c4fe Rename submode to selectionType 2025-01-10 11:29:44 +03:00
Matt EllisandAlex Pláte 2e0ef7e0b0 Enter Insert Visual/Select mode with shifted key 2025-01-10 11:29:44 +03:00