Skip to content

Commit

Permalink
Use consistent filename sorting for [f and ]f
Browse files Browse the repository at this point in the history
Resolves: #215
  • Loading branch information
tpope committed Aug 15, 2021
1 parent ee21252 commit aee3455
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugin/unimpaired.vim
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function! s:entries(path) abort
let filter_suffixes = substitute(escape(&suffixes, '~.*$^'), ',', '$\\|', 'g') .'$'
call filter(files, 'v:val !~# filter_suffixes')

return files
return sort(files)
endfunction

function! s:FileByOffset(num) abort
Expand All @@ -93,9 +93,9 @@ function! s:FileByOffset(num) abort
while num
let files = s:entries(fnamemodify(file,':h'))
if a:num < 0
call reverse(sort(filter(files,'v:val <# file')))
call reverse(filter(files,'v:val <# file'))
else
call sort(filter(files,'v:val ># file'))
call filter(files,'v:val ># file')
endif
let temp = get(files,0,'')
if empty(temp)
Expand Down

0 comments on commit aee3455

Please sign in to comment.