xtermjs/xterm.js

Current search index changing when new lines are written

开放

#3,886 创建于 2022年7月5日

 (7 条评论) (0 个反应) (0 位负责人)TypeScript (1,574 个派生)batch import
area/addon/searchhelp wantedtype/bug

仓库指标

星标
 (16,196 个星标)
PR 合并指标
 (平均合并 2天 10小时) (30 天内合并 16 个 PR)

描述

I began using the search addon to benefit from the newly implemented onDidChangeResults which allows us to get the currently highlighted match out of the total number of matches. The only thing that I'm wondering is why this line is being called as it causes this behaviour:

https://user-images.githubusercontent.com/10833491/177368718-63a0f761-02dd-441f-a6a7-fd2021282ef0.mov

For context I'm watching a stress-test Docker container which writes a lot of new lines and I'm pressing the Enter key which calls the search addon's findNext method. With that line, the current index get constantly overwritten with the total size of results? I'm a bit confused if I'm doing something wrong, if adding lines in the middle of a search might break this? Let me know if you need more information.

Details

  • Browser and browser version: Electron 17.2.0
  • OS version: macOS Monterey 12.4
  • xterm.js version: 4.19.0

Steps to reproduce

Created a sandbox to demonstrate what I'm saying. Even though the findNext is correctly highlighting the next match, the X of Y is constantly incorrect.

贡献者指南