Fix disabling supermaven-nvim conditionally #130

Open
bogzbonny wants to merge 2 commits from bogzbonny/main into main
bogzbonny commented 2025-02-12 22:45:06 -05:00 (Migrated from github.com)

For context I'm using the conditional mechanism to keep supermaven disabled by default and only enabled for specific filetypes (there is no other way to achieve this currently).

The way the condition feature is described in the README leads me to suggest that to accomplish this "default off" behaviour I should be able to use this mechanism.

The original code will basically shut down supermaven completely whenever the condition function is evaluated to false, this becomes a problem if you have multiple files open in the same neovim session, as soon as you open one which has a false condition then immediately supermaven is shut down for all other files.

This PR fixes this issue by using the condition in much the same way that the ignore_filetypes is used.

For context I'm using the conditional mechanism to keep supermaven disabled by default and only enabled for specific filetypes (there is no other way to achieve this currently). The way the `condition` feature is described in the README leads me to suggest that to accomplish this "default off" behaviour I should be able to use this mechanism. The original code will basically shut down supermaven completely whenever the `condition` function is evaluated to false, this becomes a problem if you have multiple files open in the same neovim session, as soon as you open one which has a false `condition` then immediately supermaven is shut down for all other files. This PR fixes this issue by using the `condition` in much the same way that the `ignore_filetypes` is used.
chrisgrieser commented 2025-04-19 09:22:53 -04:00 (Migrated from github.com)

Oh thank you. I've been wondering why my supermaven regularly was turned off, and it was indeed condition for me as well.

Having condition permanently turn off supermaven without re-enabling it again is quite counterintuitive indeed.

Oh thank you. I've been wondering why my supermaven regularly was turned off, and it was indeed `condition` for me as well. Having `condition` permanently turn off supermaven without re-enabling it again is quite counterintuitive indeed.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin bogzbonny/main:bogzbonny/main
git switch bogzbonny/main

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff bogzbonny/main
git switch bogzbonny/main
git rebase main
git switch main
git merge --ff-only bogzbonny/main
git switch bogzbonny/main
git rebase main
git switch main
git merge --no-ff bogzbonny/main
git switch main
git merge --squash bogzbonny/main
git switch main
git merge --ff-only bogzbonny/main
git switch main
git merge bogzbonny/main
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
supermaven-inc/supermaven-nvim!130
No description provided.