Commit Graph

5605 Commits

Author SHA1 Message Date
Jason Fields
80dae08a5f Fix cursor position after <C-d> and <C-t> in Insert mode 2021-04-22 00:13:02 -04:00
Jason Fields
8d490f20a2 Use multicursorIndex with Y 2021-04-21 23:26:29 -04:00
Jason Fields
7597e2bbe2 Refactor DocumentContentChangeAction to use Transformations
This avoids some issues with edit sequencing when rerunning a change via `.` or `<C-a>`.
Also, `<C-a>` in Insert mode now uses `rerunRecordedState`.
This is all still a bit buggy, but this is a step in the right direction.
Fixes #5224
2021-04-21 23:19:32 -04:00
renovate[bot]
82b86672ce
Update dependency fork-ts-checker-webpack-plugin to v6.2.4 (#6524)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-04-21 17:25:31 -04:00
renovate[bot]
09e56dc153
Update dependency fork-ts-checker-webpack-plugin to v6.2.2 (#6523)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-04-21 17:18:06 -04:00
Jason Fields
e10c07963b Don't collapse cursors after inserting a digraph in Insert mode 2021-04-21 16:27:11 -04:00
Jason Fields
0fa0a2f29d Fix <C-e> and <C-y> in Insert mode with multiple cursors
Fixes #6522
2021-04-21 16:03:41 -04:00
renovate[bot]
0bc0d27309
Update dependency webpack to v5.35.0 (#6517)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-04-21 11:47:12 +00:00
renovate[bot]
b44143a1a2
Update dependency ts-loader to v9.0.2 (#6514)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-04-20 14:48:55 -04:00
renovate[bot]
ac99025472
Update dependency ts-loader to v9.0.1 (#6512)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-04-20 16:34:58 +00:00
Erik Demaine
2d8ce4304a
Support joinspaces in join and reformat paragraph (#5895)
Fixes #2505
2021-04-19 21:43:34 -04:00
Jason Fields
1394efea3a Use multicursor index for a few commands
- `C` in Normal mode
- `s` in Visual/VisualLine mode
2021-04-19 21:10:42 -04:00
Jason Fields
679f5d57db Run prettier 2021-04-19 11:57:04 -04:00
Jason Fields
4332858171 Throw error if vimState.currentMode is set to undefined
A few issues seem to be caused by this (probably due to a bug in easymotion), this should help track down the cause.
2021-04-19 11:44:56 -04:00
renovate[bot]
8592abeb23
Update dependency webpack to v5.34.0 (#6501)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-04-19 11:33:06 -04:00
Jason Fields
9487360e59 Remove namespace
I don't think namespaces are technically deprecated, but they're an unnecessary typescript-only feature that we're using in exactly one place, so let's stop.
2021-04-18 19:18:37 -04:00
renovate[bot]
bb56b499fa
Update dependency ts-loader to v9 (#6498)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-04-18 17:10:13 -04:00
dependabot[bot]
d8855c1499
Bump ssri from 6.0.1 to 6.0.2 (#6495)
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-17 17:46:42 -04:00
Jason Fields
c70e453024 bump version 2021-04-17 17:32:50 -04:00
Jason Fields
008ef8f80c Always copy to " register when yanking, etc.
The register interface is still kind of janky, but whatever.
Fixes #6441
2021-04-17 17:28:45 -04:00
Jason Fields
61aa5d49e6 Fix [count]% formula and make it respect startofline
Fixes #6490
2021-04-17 17:13:09 -04:00
renovate[bot]
8c978b7a7e
Update dependency @types/node to v12.20.10 (#6487)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-04-16 10:11:20 +00:00
renovate[bot]
816ae83712
Update dependency @types/node to v12.20.9 (#6485)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-04-15 15:41:27 -04:00
Jason Fields
77a94a1c4d Fix cursor position after <C-v> in Insert mode 2021-04-15 01:11:13 -04:00
Jason Fields
a1c268f12b Throw error if transformations overlap while running tests 2021-04-14 23:04:21 -04:00
Jason Fields
94d3159f24 Fix linewise gu, gU, and g~
Fixes #6467
2021-04-14 22:36:18 -04:00
Jason Fields
1f5a93e8d3 Fix tests 2021-04-14 22:03:40 -04:00
Jason Fields
5985012cec Fix another bug with clipboard register 2021-04-14 21:49:32 -04:00
Jason Fields
8509ab84b6 Fix <C-v> in Insert mode
This didn't work in multi-cursor mode and would paste as if you'd typed it (matching brackets, etc.).
2021-04-14 21:19:58 -04:00
renovate[bot]
e88bd05da2
Update dependency @types/node to v12.20.8 (#6481)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-04-14 17:41:29 -04:00
renovate[bot]
90dc8dc06e
Update dependency webpack to v5.33.2 (#6480)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-04-14 15:55:38 -04:00
renovate[bot]
21a012fd41
Update dependency @types/sinon to v10 (#6449)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-04-14 12:21:25 +00:00
Jason Fields
aff299a908 Fix clipboard register
Should only overwrite it when the first slot is different from the system clipboard. This was causing issues with multicursor.
2021-04-14 00:52:40 -04:00
Jason Fields
9fb7cb4d2f Collapse all cursors in Normal mode, not just the first
This could cause cursors to get mixed up, leading to weird multicursor bugs
2021-04-14 00:44:39 -04:00
Jason Fields
91cf50a754 Avoid overlapping transformations in Visual mode block-wise put 2021-04-13 23:27:59 -04:00
Jason Fields
8df8ab9ad7 Re-write put from scratch
I finally bit the bullet, deleted all of our put logic, and re-implemented it from scratch.
This includes `p`, `P`, `gp`, `gP`, `]p`, `[`, and `:put`.

In addition to cleaner, more maintainable code, this resulted in:
  - Using replace transformations, which means better performance
  - Fixing VisualBlock put and block-wise put (fixes #1796)
  - Fixing put when the register contains a macro (fixes #3714)
  - Fixing various other corner cases, particularly with regards to cursor placement
  - Beefing up our test suite

I'm sure there are still obscure corner cases that we handle wrong, but it'll be easier going forward to fix them.
2021-04-13 20:19:32 -04:00
renovate[bot]
4b920503fa
Update dependency neovim to v4.10.0 (#6473)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-04-13 13:44:01 -04:00
renovate[bot]
c13471a0de
Update dependency webpack to v5.32.0 (#6469)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-04-12 15:55:28 -04:00
Jason Fields
46224248ff Run prettier 2021-04-12 14:17:08 -04:00
Jason Fields
e5e61a1701 Add exactPosition PositionDiff type
This ignores the Position its applied to and just sets the line/character to its parameters.
Turns out this absurdly simple addition will help us pay off a lot of technical debt.
2021-04-12 13:46:03 -04:00
Jason Fields
18d5531162 Slight PositionDiff refactor
Make constructor private and stop exporting PositionDiffType in favor of using factory methods
2021-04-12 13:43:58 -04:00
Jason Fields
045cabeef5 Big fat refactor of registers
- Each register now points to an array - the i'th slot contains the content for the i'th cursor
- If there are more cursors than slots, the first slot is used as a backup
- Each slot contains either a RecordedState (in the case of a macro) or a string
- Newlines in those strings should be interpreted in the context of the associated RegisterMode
- The interface was changed somewhat to be safer and more consistent

I probably broke *something*, but the tests pass and this refactor enables further improvement of the terrible put logic, so I'll fix things as they come up.
2021-04-09 23:17:59 -04:00
Jason Fields
f4a2b61ce4 Fix cursor position after yanking multiple lines and [count]p
This is all so janky...
2021-04-09 14:40:29 -04:00
renovate[bot]
eb52da5f06
Update dependency webpack to v5.31.2 (#6457)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-04-09 14:08:16 -04:00
Jason Fields
35ff1f51de Attempt to untangle the put logic somewhat
This is easily one of the worst areas of the codebase.
It really needs a fundamental refactor (closer to a rewrite, really), but a good first step is to make it a bit more understandable as-is.
This attempts to change no behavior or even fundamental logic, just to make it a bit easier to reason about.
2021-04-09 12:59:32 -04:00
Jason Fields
9e83bfaed7 Test cases for character-wise put commands with count in normal mode
Several of these result in incorrect cursor positions - this has been noted with comments
2021-04-09 12:22:51 -04:00
renovate[bot]
377c387c66
Update dependency fork-ts-checker-webpack-plugin to v6.2.1 (#6455)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-04-09 09:20:42 -04:00
Jason Fields
1873effd4c Make gP and ]P respond to [count] and dot
Fixes #6416, Fixes #6444
2021-04-09 00:52:53 -04:00
Jason Fields
f5c3cdd841 Remove a few stupid, hardly used methods from Position 2021-04-08 18:46:10 -04:00
Jason Fields
3355569e96 Run prettier 2021-04-08 18:42:22 -04:00