question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Current search index changing when new lines are written

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
AndreSilva1993commented, Jul 5, 2022

Changed your codesandbox, you have to enable decorations on the findNext / findPrevious as stated here.

0reactions
AndreSilva1993commented, Jul 30, 2022

Exactly that! I’m using this to display the logs from a running Docker container and having the the current match always changing basically renders this feature unusable to me since we’re constantly receiving new data. So I think in theory, like you said, the index should be preserved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot Windows Search performance - Microsoft Learn
To make sure that the index reflects your changes, select Settings > Search > Searching Windows > Advanced Search Indexer Settings > Advanced...
Read more >
How to search for a term in a text file then replace that whole ...
I'm assuming sample.txt is the file with all my names and numbers in them? I replaced index with a different variable as index...
Read more >
Update index settings API | Elasticsearch Guide [8.5] | Elastic
To change the analyzer for existing backing indices, you must create a new data stream and reindex your data into it. See Use...
Read more >
Create an index in InDesign - Adobe Support
To change a topic (such as renaming it or applying a new sort order) and automatically update all entries that use that topic,...
Read more >
Python Intro: Reading and Writing Text Files - GitHub Pages
For each line in the file, the ColonyCount is stored in the 5th column (index 4 with our 0-based counting). Modify the code...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found