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

Too many matches is an unhandled exception #112

Closed
knpwrs opened this issue Jan 10, 2024 · 6 comments
Closed

Too many matches is an unhandled exception #112

knpwrs opened this issue Jan 10, 2024 · 6 comments

Comments

@knpwrs
Copy link

knpwrs commented Jan 10, 2024

Tmux fingers isn't working for me in a particular pane. The log contains the following:

Unhandled exception: Too many matches (Exception)
  from /opt/homebrew/Cellar/tmux-fingers/2.1.1/bin/tmux-fingers in '??'
  from /opt/homebrew/Cellar/tmux-fingers/2.1.1/bin/tmux-fingers in '??'
  from /opt/homebrew/Cellar/tmux-fingers/2.1.1/bin/tmux-fingers in '??'
  from /opt/homebrew/Cellar/tmux-fingers/2.1.1/bin/tmux-fingers in '??'
  from /opt/homebrew/Cellar/tmux-fingers/2.1.1/bin/tmux-fingers in '??'
  from /opt/homebrew/Cellar/tmux-fingers/2.1.1/bin/tmux-fingers in '??'
  from /opt/homebrew/Cellar/tmux-fingers/2.1.1/bin/tmux-fingers in '??'
  from /opt/homebrew/Cellar/tmux-fingers/2.1.1/bin/tmux-fingers in '??'
  from /opt/homebrew/Cellar/tmux-fingers/2.1.1/bin/tmux-fingers in '??'
  from /opt/homebrew/Cellar/tmux-fingers/2.1.1/bin/tmux-fingers in '??'
  from /opt/homebrew/Cellar/tmux-fingers/2.1.1/bin/tmux-fingers in '??'
  from /opt/homebrew/Cellar/tmux-fingers/2.1.1/bin/tmux-fingers in '??'
  from /opt/homebrew/Cellar/tmux-fingers/2.1.1/bin/tmux-fingers in '??'
  from /opt/homebrew/Cellar/tmux-fingers/2.1.1/bin/tmux-fingers in '??'
  from /opt/homebrew/Cellar/tmux-fingers/2.1.1/bin/tmux-fingers in '??'
  from /opt/homebrew/Cellar/tmux-fingers/2.1.1/bin/tmux-fingers in '??'
  from /opt/homebrew/Cellar/tmux-fingers/2.1.1/bin/tmux-fingers in '??'
  from /opt/homebrew/Cellar/tmux-fingers/2.1.1/bin/tmux-fingers in '??'
@Morantron
Copy link
Owner

Can you share the contents of the pane? Would help reproduce the issue.

@knpwrs
Copy link
Author

knpwrs commented Jan 11, 2024

I actually can't reproduce right now, even with the following node script:

for (let i = 0; i < 1000; i++) {
  for (let j = 0; j < 10; j++) {
    process.stdout.write(`/${i}/${j} `);
  }
}

Which spams the console thusly:

image

And fingers still works:

image

I'll close this issue for now and if it happens again I'll grab the buffer contents.

@knpwrs knpwrs closed this as completed Jan 11, 2024
@NeilHanlon
Copy link

I've encountered this trying to use fingers, myself, even with an empty (new) buffer.

Unhandled exception: Regex match error: match limit exceeded (Regex::Error)
  from /usr/share/crystal/src/regex/pcre2.cr:272:12 in 'match_data'
  from /usr/share/crystal/src/regex/pcre2.cr:206:18 in 'match_impl'
  from /usr/share/crystal/src/regex.cr:614:12 in 'match_at_byte_index'
  from /usr/share/crystal/src/string.cr:4746:19 in 'count_unique_matches'
  from .tmux/plugins/tmux-fingers/src/fingers/hinter.cr:187:22 in 'n_matches'
  from .tmux/plugins/tmux-fingers/src/fingers/hinter.cr:101:68 in 'regenerate_hints!'
  from .tmux/plugins/tmux-fingers/src/fingers/hinter.cr:95:7 in 'hints'
  from .tmux/plugins/tmux-fingers/src/fingers/hinter.cr:145:14 in 'pop_hint!'
  from .tmux/plugins/tmux-fingers/src/fingers/hinter.cr:138:16 in 'hint_for_text'
  from .tmux/plugins/tmux-fingers/src/fingers/hinter.cr:117:14 in 'replace'
  from .tmux/plugins/tmux-fingers/src/fingers/hinter.cr:80:42 in 'process_line'
  from .tmux/plugins/tmux-fingers/src/fingers/hinter.cr:51:52 in 'run'
  from .tmux/plugins/tmux-fingers/src/fingers/view.cr:31:7 in 'render'
  from .tmux/plugins/tmux-fingers/src/fingers/commands/start.cr:70:7 in 'show_hints'
  from .tmux/plugins/tmux-fingers/src/fingers/commands/start.cr:32:7 in 'run'
  from .tmux/plugins/tmux-fingers/src/fingers/cli.cr:21:7 in 'run'
  from .tmux/plugins/tmux-fingers/src/fingers.cr:8:3 in '__crystal_main'
  from /usr/share/crystal/src/crystal/main.cr:129:5 in 'main_user_code'
  from /usr/share/crystal/src/crystal/main.cr:115:7 in 'main'
  from /usr/share/crystal/src/crystal/main.cr:141:3 in 'main'
  from /lib64/libc.so.6 in '??'
  from /lib64/libc.so.6 in '__libc_start_main'
  from /home/neil/.tmux/plugins/tmux-fingers/bin/tmux-fingers in '_start'
  from ???

@knpwrs knpwrs reopened this Jan 11, 2024
@Morantron
Copy link
Owner

I've encountered this trying to use fingers, myself, even with an empty (new) buffer.

Unhandled exception: Regex match error: match limit exceeded (Regex::Error)
  from /usr/share/crystal/src/regex/pcre2.cr:272:12 in 'match_data'
  from /usr/share/crystal/src/regex/pcre2.cr:206:18 in 'match_impl'
  from /usr/share/crystal/src/regex.cr:614:12 in 'match_at_byte_index'
  from /usr/share/crystal/src/string.cr:4746:19 in 'count_unique_matches'
  from .tmux/plugins/tmux-fingers/src/fingers/hinter.cr:187:22 in 'n_matches'
  from .tmux/plugins/tmux-fingers/src/fingers/hinter.cr:101:68 in 'regenerate_hints!'
  from .tmux/plugins/tmux-fingers/src/fingers/hinter.cr:95:7 in 'hints'
  from .tmux/plugins/tmux-fingers/src/fingers/hinter.cr:145:14 in 'pop_hint!'
  from .tmux/plugins/tmux-fingers/src/fingers/hinter.cr:138:16 in 'hint_for_text'
  from .tmux/plugins/tmux-fingers/src/fingers/hinter.cr:117:14 in 'replace'
  from .tmux/plugins/tmux-fingers/src/fingers/hinter.cr:80:42 in 'process_line'
  from .tmux/plugins/tmux-fingers/src/fingers/hinter.cr:51:52 in 'run'
  from .tmux/plugins/tmux-fingers/src/fingers/view.cr:31:7 in 'render'
  from .tmux/plugins/tmux-fingers/src/fingers/commands/start.cr:70:7 in 'show_hints'
  from .tmux/plugins/tmux-fingers/src/fingers/commands/start.cr:32:7 in 'run'
  from .tmux/plugins/tmux-fingers/src/fingers/cli.cr:21:7 in 'run'
  from .tmux/plugins/tmux-fingers/src/fingers.cr:8:3 in '__crystal_main'
  from /usr/share/crystal/src/crystal/main.cr:129:5 in 'main_user_code'
  from /usr/share/crystal/src/crystal/main.cr:115:7 in 'main'
  from /usr/share/crystal/src/crystal/main.cr:141:3 in 'main'
  from /lib64/libc.so.6 in '??'
  from /lib64/libc.so.6 in '__libc_start_main'
  from /home/neil/.tmux/plugins/tmux-fingers/bin/tmux-fingers in '_start'
  from ???

I'm not 100% sure if this is the same issue or not: this exception seems to come from the regexp engine itself, while the "Too many matches" one is an application error.

Do you have any custom patterns in your ~/.tmux.conf file @NeilHanlon ? 🤔

@NeilHanlon
Copy link

Yeah, I noticed that too after filing the issue. I can open a new issue, if that is preferable.

No custom patterns are in my .tmux.conf - https://gist.github.com/NeilHanlon/93340c7cc0a9433f9af3d64d359715df

@Morantron
Copy link
Owner

Finally could reproduce it! Should be fixed now. It happened in some circumstances when re-rendering after a keystroke.

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

No branches or pull requests

3 participants