diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b804bd..2273aa4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Change Log #### 5.2... +- **.4**: When searching for root line num, stop at end of file. (PhilRunninger) #1015 - **.3**: Fix `` key map on the bookmark (lkebin) #1014 - **.2**: Make Enter work on the `.. ( up a dir )` line (PhilRunninger) #1013 - **.1**: Fix nerdtree#version() on Windows. (PhilRunninger) N/A diff --git a/lib/nerdtree/ui.vim b/lib/nerdtree/ui.vim index 3aa5959..97f95d9 100644 --- a/lib/nerdtree/ui.vim +++ b/lib/nerdtree/ui.vim @@ -254,7 +254,7 @@ endfunction " gets the line number of the root node function! s:UI.getRootLineNum() let rootLine = 1 - while getline(rootLine) !~# '^\(/\|<\)' + while rootLine <= line('$') && getline(rootLine) !~# '^\(/\|<\)' let rootLine = rootLine + 1 endwhile return rootLine