Commit Graph

264 Commits

Author SHA1 Message Date
Matteo Planchet
5dd3810926
A few small fixes (#8955)
- Fix a typo in the warning message that appears when the .vimrc file fails to open
- Use loadConfiguration` from `extension.ts` instead of `configuration.load
- Use context.globalStorageUri.fsPath instead of context.globalStoragePath which is deprecated
2024-03-25 20:53:48 -04:00
Jason Fields
445fd3a403 good commit, bad commit message 2023-10-21 22:59:05 -04:00
renovate[bot]
8c544d512e
Update dependency prettier to v3 (#8486) 2023-09-09 19:57:26 -04:00
Jason Fields
f02ed71ed8 Remove "Report bug" popup in favor of simply logging an error message
This has helped resolve a few bugs, but has also generated more spam issues than I can keep up with. To be really useful it needs source maps, which are quite bulky.
If we want to revive something like this, we should use VS Code's relatively new telemetry API.
2023-03-01 17:35:20 -05:00
Jason Fields
5210e120f3 Some logging improvements 2023-02-15 23:22:59 -05:00
Jean Pierre
5985f1416f
Fix extension for web (#7520)
Fixes #7469
2022-02-18 12:12:05 -05:00
Jason Fields
666ea2fa34 Use source maps to get readable stack traces in production
Using the 'source-map' option does blow up the package size quite a bit, but I couldn't find another option that was doing the trick.
Fixes #5887
2021-03-18 19:02:48 -04:00
rebornix
fd9f793e29 fix web compability. 2020-12-07 09:18:49 -08:00
Jason Fields
b9d982fa01 Save registers to disk only once - when the extension is deactivated
Frankly, I'm a bit embarrassed that I wrote code to serialize and save the registers every time one changes. This can actually have a noticeable effect on performance if any registers have even modestly large values.
It seems `globalState` doesn't work in `deactivate`, so we need to store the register data in a file.
Fixes #5707
2020-11-20 22:48:28 -05:00
Peng Lyu
5c7443c344
Preparation for running extension in nodeless environment (#4981)
VS Code is adding support for running extensions in a nodeless environment. This PR tries to refactor the code a bit to allow later on replacing node APIs (fs, child_process) with shims.

This PR should not change any functionality for running Vim in desktop.

Once we can run Vim in a web worker, we can also think about running Vim in its own worker, which at the end will help with the performance issue: https://github.com/microsoft/vscode/issues/65876
2020-06-30 15:58:03 -04:00
Jason Fields
f0c46ca11a Improve syncing of cursors when switching between editors
Visual selections as well as `desiredColumn` would get screwed up because our cursor syncing logic was sloppy.
Visual line mode still gets messed up by this (see #4889)
Fixes #4888
2020-06-14 19:46:37 -04:00
Jason Fields
e3e56eeb44 Remove superfluous view update on active editor change 2020-05-15 21:55:21 -04:00
renovate[bot]
b6d75ca49a
Update dependency prettier to v2 (#4661)
All line endings are now unix-style (\n), and arrow functions always have parentheses around their parameters.
2020-03-26 13:02:33 -04:00
Jason Fields
5a87b6a84f
Refactor ModeHandlerMap to use EditorIdentity in its interface. Add some documentation (#4322) 2019-12-02 22:48:40 -05:00
Jason Fields
516778be1e Rename ModeName to Mode since after the refactor, that separation is gone 2019-11-29 15:59:20 -05:00
Jason Fields
de2cdb7e53 Big refactor of modes to not use OOP
This is a step toward fixing our janky status bar logic. Basically, I want to make information about the current mode easily available from a VimState without needing the ModeHandler.
The Mode class has been destroyed, replaced by some functions that take a ModeName.
More refactoring could be done, I'm sure, but I think this is a BIG step in the right directions.
2019-11-29 15:59:20 -05:00
Jason Fields
b9353ae810 A bit more general clean-up 2019-11-29 00:21:04 -05:00
Jason Fields
2ffbb78833 Just some trivial clean-up 2019-11-28 23:15:15 -05:00
Daniel Smith
3158194561 Read key remappings from .vimrc (#3908)
Read key remapping commands from $HOME/.vimrc, $HOME/_vimrc, or a
user-specified Vim configuration file. For each, build an IKeyRemapping
object and append it to the appropriate collection, _if_ doing so will
not override a remapping specified in the VS Code settings.

Partially addresses #463. This implementation borrows heavily from
Sheepolution/vimrc-to-json.

* Add `editVimrc` command

* Add .vimrc validator, correct usage of new config names

* Source .vimrc automatically after saving it
2019-11-09 23:16:46 -05:00
Sean Kelly
160b9459a0 Simplify storage directory to use supplied extension directory (#4151)
Fixes #4055
2019-10-27 01:01:49 -04:00
Jason Fields
0a6dbca5fd Refactor: Use includes() instead of indexOf() when possible 2019-09-26 22:41:32 -04:00
uHOOCCOOHu
4fb3e0598a Fix wrong cursor positon (#4074)
Fixes #3713 , hopefully.
This happened when you were editing a file in two splits at once. An edit in one split that affected the cursor position in the other split would trigger an extra `onDidChangeTextEditorSelection` event that we should be ignoring.
2019-09-25 00:04:34 -04:00
Jason Fields
7952b6a5f1
Don't use lodash for things modern JS supports natively (#4056)
e.g. filter, includes, find, etc.
After doing this, there was only one usage left (for escaping regex), so I replaced the lodash dependency with one that only exposes that functionality.
2019-09-08 17:36:38 -04:00
yaegaki
468a49b1e6 Assign activeTextEditor to local variable first. (#3866)
* Assign activeTextEditor to local variable first.

because activeTexteditor may have changed after call async method.
fixes VSCodeVim#3865

* Get rid of workaround to wait goToDeclaration

related #3277
2019-07-08 10:51:34 -07:00
Jason Fields
1ef304e5dd Various improvements to registers (#3728)
* Implement / (search) register

Fixes #3542

* Implement read-only registers

Fixes #3604

* Implement % (file name) register

Refs #3605

* Implement : (command) register

Fixes #3605

* Do not display _ (black hole) register in :reg output

Fixes #3606

* :reg can take multiple arguments

When it does, it lists only the registers given as an argument.
Fixes #3610

* Allow the : (command) register to be used as a macro to repeat the command

Fixes #1775
2019-05-05 21:06:42 -07:00
yaegaki
6b812d4190 Assign lastClosedModeHandler when onDidCloseTextDocument. (#3630)
fixes #3507
2019-04-01 22:15:05 -07:00
Jason Poon
cd87eae8cc fix: cursor jumps when selection changes to output window 2019-02-06 20:44:42 -08:00
Jason Poon
0fbe990e78 feat: add tests 2019-02-05 22:48:32 -08:00
Jason Poon
adff6349bc feat: configuration validators 2019-02-05 11:52:34 -08:00
Jason Poon
4d63c47f10 refactor: rename the cursor properties to something more sensible 2019-02-01 21:01:19 -08:00
João Moreno
22b826ca71 Adopt latest list navigation support (#3432)
* adopt list navigation support
2019-02-01 06:37:41 -08:00
Jason Poon
f58400c244 fix: revert back to previous non-async code when syncing cursor. closes #3431 2019-01-31 11:07:47 -08:00
Jason Poon
415852fc9d fix: adjust comments 2019-01-30 12:32:13 -08:00
Jason Poon
7941c0a405 fix: validate configurations once, instead of every key press 2019-01-28 20:43:31 -08:00
Jason Poon
61e8998e6a refactor: make globalstate a singleton class. 2019-01-24 14:57:49 -08:00
xconverge
61cba7a628 Misc async fixes 2019-01-23 19:12:28 -08:00
Jason Poon
270889e087 fix: closes #3157 2019-01-23 15:46:50 -08:00
Jason Poon
5c14677917 refactor: get rid of the god awful async code in ctro 2019-01-23 13:29:24 -08:00
Jason Poon
14ede139d2 refactor: add wrapper for registerEventListener 2019-01-23 12:58:40 -08:00
Jason Poon
de11a5e449 fix: share single event handler and delegate to modehandler for selection changes 2019-01-23 12:29:29 -08:00
Jason Poon
e1b8d6d77c fix: stop logging for unresolved promise for the promise. closes #3333, #3329, #3328 2019-01-05 22:09:28 -08:00
Jason Poon
2390d8ef13 fix: simplify logic of winston transport 2019-01-01 22:11:25 -08:00
Jason Poon
ce8267653d
Merge branch 'master' into error_messages 2019-01-01 21:24:13 -08:00
Jason Poon
48aae0cfa0 refactor: disableExtension configuration should follow pattern of rest of configs 2019-01-01 18:01:18 -08:00
Jason Poon
4e237edb2d fix: making our error messages more presentable 2019-01-01 13:38:50 -08:00
Jason Poon
c84c7d6e7b
Merge branch 'master' into error_messages 2019-01-01 13:17:26 -08:00
Jason Poon
e01299b843 feat: display vim errors as vscode user error windows 2019-01-01 02:59:03 -08:00
Jason Poon
4c94ebbaab fix: log warning if remapped command does not exist. closes #3307 2019-01-01 01:31:20 -08:00
Jason Poon
0c05cbf105 fix: vscode context for vim.mode needs to be mode friendly name. closes #3298 2018-12-28 00:48:26 -08:00
Jason Poon
d1261f25fb fix: ignore remappings with non-existent commands. fixes #3295 2018-12-27 21:43:50 -08:00