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: Do not fail on trigger_eventspattern #64

Closed
wants to merge 1 commit into from

Conversation

Ltrlg
Copy link

@Ltrlg Ltrlg commented Nov 4, 2024

The following example configuration in the README.md:

{
  trigger_events = {
    immediate_save = {
      { "BufLeave", pattern = {"*.c", "*.h"} }
    }
  }
}

results in

Failed to run `config` for auto-save.nvim                                                             
                                                                                                      
...lazy/auto-save.nvim/lua/auto-save/utils/autocommands.lua:38: Invalid 'event': '*.c'                
                                                                                                      
# stacktrace:                                                                                         
  - /auto-save.nvim/lua/auto-save/utils/autocommands.lua:38 _in_ **create_autocmd_for_trigger_events**
  - /auto-save.nvim/lua/auto-save/init.lua:114 _in_ **on**                                            
  - /auto-save.nvim/lua/auto-save/init.lua:171 _in_ **setup**     
  - ~/.config/nvim/init.lua                               

[Neovim v0.10.2 from Arch / auto-save 5fbcaac with Lazy.nvim]

This commit fixes the nvim_create_autocmd loop to not confuse the pattern = … entry with an event name.

@Ltrlg Ltrlg changed the title Do not fail on trigger_eventspattern fix: Do not fail on trigger_eventspattern Nov 4, 2024
@Ltrlg Ltrlg changed the title fix: Do not fail on trigger_eventspattern [WIP] fix: Do not fail on trigger_eventspattern Nov 4, 2024
@Ltrlg Ltrlg changed the title [WIP] fix: Do not fail on trigger_eventspattern fix: Do not fail on trigger_eventspattern Nov 4, 2024
@Ltrlg
Copy link
Author

Ltrlg commented Nov 4, 2024

Looks like I misread the README.md, sorry.

@Ltrlg Ltrlg closed this Nov 4, 2024
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.

1 participant