Skip to content

Commit bfa4783

Browse files
committed
Use %d not %m for last method
This frees %m up to one day stand in for the current model.
1 parent 02af5e5 commit bfa4783

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

autoload/rails.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,6 +1324,7 @@ function! s:readable_default_rake_task(...) dict abort
13241324
let last = self.last_method(lnum)
13251325
if !empty(last)
13261326
let placeholders.m = last
1327+
let placeholders.d = last
13271328
endif
13281329
endif
13291330
let tasks = self.projected('task', placeholders)
@@ -3144,6 +3145,7 @@ function! s:readable_alternate_candidates(...) dict abort
31443145
let lastmethod = self.last_method(a:1)
31453146
if !empty(lastmethod)
31463147
let placeholders.m = lastmethod
3148+
let placeholders.d = lastmethod
31473149
endif
31483150
let projected = self.projected('related', placeholders)
31493151
if !empty(projected)

doc/rails.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -795,19 +795,19 @@ The full list of available options is as follows:
795795
*rails-projection-related*
796796
"related" ~
797797
Determines the destination of the |rails-:R| and :.A commands. In
798-
addition to the standard placeholders, %m can be used for the current
799-
method.
798+
addition to the standard placeholders, %d can be used for the current
799+
'define' match (typically a method).
800800
*rails-projection-test*
801801
"test" ~
802802
Determines the default test file to run with |rails-:Rrunner| and
803803
|rails-:Rake|. Also serves as a default for "alternate".
804804
*rails-projection-task*
805805
"task" ~
806-
Determines the default rake task to run. Provide %l or %m to
807-
substitute the current line or method name, or just a bare % (like
808-
|:_%|) to substitute the current file name. If a list with two tasks
809-
is provided, the first will be used when a line number is given, and
810-
the second when it's omitted.
806+
Determines the default rake task to run. Provide %l or %d to
807+
substitute the current line or 'define' match (typically a method), or
808+
just a bare % (like |:_%|) to substitute the current file name. If a
809+
list with two tasks is provided, the first will be used when a line
810+
number is given, and the second when it's omitted.
811811
*rails-projection-compiler*
812812
"compiler" ~
813813
Determines the |:compiler| plugin to use with |rails-:Rrunner|.

0 commit comments

Comments
 (0)