Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(defaultAction) fallback to default action on emtpy expression #4954

Merged
merged 1 commit into from
Mar 25, 2024
Merged

fix(defaultAction) fallback to default action on emtpy expression #4954

merged 1 commit into from
Mar 25, 2024

Conversation

asmodeus812
Copy link
Contributor

This should allow the expression function to return nil, to by default execute the default action of the list, as there are no easy ways to extract the name of the default action for the current list. doAction by default if no 'name' is provided would fallback to the defaultAction.

@asmodeus812
Copy link
Contributor Author

The reason is to be able to do something like that

function _G.list_default_action(ctx)
        if ctx and #ctx.targets > 1 then
            -- send to qflist
            return "quickfix"
        else
            -- default
            return nil
        end
    end
        function! Listaction(ctx)
            " do execute quickfix or default action
            return v:lua.list_default_action(a:ctx)
        endfunction
   "<CR>": "expr:Listaction",

Copy link

codecov bot commented Mar 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.56%. Comparing base (846994b) to head (30f56c7).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4954      +/-   ##
==========================================
+ Coverage   98.54%   98.56%   +0.01%     
==========================================
  Files         273      273              
  Lines       26060    26060              
  Branches     5386     5385       -1     
==========================================
+ Hits        25682    25687       +5     
+ Misses        223      219       -4     
+ Partials      155      154       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fannheyward fannheyward merged commit fb030d4 into neoclide:master Mar 25, 2024
4 checks passed
fannheyward added a commit that referenced this pull request Mar 26, 2024
9190bfe feat(list): add --buffer to list buffer diags (#4958)
fb030d4 fix(defaultAction) fallback to default action on emtpy expression (#4954)
846994b fix(inlayHint): more compact padding highlight group (#4950)
b01ae44 feat(semanticTokens)!: token highlight groups (#4667)
8c85d6f fix(markdown): incorrect list indentation alignment in markdown parser (#4884)
0d66554 fix(inlayHint): hl_mode = 'replace' for neovim (#4949)
1a8244e chore(package): update dependencies (#4948)
4f68722 feat(client): upgrade to marked 7 (#4947)
574c12c feat(package): @types/node@18 (#4946)
d299c66 feat(menu): C-j/k to navigate menu (#4945)
34d3d9d chore(deps): bump follow-redirects from 1.15.4 to 1.15.6 (#4944)
aead8f4 chore(CI): use Node 20 (#4940)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants