Skip to content

Commit e339887

Browse files
authored
Merge pull request #25 from harmonwood/master
Fixed a bug 21: remappings in normal mode
2 parents 84b5388 + da19c48 commit e339887

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

plugin/php-refactoring-toolbox.vim

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -108,27 +108,27 @@ function! PhpDocAll() " {{{
108108
call s:PhpEchoError(g:vim_php_refactoring_phpdoc . '() vim function doesn''t exists.')
109109
return
110110
endif
111-
normal magg
111+
normal! magg
112112
while search(s:php_regex_class_line, 'eW') > 0
113113
call s:PhpDocument()
114114
endwhile
115-
normal gg
115+
normal! gg
116116
while search(s:php_regex_member_line, 'eW') > 0
117117
call s:PhpDocument()
118118
endwhile
119-
normal gg
119+
normal! gg
120120
while search(s:php_regex_func_line, 'eW') > 0
121121
call s:PhpDocument()
122122
endwhile
123-
normal `a
123+
normal! `a
124124
endfunction
125125
" }}}
126126

127127
function! PhpCreateGetters() " {{{
128-
normal gg
128+
normal! gg
129129
let l:properties = []
130130
while search(s:php_regex_member_line, 'eW') > 0
131-
normal w"xye
131+
normal! w"xye
132132
call add(l:properties, @x)
133133
endwhile
134134
for l:property in l:properties
@@ -147,10 +147,10 @@ endfunction
147147
" }}}
148148

149149
function! PhpCreateSettersAndGetters() " {{{
150-
normal gg
150+
normal! gg
151151
let l:properties = []
152152
while search(s:php_regex_member_line, 'eW') > 0
153-
normal w"xye
153+
normal! w"xye
154154
call add(l:properties, @x)
155155
endwhile
156156
for l:property in l:properties
@@ -220,7 +220,7 @@ endfunction
220220
" }}}
221221

222222
function! PhpExtractUse() " {{{
223-
normal mr
223+
normal! mr
224224
let l:fqcn = s:PhpGetFQCNUnderCursor()
225225
let l:use = s:PhpGetDefaultUse(l:fqcn)
226226
let l:defaultUse = l:use
@@ -235,7 +235,7 @@ function! PhpExtractUse() " {{{
235235
else
236236
call s:PhpInsertUseStatement(l:fqcn)
237237
endif
238-
normal `r
238+
normal! `r
239239
endfunction
240240
" }}}
241241

@@ -245,15 +245,15 @@ function! PhpExtractConst() " {{{
245245
return
246246
endif
247247
let l:name = toupper(inputdialog("Name of new const: "))
248-
normal mrgv"xy
248+
normal! mrgv"xy
249249
call s:PhpReplaceInCurrentClass(@x, 'self::' . l:name)
250250
call s:PhpInsertConst(l:name, @x)
251-
normal `r
251+
normal! `r
252252
endfunction
253253
" }}}
254254

255255
function! PhpExtractClassProperty() " {{{
256-
normal mr
256+
normal! mr
257257
let l:name = substitute(expand('<cword>'), '^\$*', '', '')
258258
call s:PhpReplaceInCurrentFunction('$' . l:name . '\>', '$this->' . l:name)
259259
if g:vim_php_refactoring_auto_validate_visibility == 0
@@ -265,7 +265,7 @@ function! PhpExtractClassProperty() " {{{
265265
let l:visibility = g:vim_php_refactoring_default_property_visibility
266266
endif
267267
call s:PhpInsertProperty(l:name, l:visibility)
268-
normal `r
268+
normal! `r
269269
endfunction
270270
" }}}
271271

@@ -283,12 +283,12 @@ function! PhpExtractMethod() range " {{{
283283
else
284284
let l:visibility = g:vim_php_refactoring_default_method_visibility
285285
endif
286-
normal gv"xdmr
286+
normal! gv"xdmr
287287
let l:middleLine = line('.')
288288
call search(s:php_regex_func_line, 'bW')
289289
let l:startLine = line('.')
290290
call search('(', 'W')
291-
normal "pyi(
291+
normal! "pyi(
292292
call search('{', 'W')
293293
exec "normal! %"
294294
let l:stopLine = line('.')
@@ -310,7 +310,7 @@ function! PhpExtractMethod() range " {{{
310310
call add(l:output, l:var)
311311
endif
312312
endfor
313-
normal `r
313+
normal! `r
314314
if len(l:output) == 0
315315
exec "normal! O$this->" . l:name . "(" . join(l:parameters, ", ") . ");\<ESC>k=3="
316316
let l:return = ''
@@ -322,7 +322,7 @@ function! PhpExtractMethod() range " {{{
322322
let l:return = "return array(" . join(l:output, ", ") . ");\<CR>"
323323
endif
324324
call s:PhpInsertMethod(l:visibility, l:name, l:parametersSignature, @x . l:return)
325-
normal `r
325+
normal! `r
326326
endfunction
327327
" }}}
328328

@@ -341,7 +341,7 @@ endfunction
341341
" }}}
342342

343343
function! PhpDetectUnusedUseStatements() " {{{
344-
normal mrgg
344+
normal! mrgg
345345
while search('^use', 'W')
346346
let l:startLine = line('.')
347347
call search(';\_s*', 'eW')
@@ -355,7 +355,7 @@ function! PhpDetectUnusedUseStatements() " {{{
355355
endif
356356
endfor
357357
endwhile
358-
normal `r
358+
normal! `r
359359
endfunction
360360
" }}}
361361

@@ -390,34 +390,34 @@ endfunction
390390

391391
function! s:PhpDocument() " {{{
392392
if match(getline(line('.')-1), "*/") == -1
393-
normal mr
393+
normal! mr
394394
exec "call " . g:vim_php_refactoring_phpdoc . '()'
395-
normal `r
395+
normal! `r
396396
endif
397397
endfunction
398398
" }}}
399399

400400
function! s:PhpReplaceInCurrentFunction(search, replace) " {{{
401-
normal mr
401+
normal! mr
402402
call search(s:php_regex_func_line, 'bW')
403403
let l:startLine = line('.')
404404
call search('{', 'W')
405405
exec "normal! %"
406406
let l:stopLine = line('.')
407407
exec l:startLine . ',' . l:stopLine . ':s/' . a:search . '/'. a:replace .'/ge'
408-
normal `r
408+
normal! `r
409409
endfunction
410410
" }}}
411411

412412
function! s:PhpReplaceInCurrentClass(search, replace) " {{{
413-
normal mr
413+
normal! mr
414414
call search(s:php_regex_class_line, 'beW')
415415
call search('{', 'W')
416416
let l:startLine = line('.')
417417
exec "normal! %"
418418
let l:stopLine = line('.')
419419
exec l:startLine . ',' . l:stopLine . ':s/' . a:search . '/'. a:replace .'/ge'
420-
normal `r
420+
normal! `r
421421
endfunction
422422
" }}}
423423

@@ -447,7 +447,7 @@ function! s:PhpInsertConst(name, value) " {{{
447447
else
448448
call append(line('.'), 'const ' . a:name . ' = ' . a:value . ';')
449449
endif
450-
normal j=1=
450+
normal! j=1=
451451
endfunction
452452
" }}}
453453

@@ -475,7 +475,7 @@ function! s:PhpInsertPropertyExtended(name, visibility, insertLine, emptyLineBef
475475
call append(a:insertLine + a:emptyLineBefore + 1, '* @var mixed')
476476
call append(a:insertLine + a:emptyLineBefore + 2, '*/')
477477
call append(a:insertLine + a:emptyLineBefore + 3, a:visibility . " $" . a:name . ';')
478-
normal j=5=
478+
normal! j=5=
479479
endfunction
480480
" }}}
481481

@@ -515,25 +515,25 @@ endfunction
515515
" }}}
516516

517517
function! s:PhpSearchInCurrentFunction(pattern, flags) " {{{
518-
normal mr
518+
normal! mr
519519
call search(s:php_regex_func_line, 'bW')
520520
let l:startLine = line('.')
521521
call search('{', 'W')
522522
exec "normal! %"
523523
let l:stopLine = line('.')
524-
normal `r
524+
normal! `r
525525
return s:PhpSearchInRange(a:pattern, a:flags, l:startLine, l:stopLine)
526526
endfunction
527527
" }}}
528528

529529
function! s:PhpSearchInCurrentClass(pattern, flags) " {{{
530-
normal mr
530+
normal! mr
531531
call search(s:php_regex_class_line, 'beW')
532532
call search('{', 'W')
533533
let l:startLine = line('.')
534534
exec "normal! %"
535535
let l:stopLine = line('.')
536-
normal `r
536+
normal! `r
537537
return s:PhpSearchInRange(a:pattern, a:flags, l:startLine, l:stopLine)
538538
endfunction
539539
" }}}

0 commit comments

Comments
 (0)