aboutsummaryrefslogtreecommitdiff
path: root/autoload/undoskip.vim
blob: 8813ff130a68d0d8de6608c1587622dd260d97b3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
" Internal function returns a local value for 'undofile'
function! undoskip#Check(path) abort

  " If this isn't a normal buffer, don't save undo data
  if &buftype !=# ''
    return 0
  endif

  " Get the path from the buffer name; if that path matches any of the
  " patterns, don't save undo data
  for glob in g:undoskip
    if a:path =~# glob2regpat(glob)
      return 0
    endif
  endfor

  " Otherwise, we'll use whatever the global setting is
  return &g:undofile

endfunction