Skip to content

Commit 03a5c3e

Browse files
jasoncodestpope
authored andcommitted
Ensure we're back in magic mode after embedding define_pattern()
When the current buffer is an SQL file, `define_pattern()` will be `s:sql_define`, which uses "very magic" mode.
1 parent 3b37963 commit 03a5c3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

autoload/rails.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ function! s:readable_last_method(start) dict abort
405405
let string = matchstr(line,'^\s*\w\+\s*\([''"]\)\zs.*\ze\1')
406406
return 'test_'.s:gsub(string,' +','_')
407407
elseif lnum
408-
return s:sub(matchstr(line,'\%('.self.define_pattern().'\)\zs\h\%(\k\|[:.]\)*[?!=]\='),':$','')
408+
return s:sub(matchstr(line,'\%('.self.define_pattern().'\m\)\zs\h\%(\k\|[:.]\)*[?!=]\='),':$','')
409409
else
410410
return ""
411411
endif

0 commit comments

Comments
 (0)