Make directory index output sorted lines

pull/2/head
Ensar Sarajčić 2021-10-24 22:22:16 +02:00
parent 4a561537d1
commit 52f7ba7c5d
1 changed files with 2 additions and 1 deletions

View File

@ -41,6 +41,7 @@ function M.get_directory_index(vimwiki_index, directory)
index[noext] = filename index[noext] = filename
end end
table.sort(index)
return index return index
end end
@ -72,7 +73,7 @@ function M.open_subdirectory_index_file(vimwiki_index, subdirectory)
local buf = vim.api.nvim_get_current_buf() local buf = vim.api.nvim_get_current_buf()
vim.api.nvim_buf_set_lines(buf, 0, -1, false, {}) -- Clear out vim.api.nvim_buf_set_lines(buf, 0, -1, false, {}) -- Clear out
vim.api.nvim_buf_set_lines(buf, 0, 0, false, lines) -- Put new contents vim.api.nvim_buf_set_lines(buf, 0, -1, false, lines) -- Put new contents
end end
return M return M