diff options
| author | Victor S <victorplentz@gmail.com> | 2023-10-04 21:38:32 -0300 |
|---|---|---|
| committer | Victor S <victorplentz@gmail.com> | 2023-10-04 21:38:32 -0300 |
| commit | 3cfe7aa460fba552cd1b5ca4e1c772bb20889ba3 (patch) | |
| tree | 905217b9f94020b7d97fbc58a864c6595f0b2c04 /autoload | |
| parent | c194baf8b30a27ed0075ca0eece270431bdaa913 (diff) | |
| download | vim-prettier-3cfe7aa460fba552cd1b5ca4e1c772bb20889ba3.tar.xz | |
refactor: use function to get --stdin-filepath
Added a new function to get the command part of the --stdin-filepath flag. This
is part of a plan to compose the CLI command from an object with flag details.
Diffstat (limited to 'autoload')
| -rw-r--r-- | autoload/prettier/resolver/config.vim | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/autoload/prettier/resolver/config.vim b/autoload/prettier/resolver/config.vim index be36a7c..d790286 100644 --- a/autoload/prettier/resolver/config.vim +++ b/autoload/prettier/resolver/config.vim @@ -28,7 +28,7 @@ function! prettier#resolver#config#resolve(config, hasSelection, start, end) abo \ get(a:config, 'proseWrap', g:prettier#config#prose_wrap) . \ ' --html-whitespace-sensitivity ' . \ get(a:config, 'htmlWhitespaceSensitivity', g:prettier#config#html_whitespace_sensitivity) . - \ ' --stdin-filepath="'.simplify(expand('%:p')).'"' . + \ ' ' . s:Flag_stdin_filepath() . \ ' --require-pragma=' . \ get(a:config, 'requirePragma', g:prettier#config#require_pragma) . \ ' --end-of-line=' . @@ -111,3 +111,10 @@ function! s:Flag_parser(config) abort return '' endif endfunction + +" Returns '--stdin-filepath=' concatenated with the full path of the opened +" file. +function! s:Flag_stdin_filepath() abort + let l:current_file = simplify(expand('%:p')) + return '--stdin-filepath="' . l:current_file . '"' +endfunction |
