Skip to content

Commit

Permalink
Merge branch 'nvim-neo-tree:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
tribhuwan-kumar authored Apr 16, 2024
2 parents fb91736 + 25bfdbe commit 582cc31
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/luarocks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Push to Luarocks

on:
push:
tags:
- '*'
workflow_dispatch:
pull_request: # Will test the luarocks installation on PR, without uploading

jobs:
luarocks-upload:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Required to count the commits
- name: Get Version
run: echo "LUAROCKS_VERSION=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV
- name: LuaRocks Upload
uses: nvim-neorocks/luarocks-tag-release@v5
env:
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
with:
version: ${{ env.LUAROCKS_VERSION }}
dependencies: |
plenary.nvim
nvim-web-devicons
nui.nvim
12 changes: 9 additions & 3 deletions lua/neo-tree/sources/manager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,9 @@ local dispose_state = function(state)
end

M.dispose = function(source_name, tabid)
for i, state in ipairs(all_states) do
-- Iterate in reverse because we are removing items during loop
for i = #all_states, 1, -1 do
local state = all_states[i]
if source_name == nil or state.name == source_name then
if not tabid or tabid == state.tabid then
log.trace(state.name, " disposing of tab: ", tabid)
Expand All @@ -384,7 +386,9 @@ M.dispose_tab = function(tabid)
if not tabid then
error("dispose_tab: tabid cannot be nil")
end
for i, state in ipairs(all_states) do
-- Iterate in reverse because we are removing items during loop
for i = #all_states, 1, -1 do
local state = all_states[i]
if tabid == state.tabid then
log.trace(state.name, " disposing of tab: ", tabid, state.name)
dispose_state(state)
Expand All @@ -410,7 +414,9 @@ M.dispose_window = function(winid)
if not winid then
error("dispose_window: winid cannot be nil")
end
for i, state in ipairs(all_states) do
-- Iterate in reverse because we are removing items during loop
for i = #all_states, 1, -1 do
local state = all_states[i]
if state.id == winid then
log.trace(state.name, " disposing of window: ", winid, state.name)
dispose_state(state)
Expand Down

0 comments on commit 582cc31

Please sign in to comment.