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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Multi-Cursor Mode #587

Closed
wants to merge 70 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 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
5eafcb8
Move allCursors to a custom Set datastructure.
johnfn Sep 23, 2016
3a01d83
Use transformations in more places.
johnfn Sep 26, 2016
e4ff4c2
ARGGHHHHHHHHHH
johnfn Sep 28, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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,
"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 @@ -23,6 +23,7 @@ We're super friendly people if you want to drop by and talk to us on our [Slack
* 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
4 changes: 1 addition & 3 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