diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 43eaff04e..d0eafa5cf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,10 +25,11 @@ jobs: fail-fast: false matrix: version: - - v0.10.0 - v0.10.1 - v0.10.2 - v0.10.3 + - v0.10.4 + - nightly runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/lua/orgmode/files/init.lua b/lua/orgmode/files/init.lua index 27761b7c6..5fddecc7a 100644 --- a/lua/orgmode/files/init.lua +++ b/lua/orgmode/files/init.lua @@ -230,6 +230,9 @@ end function OrgFiles:get_closest_listitem() local get_listitem_node = function() local node_at_cursor = ts_utils.get_node_at_cursor() + if node_at_cursor and node_at_cursor:type() == 'list' then + return node_at_cursor:named_child(0) + end return ts_utils.closest_node(node_at_cursor, 'listitem') end diff --git a/tests/plenary/utils_spec.lua b/tests/plenary/utils_spec.lua index 0e5afce3f..f2142b1ff 100644 --- a/tests/plenary/utils_spec.lua +++ b/tests/plenary/utils_spec.lua @@ -120,8 +120,8 @@ describe('Util', function() local ok, err = pcall(promise.wait, promise) assert.is.False(ok) assert(err) - local expected = 'E5560: Vimscript function must not be called in a lua loop callback' - local msg = err:sub(#err - #expected) + local expected = 'E5560: Vimscript function' + local msg = err:sub(1, #expected) assert.are.equal(expected, msg) end)