Commit Graph
1497 Commits
Author SHA1 Message Date
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 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 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 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 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
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]andgithub-actions[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 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 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
Sebastian Doernerandlippfi cb218697fa [VIM-3731] Add support for "jump to previous/next lowercase mark".
Fixes VIM-3731
2025-01-21 22:48:12 +02: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
Alex Plate ad584d553c Reformat code 2025-01-10 13:28:48 +03:00
Alex Plate 36556d559f Optimize imports 2025-01-10 13:28:47 +03:00
Alex Plate 378611fe8f Remove outdated documentation 2025-01-10 13:28:47 +03:00
Alex Plate ef16181ba2 Clean up code 2025-01-10 13:28:46 +03:00
Alex Plate aaba0a09c2 Remove deprecated function 2025-01-10 13:28:46 +03: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 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