aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-25 22:00:50 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-25 22:00:50 +1200
commit4e5727fae46e154bf4161b6b481071ed02564069 (patch)
tree62955fe54fd66ad49d4a691da3d1b1e2cf928ede
parentMerge branch 'release/v1.3.0' (diff)
parentBump VERSION (diff)
downloadvim-redact-pass-4e5727fae46e154bf4161b6b481071ed02564069.tar.gz
vim-redact-pass-4e5727fae46e154bf4161b6b481071ed02564069.zip
Merge branch 'release/v2.0.0'v2.0.0
* release/v2.0.0: Split an awkward conditional Move load guard tests inline Move code into autoloaded function Drop Vim 6.x support
-rw-r--r--VERSION2
-rw-r--r--autoload/redact_pass.vim24
-rw-r--r--doc/redact_pass.txt2
-rw-r--r--plugin/redact_pass.vim31
4 files changed, 28 insertions, 31 deletions
diff --git a/VERSION b/VERSION
index f0bb29e..227cea2 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.3.0
+2.0.0
diff --git a/autoload/redact_pass.vim b/autoload/redact_pass.vim
new file mode 100644
index 0000000..8703213
--- /dev/null
+++ b/autoload/redact_pass.vim
@@ -0,0 +1,24 @@
+" Check whether we should set redacting options or not
+function! redact_pass#CheckArgsRedact() abort
+
+ " Ensure there's one argument and it's the matched file
+ if argc() != 1
+ \ || fnamemodify(argv(0), ':p') !=# expand('<afile>:p')
+ return
+ endif
+
+ " Disable all the leaky options globally
+ set nobackup
+ set nowritebackup
+ set noswapfile
+ set viminfo=
+ if has('persistent_undo')
+ set noundofile
+ endif
+
+ " Tell the user what we're doing so they know this worked, via a message and
+ " a global variable they can check
+ echomsg 'Editing password file--disabled leaky options!'
+ let g:redact_pass_redacted = 1
+
+endfunction
diff --git a/doc/redact_pass.txt b/doc/redact_pass.txt
index 03e30f5..5c0a96f 100644
--- a/doc/redact_pass.txt
+++ b/doc/redact_pass.txt
@@ -1,4 +1,4 @@
-*redact_pass.txt* For Vim version 6.0 Last change: 2018 June 24
+*redact_pass.txt* For Vim version 7.0 Last change: 2019 May 25
DESCRIPTION *redact_pass*
diff --git a/plugin/redact_pass.vim b/plugin/redact_pass.vim
index 47c422d..06c5606 100644
--- a/plugin/redact_pass.vim
+++ b/plugin/redact_pass.vim
@@ -8,38 +8,11 @@
" Author: Tom Ryder <tom@sanctum.geek.nz>
" License: Same as Vim itself
"
-if exists('loaded_redact_pass') || &compatible
- finish
-endif
-if !has('autocmd') || v:version < 600
+if exists('loaded_redact_pass') || &compatible || v:version < 700
finish
endif
let loaded_redact_pass = 1
-" Check whether we should set redacting options or not
-function! s:CheckArgsRedact()
-
- " Ensure there's one argument and it's the matched file
- if argc() != 1 || fnamemodify(argv(0), ':p') !=# expand('<afile>:p')
- return
- endif
-
- " Disable all the leaky options globally
- set nobackup
- set nowritebackup
- set noswapfile
- set viminfo=
- if has('persistent_undo')
- set noundofile
- endif
-
- " Tell the user what we're doing so they know this worked, via a message and
- " a global variable they can check
- echomsg 'Editing password file--disabled leaky options!'
- let g:redact_pass_redacted = 1
-
-endfunction
-
" Auto function loads only when Vim starts up
augroup redact_pass
autocmd!
@@ -47,5 +20,5 @@ augroup redact_pass
\ /dev/shm/pass.?*/?*.txt
\,$TMPDIR/pass.?*/?*.txt
\,/tmp/pass.?*/?*.txt
- \ call s:CheckArgsRedact()
+ \ call redact_pass#CheckArgsRedact()
augroup END