Skip to content

[Bug] Toggle auto-trigger is broken - doesn't disable preview #32

Open

Description

@PyDevC

Introduction

action.toggle_auto_trigger is broken, it assigns a closure instead of a boolean to the vim.g.model_cmp_virtualtext_auto_trigger variable which is indirectly always set to true. Hence the toggle never turns to false and clear_preview is never called when toggling the preview.

Reproduction

In you neovim command pannel type

:ModelCmp virtualtext toggle
:ModelCmp virtualtext toggle

Even after toggling twice the preview text won't fade away.

Activity

  1. added
    bug
    on May 24, 2026
  2. PyDevC commented on May 26, 2026

    @PyDevC
    OwnerAuthor

    This issue is bit different, even if we assign the variable with true or false it does not change anything.
    Since action.enable and action.disable creates or deletes the model_cmp_virtualtext augroup.

    Ways to solve this:

    • Create a separate local function that takes in a boolean and based on that it creates or deletes the augroup. This way we can pass the vim.g.model_cmp_virtualtext_auto_trigger variable to activate this feature.
    • Do not create or delete augroup at all.
    • Anything else
  3. added
    needs more info
    on May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds more info

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions