From af85499edace2acca27ce41790ac333f62b689bb Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Wed, 13 May 2015 20:29:03 +0100 Subject: [PATCH] rename 2 sort key related vars rename s:format to s:sortKeyFormat - purely for descriptive reasons rename self.sortKey to self._sortKey - the convention is to use leading underscores to indicate private vars --- lib/nerdtree/path.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/nerdtree/path.vim b/lib/nerdtree/path.vim index 5455395..c0242d0 100644 --- a/lib/nerdtree/path.vim +++ b/lib/nerdtree/path.vim @@ -2,7 +2,7 @@ "once here let s:NERDTreeSortStarIndex = index(g:NERDTreeSortOrder, '*') " used in formating sortKey, e.g. '%04d' -let s:format = "%0" . float2nr(ceil(log10(len(g:NERDTreeSortOrder)))) . "d" +let s:sortKeyFormat = "%0" . float2nr(ceil(log10(len(g:NERDTreeSortOrder)))) . "d" "CLASS: Path @@ -367,7 +367,7 @@ endfunction "FUNCTION: Path.getSortKey() {{{1 "returns a string used in compare function for sorting function! s:Path.getSortKey() - if !exists("self.sortKey") + if !exists("self._sortKey") let path = self.getLastPathComponent(1) if !g:NERDTreeSortHiddenFirst let path = substitute(path, '^[._]', '', '') @@ -375,10 +375,10 @@ function! s:Path.getSortKey() if !g:NERDTreeCaseSensitiveSort let path = tolower(path) endif - let self.sortKey = printf(s:format, self.getSortOrderIndex()) . path + let self._sortKey = printf(s:sortKeyFormat, self.getSortOrderIndex()) . path endif - return self.sortKey + return self._sortKey endfunction