summaryrefslogtreecommitdiffstats
path: root/autoload/dart.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2017-12-06 12:56:27 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2017-12-06 12:56:27 +0100
commitdce9e8dec5ef51730291c7bbff3e3997433eabbd (patch)
tree1ca7140cd4244dfdff3d8d58f936d9dc159c9d4e /autoload/dart.vim
parent30c87b73deff05c7dd9590228c0615a3299f39ff (diff)
downloadvim-polyglot-dce9e8dec5ef51730291c7bbff3e3997433eabbd.tar.gz
vim-polyglot-dce9e8dec5ef51730291c7bbff3e3997433eabbd.zip
Update
Diffstat (limited to 'autoload/dart.vim')
-rw-r--r--autoload/dart.vim9
1 files changed, 9 insertions, 0 deletions
diff --git a/autoload/dart.vim b/autoload/dart.vim
index 76013172..2ff55cb6 100644
--- a/autoload/dart.vim
+++ b/autoload/dart.vim
@@ -152,4 +152,13 @@ function! s:DotPackagesFile() abort
return [v:false, '']
endfunction
+" Prevent writes to files in the pub cache.
+function! dart#setModifiable() abort
+ let full_path = expand('%:p')
+ if full_path =~# '.pub-cache' ||
+ \ full_path =~# 'Pub\Cache'
+ setlocal nomodifiable
+ endif
+endfunction
+
endif