Memoize results of s:NumContainingDefs
Memoize results of s:NumContainingDefs

This optimizes performance on large buffers by significantly reducing
recursion depth when determining the number of class and function
definitions that contain a given line.

The memo cache should be invalidated whenever Vim begins reevaluating
fold levels (e.g. after the buffer is modified). However, there is no
`FoldPre` autocommand event to hook for this purpose. Instead, we detect
new sweeps by checking whether the current line being folded occurs
before the previous line that was folded, based on the observation that
Vim's folding sweeps are usually over sequential runs of lines. This
heuristic should be conservative enough to avoid stale data being hit in
the cache, while still reasonably optimizing performance. Vim's behavior
in this regard is poorly documented, though, so regressions are
possible; be vigilant.

tschundler/dotfiles,tschundler/dotfiles,tschundler/dotfiles