Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-Cursor Mode v 2.0 #811

Merged
merged 80 commits into from
Sep 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
8544499
Trigger Multi Cursor Mode when using multiple cursors.
johnfn Aug 10, 2016
8395150
Add Multi Cursor Visual Mode.
johnfn Aug 10, 2016
b6d54fa
Renaming.
johnfn Aug 10, 2016
74a1034
Make motions work in Multi Cursor mode.
johnfn Aug 10, 2016
e485dc6
Make escape work in Multi Cursor Mode.
johnfn Aug 10, 2016
d0c12ba
Fix visual mode.
johnfn Aug 10, 2016
98bc06e
Delete operator works in Multi Cursor Mode.
johnfn Aug 10, 2016
c4c4a2d
Fix cursor adjustment when leaving multi cursor visual mode
johnfn Aug 11, 2016
c821f20
Commands are starting to work.
johnfn Aug 18, 2016
e617e5f
Stay in multi-cursor after an action.
johnfn Aug 18, 2016
02f6011
Refactor; simplify logic; remove extraneous modes.
johnfn Aug 18, 2016
e9a0e13
Display in status bar
johnfn Aug 18, 2016
270f985
Insertion works in multi-cursor mode.
johnfn Aug 19, 2016
f4da6ea
Draw every block cursor in multi visual mode.
johnfn Aug 19, 2016
9ce3c92
/ actually works in multi cursor.
johnfn Aug 19, 2016
8e6bae5
Fix esc in multi cursor mode.
johnfn Aug 19, 2016
234040a
Minor changes
johnfn Aug 21, 2016
e443d9f
Add yank in multi cursor mode.
johnfn Aug 24, 2016
2cdc557
Fix escape wonkiness
johnfn Aug 24, 2016
df6e9bc
Fix some bugs where start position wasn't being set correctly.
johnfn Aug 25, 2016
a1d6f0a
Minor changes.
johnfn Aug 26, 2016
813ffd1
Fix a bug with very fast insertions.
johnfn Aug 26, 2016
fe64d1f
Add helpful comment.
johnfn Aug 26, 2016
d814c13
Refactor parallel array to range.
johnfn Aug 26, 2016
96c3bce
Rethink execCount on BaseCommands.
johnfn Aug 30, 2016
738b89c
Start to separate out text transformations from action specifications.
johnfn Aug 30, 2016
edc93fa
Fix some calls.
johnfn Aug 30, 2016
c1b0d2e
Calculate new position of cursor based on insetion deltas
johnfn Aug 30, 2016
990c7ca
Fix bug with inserting multiple times on same line.
johnfn Aug 31, 2016
3431ad6
Fix cursor merging bug
johnfn Aug 31, 2016
b4bad99
Go back to normal mode when only 1 cursor.
johnfn Aug 31, 2016
4f82591
Always keep all cursors in bounds.
johnfn Aug 31, 2016
a552ac1
Fix count-prefixed motions.
johnfn Aug 31, 2016
29c4fbd
Merge branch 'master' into multi-cursor-mode
johnfn Sep 1, 2016
04b0aa2
Make tests work better.
johnfn Sep 2, 2016
7c8e1ec
Make multi-insertion sorta work with multi-line.
johnfn Sep 3, 2016
49d2c92
Make O work in both normal and multi-cursor mode.
johnfn Sep 3, 2016
e15bcf1
Fix inserting more than 3 newlines.
johnfn Sep 6, 2016
69d8df8
Refactoring.
johnfn Sep 6, 2016
816c303
Refactor and remove a lot of code
johnfn Sep 7, 2016
f8dde28
Fix multi-cursor delete.
johnfn Sep 7, 2016
3dca11b
Store cursor position correctly in undo/redo
johnfn Sep 7, 2016
2e5a7e3
Fix y and p.
johnfn Sep 8, 2016
1a26724
Fix visual block mode
johnfn Sep 8, 2016
63dc583
Fix bug with o.
johnfn Sep 8, 2016
36c69d8
Fix cursor bounding problem
johnfn Sep 8, 2016
55ac615
Fix & speed up a lot of tests.
johnfn Sep 13, 2016
779ad9d
Fix o/O
johnfn Sep 14, 2016
03eaace
Fix bug with o/O
johnfn Sep 15, 2016
6c40dcd
Fix issue with .
johnfn Sep 15, 2016
11d6214
Really fix . this time.
johnfn Sep 15, 2016
227882d
Fix a bunch more tests.
johnfn Sep 15, 2016
9765644
Fix test race condition in worst possible way
johnfn Sep 15, 2016
16c5da0
Merge branch 'master' into multi-cursor-mode
johnfn Sep 15, 2016
0aef37a
Fix all tslint issues
johnfn Sep 15, 2016
5e10ca1
Fix visual block mode.
johnfn Sep 17, 2016
74930e3
Fix repeating in replace mode.
johnfn Sep 17, 2016
feb74e6
Fix ~
johnfn Sep 17, 2016
7f278d1
Move replace mode to new text transformation style.
johnfn Sep 20, 2016
f00c8d3
Completely fix replace mode & add documentation.
johnfn Sep 20, 2016
bdb3864
Merge branch 'master' into multi-cursor-mode
johnfn Sep 20, 2016
8a0a247
Fix an old bad merge.
johnfn Sep 20, 2016
11073c7
Fix movements that use vimstate.CursorPosition in multi cursor mode.
johnfn Sep 20, 2016
e8b3939
Minor text updates
johnfn Sep 20, 2016
49b3b2f
Fix remapping in multi-cursor mode.
johnfn Sep 21, 2016
37d8c4a
Fix : in multi-cursor mode.
johnfn Sep 21, 2016
26b35b8
Fix character replace in multi-cursor mode.
johnfn Sep 21, 2016
d1be4b6
Fix stacked cursor problem.
johnfn Sep 28, 2016
7f2798e
Make Ranges immutable.
johnfn Sep 28, 2016
fc5134e
Fix x/d in Visual Block Mode.
johnfn Sep 28, 2016
aae75ba
Fix c in visual block mode.
johnfn Sep 28, 2016
1a501fc
Fix change operator in visual block mode
johnfn Sep 28, 2016
9775671
Fix C/c in Visual Block Mode.
johnfn Sep 28, 2016
cb5719e
Fix replace in visual block mode.
johnfn Sep 29, 2016
80954f7
Fix bug with inserting text.
johnfn Sep 29, 2016
997f5da
Fix replace in Visual Block Mode.
johnfn Sep 29, 2016
8cbd156
Fix x in visual block mode.
johnfn Sep 30, 2016
2430e3f
Merge branch 'master' into multi-cursor-mode-simple
johnfn Sep 30, 2016
3d57c89
Bring engine version up to 1.5.0.
johnfn Sep 30, 2016
62139b5
Fix some dumb travis stuff
johnfn Sep 30, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
out
testing
node_modules
*.sw?
.vscode-test
.DS_Store
*.vsix
*.log
testing
test2
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@
}
],

"vim.hlsearch": false,
Copy link
Member

@jpoon jpoon Sep 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we be checking in these settings? They are very much user-specific.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My settings.json is objectively the best though... 😉

Okay, okay, we should probably add it to .gitignore. :P

"editor.cursorStyle": "block",

"typescript.tsdk": "./node_modules/typescript/lib", // we want to use the TS server from our node_modules folder to control its version
"editor.tabSize": 2,
"editor.insertSpaces": true,
"vim.useCtrlKeys": true,
"files.trimTrailingWhitespace": true
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ We're super friendly people if you want to drop by and talk to us on [Slack](htt
* Correct undo/redo state
* Marks
* Vim Options
* Multiple Cursor mode (allows multiple simultaneous cursors to receive Vim commands. It's like macros, but in real time. Allows `/` search, has independent clipboards for each cursor, etc.)

## Roadmap

Expand Down
6 changes: 2 additions & 4 deletions extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import * as vscode from 'vscode';
import * as _ from "lodash";
import { showCmdLine } from './src/cmd_line/main';
import { ModeHandler } from './src/mode/modeHandler';
import { TaskQueue } from './src/taskQueue';
import { taskQueue } from './src/taskQueue';
import { Position } from './src/motion/position';
import { Globals } from './src/globals';
import { AngleBracketNotation } from './src/notation';
Expand Down Expand Up @@ -66,8 +66,6 @@ let extensionContext: vscode.ExtensionContext;
let modeHandlerToEditorIdentity: { [key: string]: ModeHandler } = {};
let previousActiveEditorId: EditorIdentity = new EditorIdentity();

let taskQueue = new TaskQueue();

export async function getAndUpdateModeHandler(): Promise<ModeHandler> {
const oldHandler = modeHandlerToEditorIdentity[previousActiveEditorId.toString()];
const activeEditorId = new EditorIdentity(vscode.window.activeTextEditor);
Expand Down Expand Up @@ -220,7 +218,7 @@ async function handleKeyEvent(key: string): Promise<void> {
const mh = await getAndUpdateModeHandler();

taskQueue.enqueueTask({
promise : async () => { await mh.handleKeyEvent(key); },
promise : async () => { console.log(key); await mh.handleKeyEvent(key); },
isRunning : false
});
}
Expand Down
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"url": "https://github.com/VSCodeVim/Vim/issues"
},
"engines": {
"vscode": "^1.0.0"
"vscode": "^1.5.0"
},
"categories": [
"Other"
Expand All @@ -46,6 +46,11 @@
"command": "extension.vim_escape",
"when": "editorTextFocus && !inDebugRepl && !suggestWidgetVisible"
},
{
"key": "cmd+d",
"command": "extension.vim_cmd+d",
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "Backspace",
"command": "extension.vim_backspace",
Expand Down Expand Up @@ -244,7 +249,8 @@
"child-process": "^1.0.2",
"copy-paste": "^1.3.0",
"diff-match-patch": "^1.0.0",
"lodash": "^4.12.0"
"lodash": "^4.12.0",
"vscode": "^0.11.16"
},
"devDependencies": {
"gulp": "^3.9.1",
Expand Down
Loading