m4xshen / hardtime.nvim

Establish good command workflow and quit bad habit
MIT License
1.35k stars 27 forks source link

filetype matching doesn't work for types with "-" #92

Closed Accurate0 closed 3 months ago

Accurate0 commented 3 months ago

Describe the bug The filetype matching introduced by https://github.com/m4xshen/hardtime.nvim/pull/80 does not work for filetypes such as neo-tree due to the - being interpreted as a special char, escaping with % seems to fix this.

Config options Defaults

To Reproduce Steps to reproduce the behavior:

  1. Install neotree
  2. Open neotree and spam j
  3. Get blocked by hardtime

Expected behavior It should work correctly for filetypes with - in the name

LumenYoung commented 3 months ago

Hi, I'm also experiencing this problem and looking for ways to overcome. Do you have any workaround for the time being?

Accurate0 commented 3 months ago

I added all the default types to the config myself and escaped the -

https://github.com/Accurate0/nvim/blob/df27e181cfb29560cd89990a3c2279f12601c0b2/lua/plugins/hardtime.lua#L7

LumenYoung commented 3 months ago

Thanks! this modification also works for me!

m4xshen commented 3 months ago

@Accurate0 @LumenYoung Thanks for the report! The correct config is now in the latest version.