From 1f2ab8d4fecbc7b1061dd4108d33962621017d25 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 25 May 2019 21:53:03 +1200 Subject: Drop Vim 6.x support --- doc/redact_pass.txt | 2 +- plugin/redact_pass.vim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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..42064e4 100644 --- a/plugin/redact_pass.vim +++ b/plugin/redact_pass.vim @@ -11,7 +11,7 @@ if exists('loaded_redact_pass') || &compatible finish endif -if !has('autocmd') || v:version < 600 +if v:version < 700 finish endif let loaded_redact_pass = 1 -- cgit v1.2.3 From 66fa75c8ca81e012079a69e9e4f0bd2ca69f0a09 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 25 May 2019 21:55:51 +1200 Subject: Move code into autoloaded function --- autoload/redact_pass.vim | 23 +++++++++++++++++++++++ plugin/redact_pass.vim | 26 +------------------------- 2 files changed, 24 insertions(+), 25 deletions(-) create mode 100644 autoload/redact_pass.vim diff --git a/autoload/redact_pass.vim b/autoload/redact_pass.vim new file mode 100644 index 0000000..da1c101 --- /dev/null +++ b/autoload/redact_pass.vim @@ -0,0 +1,23 @@ +" 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(':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/plugin/redact_pass.vim b/plugin/redact_pass.vim index 42064e4..3e30d88 100644 --- a/plugin/redact_pass.vim +++ b/plugin/redact_pass.vim @@ -16,30 +16,6 @@ if v:version < 700 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(':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 +23,5 @@ augroup redact_pass \ /dev/shm/pass.?*/?*.txt \,$TMPDIR/pass.?*/?*.txt \,/tmp/pass.?*/?*.txt - \ call s:CheckArgsRedact() + \ call redact_pass#CheckArgsRedact() augroup END -- cgit v1.2.3 From 7ed8926958184a09811314d39233ea4311188b4a Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 25 May 2019 21:56:31 +1200 Subject: Move load guard tests inline --- plugin/redact_pass.vim | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugin/redact_pass.vim b/plugin/redact_pass.vim index 3e30d88..06c5606 100644 --- a/plugin/redact_pass.vim +++ b/plugin/redact_pass.vim @@ -8,10 +8,7 @@ " Author: Tom Ryder " License: Same as Vim itself " -if exists('loaded_redact_pass') || &compatible - finish -endif -if v:version < 700 +if exists('loaded_redact_pass') || &compatible || v:version < 700 finish endif let loaded_redact_pass = 1 -- cgit v1.2.3 From 54d3232a6d08128a7fb073dbf0eefd167df65fa9 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 25 May 2019 21:56:53 +1200 Subject: Split an awkward conditional --- autoload/redact_pass.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/redact_pass.vim b/autoload/redact_pass.vim index da1c101..8703213 100644 --- a/autoload/redact_pass.vim +++ b/autoload/redact_pass.vim @@ -2,7 +2,8 @@ function! redact_pass#CheckArgsRedact() abort " Ensure there's one argument and it's the matched file - if argc() != 1 || fnamemodify(argv(0), ':p') !=# expand(':p') + if argc() != 1 + \ || fnamemodify(argv(0), ':p') !=# expand(':p') return endif -- cgit v1.2.3 From e2d0f154d6608d78f13167f9e03825e5bdce159b Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 25 May 2019 21:57:27 +1200 Subject: Bump VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index f0bb29e..227cea2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.0 +2.0.0 -- cgit v1.2.3