Commit Graph

5170 Commits

Author SHA1 Message Date
renovate[bot]
7e2fa4731e
Update dependency pretty-quick to v3 (#5140)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-21 02:44:12 +00:00
renovate[bot]
eff57430e9
Update dependency pretty-quick to v2.0.2 (#5139)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-20 21:02:22 -04:00
renovate[bot]
f802b578a6
Update dependency typescript to v4 (#5138)
https://devblogs.microsoft.com/typescript/announcing-typescript-4-0/#whats-new
2020-08-20 13:38:11 -04:00
renovate[bot]
f103a1c0c0
Update dependency webpack-merge to v5.1.2 (#5135)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-18 17:46:25 +00:00
Jason Fields
41dbba15b7 Refactor: stop returning VimState from actions
We ALWAYS mutate VimState, we never make a new one in an Action, so returning the parameter back to ModeHandler is useless noise.
Refs #4698
2020-08-17 20:55:03 -04:00
renovate[bot]
066075a43b
Update dependency @types/mocha to v8.0.3 (#5132)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-17 21:15:37 +00:00
Jason Fields
b1f5d95ed7 Refactor: stop passing VimState around in ModeHandler
This is entirely unnecessary, as each ModeHandler only ever deals with a single VimState, and that's `this.vimState`, which is never re-assigned.
Baby step toward #4698
2020-08-17 14:58:09 -04:00
Jason Fields
c7e5ca2435 Sort registers properly in :reg[isters] command 2020-08-17 12:12:29 -04:00
Jason
605064d91a Save registers (except for macros) across sessions
Fixes #4704
2020-08-16 19:49:52 -04:00
Jason
84e3e722b3 Better error handling when a register has no value
Register.get() will now return undefined when the given register has no value, which lets us throw E353, etc.
2020-08-16 18:46:44 -04:00
berknam
91ca71f860
Overhaul remapping logic (#4735)
This is a pretty massive change; see pull request #4735 for full details

Most notably:
- Support for operator-pending mode, including remaps and a half-cursor decoration
- Correct handling of ambiguous remaps with timeout
- Correct handling of recursive special case when the RHS starts with the LHS
- Correct handling of multi-key remaps in insert mode
- Failed movements that occur partway through a remap stop & discard the rest of the remap
- Implement `unmap` and `mapclear` in .vimrc

Refs #463, refs #4908
Fixes #1261, fixes #1398, fixes #1579, fixes #1821, fixes #1835
Fixes #1870, fixes #1883, fixes #2041, fixes #2234, fixes #2466
Fixes #2897, fixes #2955, fixes #2975, fixes #3082, fixes #3086
Fixes #3171, fixes #3373, fixes #3413, fixes #3742, fixes #3768
Fixes #3988, fixes #4057, fixes #4118, fixes #4236, fixes #4353
Fixes #4464, fixes #4530, fixes #4532, fixes #4563, fixes #4674
Fixes #4756, fixes #4883, fixes #4928, fixes #4991, fixes #5016
Fixes #5057, fixes #5067, fixes #5084, fixes #5125
2020-08-16 14:22:51 -04:00
Jason
2254e8e9f6 Merge Register.get() and Register.getByKey()
Just a small refactor to simplify the register API slightly
2020-08-16 13:44:41 -04:00
J.R. Maingat
e0da682ac0
Fix :p[ut] command neovim capability and subparser (#5063)
Enables neovim capability and fixes arg parsing for the `:p[ut]` command. Apparently the put command allows no whitespace between the command name and the register name, so commands like `:put"` are perfectly valid. I've added some subparser tests to document this.

Fixes #5052
Fixes #5090
2020-08-14 23:36:48 -04:00
Jason Fields
b74ccf6244 A bit of cleanup in jump tracking logic 2020-08-13 22:35:30 -04:00
Jason Fields
ac9c405901 Remove a bunch of type assertions, enable tslint rule disallowing unnecessary type assertions 2020-08-13 19:58:05 -04:00
Jason Fields
3ed96eccf2 Make BaseAction abstract 2020-08-13 19:03:05 -04:00
Jason Fields
e2ce8865f8 Get rid of Actions class, in favor of directly exporting getRelevantAction()
Refs #4429
2020-08-13 18:55:31 -04:00
Jason Fields
7522ec79cf Make BaseOperator abstract 2020-08-13 18:03:30 -04:00
Jason Fields
c3d6e13e8c Remove BaseAction.isOperator
This seems to be an unused relic, good riddance.
2020-08-13 16:38:03 -04:00
Jason Fields
7e88c8485b A bit of cleanup to 'put' commands
I may end up writing this from scratch rather than trying to salvage the existing code, but this attempt at making it slightly more legible should be useful regardless.
2020-08-13 16:22:01 -04:00
Jason Fields
43e0912dee Add [P and ]P as aliases for [p 2020-08-13 01:19:55 -04:00
Jason Fields
36ce7f6db9 Move put commands (p, P, gp, gP, ]p, [p) into their own file 2020-08-12 21:12:08 -04:00
Jason Fields
1b39f67081 Move BaseCommand from actions.ts to base.ts
That's surely where it belongs, and in general, I'd like to split actions.ts up.
2020-08-12 20:56:45 -04:00
Jason Fields
50edf6422a Fix error when file is shortened by an external program
This solution isn't perfect (see TODO), but it does improve matters.
Fixes #5086
2020-08-12 17:59:16 -04:00
Jason Fields
897af3e039 Lift error handling logic into taskQueue
After all, not all errors happen when running an Action
2020-08-11 23:50:49 -04:00
renovate[bot]
7227749c34
Update dependency @types/mocha to v8.0.2 (#5120)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-11 23:50:04 -04:00
renovate[bot]
c0a8e7e9e4
Update dependency sinon to v9.0.3 (#5121)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-11 23:49:33 -04:00
berknam
3879f4374b
Change easymotion default decorations (#5108)
- Make easymotion default decorations have the same defaults as the Vim
plugin.
- Deprecate no longer needed configurations like
'easymotionMarkerMargin' and 'easymotionMarkerWidthPerChar'.
- Change 'easymotionMarkerFontWeight' default to 'bold'
- Add seperate color for each character of two-character markers,
default values are the same as the Vim plugin. (two different yellows)
- Add color for dimmed characters, default value is the same as the Vim
plugin. (grey)
- Add color for higlighting characters searched with search n-characters
command, default value is the same as the Vim
plugin. (green)
- Add changes to README file and update the default values.
- Change easymotion TextEditorDecorations to make them simpler to use
and understand. Remove all unnecessary parts.
- Fix the dimming zones that were including the markers as well.
- Fix the hack for two consecutive markers that wasn't checking if those
markers were on the same line.

Fixes #5092
Fixes #5022
Fixes #4252
Fixes #1746
2020-08-11 23:36:04 -04:00
Jason Fields
ff37d589cc Refactor register code by using a Map
Even after this commit, our handling of registers is horrendously over-complicated and inconsistent, but this is a definite step in the right direction.
2020-08-07 23:37:29 -04:00
Jason Fields
59b8d3115c Enable --resolveJsonModule to get type safety on package.json import 2020-08-07 21:39:26 -04:00
renovate[bot]
178ffb3ef0
Update dependency @types/lodash to v4.14.159 (#5114)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-06 02:00:03 +00:00
Jason Fields
6bc75a7560 Add button to error popup to automatically report issue (with stack trace!)
This should hopefully make those mysterious "Failed to handle key" bugs easier to understand and fix, since we'll at least know what the stack looked like.
2020-08-05 13:46:34 -04:00
renovate[bot]
438d1ffe46
Update dependency mocha to v8.1.1 (#5112)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-04 20:38:21 +00:00
Jason Fields
bc5f3e0679 Maintain visual selection after failed movement
Fixes #4512
2020-08-04 13:36:15 -04:00
renovate[bot]
f525b61d25
Update dependency webpack-merge to v5.1.1 (#5110)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-04 07:46:29 +00:00
renovate[bot]
3242adecb9
Update dependency webpack-merge to v5.1.0 (#5107)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-03 07:36:49 +00:00
renovate[bot]
b2772dc527
Update dependency ts-loader to v8.0.2 (#5101)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-01 13:19:29 +00:00
renovate[bot]
6e7492e3ab
Update dependency @types/mocha to v8.0.1 (#5099)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-31 22:14:49 +00:00
renovate[bot]
6ecbac83e0
Update dependency tslint to v6.1.3 (#5096)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-31 18:39:04 +00:00
renovate[bot]
50b9a93ecd
Update dependency mocha to v8.1.0 (#5091)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-30 22:46:22 +00:00
renovate[bot]
8f3d5a5d50
Update dependency webpack to v4.44.1 (#5089)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-30 11:22:49 +00:00
Kevin
b68124b6b7
Fix cursor position after surround in Visual mode (#5076)
Fixes #4869
2020-07-26 15:33:14 -04:00
Jason Fields
c588c2bb12 Remove references in README.md to deprecated settings 2020-07-26 14:56:16 -04:00
Jason Fields
c54465dce2 Single character visual mode should create a selection of that character
Fixes #3177
2020-07-25 17:09:22 -04:00
Jason Fields
3f53243192 Fix gj and gk in visual mode
Our stupid representation of visual selections has bitten our ass once again.
Fixes #4544
2020-07-25 17:08:25 -04:00
berknam
35d06e6780
Implement better synchronization of selections (#5015)
- Store our selections when calling 'updateView' to be later ignored.
- Create a 'ignoreIntermediateSelections' flag that is set when running
an action to ignore any selection changes triggered by any step of that
action.
- When getting a selection change event we first check if it is one of
our selections. If it is we ignore it, if it is not we still ignore it
if the 'ignoreIntermediateSelections' flag is set or if we have other
selections to ignore, because that means this selection slipped in after
the end of the action. Otherwise we handle it.
- Create new handle for selection changes with kind 'Command'. (this is
triggered by editor commands like 'smartSelect.grow' but is also
triggered when we set the 'editor.selections' on 'updateView', except
this last one will now be ignored)

Fixes #1806
2020-07-25 14:45:52 -04:00
renovate[bot]
94b3c684ec
Update dependency webpack to v4.44.0 (#5074)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-24 18:47:47 +00:00
berknam
0a5093f4b1
Fix visual mode not preserving desiredColumn (#5049)
When moving horizontally on visual mode the desiredColumn wasn't being kept correctly, because we were updating the desiredColumn after correcting our cursors by shifting the stop to the right so that vscode included our stop on its selection.

Fixes #5048
2020-07-23 00:37:21 -04:00
Jason Fields
1119d1833b Revert "Remove check for lookbehind support in regex"
This reverts commit 1d273ebb33.

Turns out we need this check for VSCodeVim in older browsers.

Refs #3525
2020-07-22 11:57:29 -04:00
J.R. Maingat
5810f60518
Enable neovim capability for bang command (#5062) 2020-07-22 10:51:58 -04:00