@@ -74,34 +74,38 @@ function! repeat#setreg(sequence,register)
74
74
endfunction
75
75
76
76
function ! repeat#run (count )
77
- if g: repeat_tick == b: changedtick
78
- let r = ' '
79
- if g: repeat_reg [0 ] == # g: repeat_sequence && ! empty (g: repeat_reg [1 ])
80
- if g: repeat_reg [1 ] == # ' ='
81
- " This causes a re-evaluation of the expression on repeat, which
82
- " is what we want.
83
- let r = ' "=' . getreg (' =' , 1 ) . " \<CR> "
84
- else
85
- let r = ' "' . g: repeat_reg [1 ]
77
+ try
78
+ if g: repeat_tick == b: changedtick
79
+ let r = ' '
80
+ if g: repeat_reg [0 ] == # g: repeat_sequence && ! empty (g: repeat_reg [1 ])
81
+ if g: repeat_reg [1 ] == # ' ='
82
+ " This causes a re-evaluation of the expression on repeat, which
83
+ " is what we want.
84
+ let r = ' "=' . getreg (' =' , 1 ) . " \<CR> "
85
+ else
86
+ let r = ' "' . g: repeat_reg [1 ]
87
+ endif
86
88
endif
87
- endif
88
89
89
- let c = g: repeat_count
90
- let s = g: repeat_sequence
91
- let cnt = c == -1 ? " " : (a: count ? a: count : (c ? c : ' ' ))
92
- if ((v: version == 703 && has (' patch100' )) || (v: version == 704 && ! has (' patch601' )))
93
- exe ' norm ' . r . cnt . s
94
- else
95
- call feedkeys (s , ' i' )
96
- call feedkeys (r . cnt, ' ni' )
97
- endif
98
- else
99
- if ((v: version == 703 && has (' patch100' )) || (v: version == 704 && ! has (' patch601' )))
100
- exe ' norm! ' .(a: count ? a: count : ' ' ) . ' .'
90
+ let c = g: repeat_count
91
+ let s = g: repeat_sequence
92
+ let cnt = c == -1 ? " " : (a: count ? a: count : (c ? c : ' ' ))
93
+ if ((v: version == 703 && has (' patch100' )) || (v: version == 704 && ! has (' patch601' )))
94
+ exe ' norm ' . r . cnt . s
95
+ else
96
+ call feedkeys (s , ' i' )
97
+ call feedkeys (r . cnt, ' ni' )
98
+ endif
101
99
else
102
- call feedkeys ((a: count ? a: count : ' ' ) . ' .' , ' ni' )
100
+ if ((v: version == 703 && has (' patch100' )) || (v: version == 704 && ! has (' patch601' )))
101
+ exe ' norm! ' .(a: count ? a: count : ' ' ) . ' .'
102
+ else
103
+ call feedkeys ((a: count ? a: count : ' ' ) . ' .' , ' ni' )
104
+ endif
103
105
endif
104
- endif
106
+ catch /^Vim\%((\a\+)\)\=:E\%(384\|385\|486\)/
107
+ echohl ErrorMsg | echo substitute (v: exception , ' ^Vim\%((\a\+)\)\=:' , ' ' , ' ' ) | echohl None
108
+ endtry
105
109
endfunction
106
110
107
111
function ! repeat#wrap (command ,count )
0 commit comments