Skip to content

Commit d0ccc1a

Browse files
fix: rename suda#nopass to suda#noninteractive (#76)
* fix: rename suda#nopass to suda#noninteractive fixes #73. Maintains a fallback to suda#nopass for backwards compatability. * Update suda.vim --------- Co-authored-by: Λlisue (Ali sue・ありすえ) <[email protected]>
1 parent e044d5e commit d0ccc1a

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@ Make sure that the following shows `1`.
7272

7373
### Use sudo without a password
7474

75-
When `let g:suda#nopass = 1` is written in your vimrc, suda won't ask you for a password. Use at your own risk.
75+
When `let g:suda#noninteractive = 1` is written in your vimrc, suda won't ask you for a password. Use at your own risk.

autoload/suda.vim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ endfunction
1818
" {input} (a:1) is a string to pass as stdin to the command
1919
" Returns a list of the command's output, split by NLs, with NULs replaced with NLs.
2020
function! suda#systemlist(cmd, ...) abort
21-
let cmd = has('win32') || g:suda#nopass
21+
let cmd = has('win32') || g:suda#noninteractive
2222
\ ? s:get_command([], a:cmd)
2323
\ : s:get_command(['-p', '', '-n'], a:cmd)
2424
if &verbose
@@ -306,6 +306,7 @@ augroup suda_internal
306306
augroup END
307307

308308
" Configure
309-
let g:suda#nopass = get(g:, 'suda#nopass', 0)
309+
" Use suda#noninteractive if defined, else suda#nopass for backwards compatability, default to 0
310+
let g:suda#noninteractive = get(g:, 'suda#noninteractive', get(g:, 'suda#nopass', 0))
310311
let g:suda#prompt = get(g:, 'suda#prompt', 'Password: ')
311312
let g:suda#executable = get(g:, 'suda#executable', 'sudo')

doc/suda.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ VARIABLE *suda-interface-variable*
175175
A executable of "sudo" command.
176176
Default: "sudo"
177177

178-
*g:suda#nopass*
178+
*g:suda#noninteractive*
179179
If set, suda will not prompt you for a password before saving a file.
180180
It is suppossed to support a setup with passwordless sudo or doas.
181181
Use with care.

0 commit comments

Comments
 (0)