-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
10 changed files
with
163 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
import * as node from '../commands/register'; | ||
import { RegisterCommand } from '../commands/register'; | ||
import { Scanner } from '../scanner'; | ||
|
||
export function parseRegisterCommandArgs(args: string): node.RegisterCommand { | ||
if (!args) { | ||
return new node.RegisterCommand({}); | ||
export function parseRegisterCommandArgs(args: string): RegisterCommand { | ||
if (!args || !args.trim()) { | ||
return new RegisterCommand({ | ||
registers: [], | ||
}); | ||
} | ||
|
||
let scanner = new Scanner(args); | ||
let name = scanner.nextWord(); | ||
let regs: string[] = []; | ||
let reg = scanner.nextWord(); | ||
while (reg !== Scanner.EOF) { | ||
regs.push(reg); | ||
reg = scanner.nextWord(); | ||
} | ||
|
||
return new node.RegisterCommand({ | ||
arg: name, | ||
return new RegisterCommand({ | ||
registers: regs, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters