diff options
| author | srdusr <trevorgray@srdusr.com> | 2023-09-11 21:11:53 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2023-09-11 21:11:53 +0200 |
| commit | a9347a8d6783b360d0e4481151944b0f961404d9 (patch) | |
| tree | b61a5e6beb4d150449ecf004a7e4a6099f4917dc /.config/nvim/lua/plugins/loclist.lua | |
| parent | fd1646bb0d8bca44f263717ec63268947af1386c (diff) | |
| parent | 38ec7c480730e3f83322fa34a6a4ff700ca503d9 (diff) | |
| download | dotfiles-a9347a8d6783b360d0e4481151944b0f961404d9.tar.gz dotfiles-a9347a8d6783b360d0e4481151944b0f961404d9.zip | |
Merge commit '9489548bca74468976436df44134e4aeb40e8548'
Diffstat (limited to '.config/nvim/lua/plugins/loclist.lua')
| -rw-r--r-- | .config/nvim/lua/plugins/loclist.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/.config/nvim/lua/plugins/loclist.lua b/.config/nvim/lua/plugins/loclist.lua new file mode 100644 index 0000000..9b72a94 --- /dev/null +++ b/.config/nvim/lua/plugins/loclist.lua @@ -0,0 +1,18 @@ +local M = {} + +function M.loclist_toggle() + for _, info in ipairs(vim.fn.getwininfo()) do + if info.loclist == 1 then + vim.cmd('lclose') + return + end + end + + if next(vim.fn.getloclist(0)) == nil then + print('loc list empty') + return + end + vim.cmd('lopen') +end + +return M |
