summaryrefslogtreecommitdiffstats
path: root/autoload/dart.vim
diff options
context:
space:
mode:
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