~p00f/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH clangd_extensions.nvim] feat: return state after

Details
Message ID
<171395530799.462.12244278917244491828-0@git.sr.ht>
DKIM signature
missing
Download raw message
Patch: +1 -0
From: lnc3l0t <lnk3@protonmail.com>

Return the state after toggle_inlay_hints has been called, useful for attaching callbacks to the toggle behaviour.
For example enable/disable autocmds when toggling or untoggling.
---
 lua/clangd_extensions/inlay_hints.lua | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lua/clangd_extensions/inlay_hints.lua b/lua/clangd_extensions/inlay_hints.lua
index 2d03fe4..f8afd1a 100644
--- a/lua/clangd_extensions/inlay_hints.lua
+++ b/lua/clangd_extensions/inlay_hints.lua
@@ -272,6 +272,7 @@ function M.toggle_inlay_hints()
        M.set_inlay_hints()
    end
    enabled = not enabled
    return enabled
end

function M.disable_inlay_hints()
-- 
2.43.0
Details
Message ID
<ypi9plud646u.fsf@gmail.com>
In-Reply-To
<171395530799.462.12244278917244491828-0@git.sr.ht> (view parent)
DKIM signature
pass
Download raw message
~lnk3 <lnk3@git.sr.ht> writes:

> From: lnc3l0t <lnk3@protonmail.com>
>
> Return the state after toggle_inlay_hints has been called, useful for attaching callbacks to the toggle behaviour.
> For example enable/disable autocmds when toggling or untoggling.
> ---
>  lua/clangd_extensions/inlay_hints.lua | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/lua/clangd_extensions/inlay_hints.lua b/lua/clangd_extensions/inlay_hints.lua
> index 2d03fe4..f8afd1a 100644
> --- a/lua/clangd_extensions/inlay_hints.lua
> +++ b/lua/clangd_extensions/inlay_hints.lua
> @@ -272,6 +272,7 @@ function M.toggle_inlay_hints()
>          M.set_inlay_hints()
>      end
>      enabled = not enabled
> +    return enabled
>  end
>  
>  function M.disable_inlay_hints()
> -- 
> 2.43.0

Can you also document this in the README? Which reminds me that
toggle_inlay_hints is not documented either

Thanks,
Chinmay
Reply to thread Export thread (mbox)