From 52f7ba7c5d9a79d1d994326e7525bec08d401507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Sun, 24 Oct 2021 22:22:16 +0200 Subject: [PATCH] Make directory index output sorted lines --- symlinks/config/nvim/lua/vimwiki_extensions.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/symlinks/config/nvim/lua/vimwiki_extensions.lua b/symlinks/config/nvim/lua/vimwiki_extensions.lua index 750655d..c491b77 100644 --- a/symlinks/config/nvim/lua/vimwiki_extensions.lua +++ b/symlinks/config/nvim/lua/vimwiki_extensions.lua @@ -41,6 +41,7 @@ function M.get_directory_index(vimwiki_index, directory) index[noext] = filename end + table.sort(index) return index end @@ -72,7 +73,7 @@ function M.open_subdirectory_index_file(vimwiki_index, subdirectory) 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, 0, false, lines) -- Put new contents + vim.api.nvim_buf_set_lines(buf, 0, -1, false, lines) -- Put new contents end return M