Skip to content

Commit d977fa3

Browse files
committedMar 30, 2024··
Do not remove 'frozen' plugins on PlugClean
Close #1152
1 parent 24d7ac2 commit d977fa3

File tree

4 files changed

+25
-17
lines changed

4 files changed

+25
-17
lines changed
 

‎README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -234,24 +234,24 @@ More examples can be found in:
234234
| ----------------------------------- | ------------------------------------------------------------------ |
235235
| `PlugInstall [name ...] [#threads]` | Install plugins |
236236
| `PlugUpdate [name ...] [#threads]` | Install or update plugins |
237-
| `PlugClean[!]` | Remove unlisted plugins (bang version will clean without prompt) |
237+
| `PlugClean[!]` | Remove unlisted plugins (bang version will clean without prompt) |
238238
| `PlugUpgrade` | Upgrade vim-plug itself |
239239
| `PlugStatus` | Check the status of plugins |
240240
| `PlugDiff` | Examine changes from the previous update and the pending changes |
241241
| `PlugSnapshot[!] [output path]` | Generate script for restoring the current snapshot of the plugins |
242242

243243
### `Plug` options
244244

245-
| Option | Description |
246-
| ----------------------- | ------------------------------------------------ |
247-
| `branch`/`tag`/`commit` | Branch/tag/commit of the repository to use |
248-
| `rtp` | Subdirectory that contains Vim plugin |
249-
| `dir` | Custom directory for the plugin |
250-
| `as` | Use different name for the plugin |
251-
| `do` | Post-update hook (string or funcref) |
252-
| `on` | On-demand loading: Commands or `<Plug>`-mappings |
253-
| `for` | On-demand loading: File types |
254-
| `frozen` | Do not update unless explicitly specified |
245+
| Option | Description |
246+
| ----------------------- | ----------------------------------------------------------- |
247+
| `branch`/`tag`/`commit` | Branch/tag/commit of the repository to use |
248+
| `rtp` | Subdirectory that contains Vim plugin |
249+
| `dir` | Custom directory for the plugin |
250+
| `as` | Use different name for the plugin |
251+
| `do` | Post-update hook (string or funcref) |
252+
| `on` | On-demand loading: Commands or `<Plug>`-mappings |
253+
| `for` | On-demand loading: File types |
254+
| `frozen` | Do not remove and do not update unless explicitly specified |
255255

256256
### Global options
257257

‎doc/plug.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
plug.txt plug Last change: March 14 2024
1+
plug.txt plug Last change: March 31 2024
22
PLUG - TABLE OF CONTENTS *plug* *plug-toc*
33
==============================================================================
44

@@ -188,18 +188,18 @@ More examples can be found in:
188188

189189
*<Plug>-mappings*
190190

191-
------------------------+-----------------------------------------------
191+
------------------------+------------------------------------------------------------
192192
Option | Description ~
193-
------------------------+-----------------------------------------------
193+
------------------------+------------------------------------------------------------
194194
`branch` / `tag` / `commit` | Branch/tag/commit of the repository to use
195195
`rtp` | Subdirectory that contains Vim plugin
196196
`dir` | Custom directory for the plugin
197197
`as` | Use different name for the plugin
198198
`do` | Post-update hook (string or funcref)
199199
`on` | On-demand loading: Commands or <Plug>-mappings
200200
`for` | On-demand loading: File types
201-
`frozen` | Do not update unless explicitly specified
202-
------------------------+-----------------------------------------------
201+
`frozen` | Do not remove and do not update unless explicitly specified
202+
------------------------+------------------------------------------------------------
203203

204204

205205
< Global options >____________________________________________________________~

‎plug.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -2435,7 +2435,7 @@ function! s:clean(force)
24352435
let errs = {}
24362436
let [cnt, total] = [0, len(g:plugs)]
24372437
for [name, spec] in items(g:plugs)
2438-
if !s:is_managed(name)
2438+
if !s:is_managed(name) || get(spec, 'frozen', 0)
24392439
call add(dirs, spec.dir)
24402440
else
24412441
let [err, clean] = s:git_validate(spec, 1)

‎test/workflow.vader

+8
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,14 @@ Execute (Check &rtp after SomeCommand):
804804
AssertEqual g:first_rtp, split(&rtp, ',')[0]
805805
AssertEqual g:last_rtp, split(&rtp, ',')[-1]
806806

807+
Execute (PlugClean should not care about frozen plugins):
808+
call plug#begin()
809+
Plug 'xxx/vim-easy-align', { 'frozen': 1 }
810+
call plug#end()
811+
PlugClean
812+
AssertExpect 'Already clean', 1
813+
q
814+
807815
Execute (Common parent):
808816
call plug#begin()
809817
Plug 'junegunn/vim-pseudocl'

0 commit comments

Comments
 (0)
Please sign in to comment.