File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { Mapping, Mode } from "./types.ts";
4
4
* Parse record displayed by Vim's `map` command and return a `Mapping` instance.
5
5
*/
6
6
export function parse ( record : string ) : Mapping {
7
- const m = record . match ( / ^ ( .) \s + ( \S + ) \s + ( .* ) $ / ) ;
7
+ const m = record . match ( / ^ ( ... ) ( \S + ) \s + ( .* ) $ / ) ;
8
8
if ( ! m ) {
9
9
throw new Error ( `Failed to parse a mapping record '${ record } '` ) ;
10
10
}
Original file line number Diff line number Diff line change @@ -74,6 +74,22 @@ const testcases: [string, Mapping][] = [
74
74
buffer : false ,
75
75
} ,
76
76
] ,
77
+ [ "ov # <Plug>(asterisk-z#)zv" , {
78
+ mode : "ov" ,
79
+ lhs : "#" ,
80
+ rhs : "<Plug>(asterisk-z#)zv" ,
81
+ noremap : false ,
82
+ script : false ,
83
+ buffer : false ,
84
+ } ] ,
85
+ [ "nosa * b" , {
86
+ mode : "nos" ,
87
+ lhs : "a" ,
88
+ rhs : "b" ,
89
+ noremap : true ,
90
+ script : false ,
91
+ buffer : false ,
92
+ } ] ,
77
93
] ;
78
94
for ( const [ record , expected ] of testcases ) {
79
95
Deno . test ( `parse() parses '${ record } ' and return a Mapping instance` , ( ) => {
Original file line number Diff line number Diff line change @@ -8,7 +8,17 @@ export type Mode =
8
8
| "s" // Select
9
9
| "o" // Operator-pending
10
10
| "t" // Terminal-Job
11
- | "l" ; // ":lmap" mappings for Insert, Command-line and Lang-Arg
11
+ | "l" // ":lmap" mappings for Insert, Command-line and Lang-Arg
12
+ // See https://github.com/vim-denops/deno-denops-std/issues/152 for detail
13
+ | "ov"
14
+ | "nv"
15
+ | "no"
16
+ | "os"
17
+ | "ns"
18
+ | "ox"
19
+ | "nx"
20
+ | "nox"
21
+ | "nos" ;
12
22
13
23
export type Mapping = {
14
24
// Modes for which the mapping is defined
You can’t perform that action at this time.
0 commit comments