mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
#2556 - Support modifiers for formatted filenames
This commit is contained in:
12
doc/ale.txt
12
doc/ale.txt
@@ -342,6 +342,8 @@ are supported for running the commands.
|
||||
file will be created, containing the lines from the file
|
||||
after previous adjustment have been done.
|
||||
|
||||
See |ale-command-format-strings| for formatting options.
|
||||
|
||||
`read_temporary_file` When set to `1`, ALE will read the contents of the
|
||||
temporary file created for `%t`. This option can be used
|
||||
for commands which need to modify some file on disk in
|
||||
@@ -3739,6 +3741,16 @@ ale#linter#Define(filetype, linter) *ale#linter#Define()*
|
||||
command, so literal character sequences `%s` and `%t` can be escaped by
|
||||
using `%%s` and `%%t` instead, etc.
|
||||
|
||||
Some |filename-modifiers| can be applied to `%s` and `%t`. Only `:h`, `:t`,
|
||||
`:r`, and `:e` may be applied, other modifiers will be ignored. Filename
|
||||
modifiers can be applied to the format markers by placing them after them.
|
||||
|
||||
For example: >
|
||||
'command': '%s:h %s:e %s:h:t',
|
||||
<
|
||||
Given a path `/foo/baz/bar.txt`, the above command string will generate
|
||||
something akin to `'/foo/baz' 'txt' 'baz'`
|
||||
|
||||
If a callback for a command generates part of a command string which might
|
||||
possibly contain `%%`, `%s`, `%t`, or `%e`, where the special formatting
|
||||
behavior is not desired, the |ale#command#EscapeCommandPart()| function can
|
||||
|
||||
Reference in New Issue
Block a user