Get linescount in a more conventional way

This should solve issue #5 see
https://github.com/dbeniamine/todo.txt-vim/issues/5
This commit is contained in:
David Beniamine
2015-12-18 10:17:26 +01:00
parent 81c2772905
commit a03d01e58e

View File

@@ -188,11 +188,12 @@ function! todo#HierarchicalSort(symbol, symbolsub, dolastsort)
let l:sortmodefinal=Todo_txt_InsertSpaceIfNeeded(g:Todo_txt_third_level_sort_mode)
" Count the number of lines
let l:position= todo#GetCurpos()
execute "silent normal g\<c-g>"
let l:position= todo#GetCurpos()
execute "silent normal G"
let l:linecount=getpos(".")[1]
if(exists("g:Todo_txt_debug"))
echo "Linescount: ".l:linecount
endif
execute "silent normal gg"
" Get all the groups names
@@ -205,6 +206,9 @@ function! todo#HierarchicalSort(symbol, symbolsub, dolastsort)
" Sort by groups
execute 'sort'.l:sortmode.' /.\{-}\ze'.a:symbol.'/'
for l:g in l:groups
let l:pat=a:symbol.l:g.'.*$'
if(exists("g:Todo_txt_debug"))
echo l:pat
endif
normal gg
" Find the beginning of the group