ryu1kn / vscode-text-marker

Visual Studio Code Extension. Select text in your code and mark all matches. The marking colour is configurable
https://marketplace.visualstudio.com/items?itemName=ryu1kn.text-marker
MIT License
87 stars 17 forks source link

Feature Request: Ability to display just the highlighted lines #52

Closed rukai closed 4 years ago

rukai commented 4 years ago

A command that would delete or hide or fold the lines that are unhighlighted, would be super useful. Currently I'm achieving this by just manually deleting the lines that are unhighlighted.

Maybe this is out of scope of the extension and I should just write a grep command to do this for me, but that leaves room for error and is extra effort.

Thanks for the great extension, if you think this is out of scope feel free to just close the issue.

ryu1kn commented 4 years ago

Hi @rukai , thanks for the suggestion. I'm curious to know why you want to collect non-highlighted lines. Do you want to provide your use cases?

rukai commented 4 years ago

I want to collect the lines that are highlighted, not unhighlighted.

I want to do this because I have very large log files (1000-2000 lines) that I am trying to comprehend. Each line has a specific event type. The order of these events and timestamps of these events are whats important. So I highlight the event types that are relevant to me. But it is useful to see every highlighted line around (10-20 lines) at once on a single screen. Previously I was manually deleting every non highlighted line.

However honestly, since I wrote this bug report I found manually using grep to work quite well for this use case, so maybe its best to just close this issue :)

ryu1kn commented 4 years ago

Ah, i took it the other way around, sorry 😅

I also use this extension to highlight keywords in log files (like source IPs, user IDs, time range, ...). Haven't thought about collecting only highlighted lines, though it sounds like a perfectly likely scenario 😃

By the way, I happen to have another extension that let you edit your file with shell commands (like grep), and I often use it to filter lines: https://github.com/ryu1kn/vscode-edit-with-shell

If you have some commands that you use regularly, you can put them in your config. It's got command history as well.

rukai commented 4 years ago

Ooooh, that looks nice!

ryu1kn commented 4 years ago

Since you found another way to achieve what you want; I'm closing this for now. If you later feel you need this feature, please feel free to come back and reopen this issue. Thanks!