Skip to content

Commit

Permalink
Ensure we're back in magic mode after embedding define_pattern()
Browse files Browse the repository at this point in the history
When the current buffer is an SQL file, `define_pattern()` will
be `s:sql_define`, which uses "very magic" mode.
  • Loading branch information
jasoncodes authored and tpope committed Aug 21, 2021
1 parent 3b37963 commit 03a5c3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autoload/rails.vim
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ function! s:readable_last_method(start) dict abort
let string = matchstr(line,'^\s*\w\+\s*\([''"]\)\zs.*\ze\1')
return 'test_'.s:gsub(string,' +','_')
elseif lnum
return s:sub(matchstr(line,'\%('.self.define_pattern().'\)\zs\h\%(\k\|[:.]\)*[?!=]\='),':$','')
return s:sub(matchstr(line,'\%('.self.define_pattern().'\m\)\zs\h\%(\k\|[:.]\)*[?!=]\='),':$','')
else
return ""
endif
Expand Down

0 comments on commit 03a5c3e

Please sign in to comment.