cointop-sh / cointop

A fast and lightweight interactive terminal based UI application for tracking cryptocurrencies 🚀
https://cointop.sh
Apache License 2.0
3.98k stars 311 forks source link

Support search by /s:keyword - symbol, /n:keyword - name #254

Closed vuon9 closed 2 years ago

lyricnz commented 2 years ago

Probably don't want to commit your venv ;)

lyricnz commented 2 years ago

Maybe add a line to the FAQ about this functionality? https://github.com/cointop-sh/cointop/blob/master/docs/content/faq.md#how-do-i-search

vuon9 commented 2 years ago

Maybe add a line to the FAQ about this functionality? https://github.com/cointop-sh/cointop/blob/master/docs/content/faq.md#how-do-i-search

I just updated it!

lyricnz commented 2 years ago

Maybe add a line to the FAQ about this functionality? https://github.com/cointop-sh/cointop/blob/master/docs/content/faq.md#how-do-i-search

I just updated it!

:)

BTW, do you have a specific use-case where needing symbol/name specific matches wouldn't have "just worked" anyway?

vuon9 commented 2 years ago

Maybe add a line to the FAQ about this functionality? https://github.com/cointop-sh/cointop/blob/master/docs/content/faq.md#how-do-i-search

I just updated it!

:)

BTW, do you have a specific use-case where needing symbol/name specific matches wouldn't have "just worked" anyway?

TBH, I think it could be a lot. I think this search function is quite complicated about starting index, and it impacts to the result, I'm not sure so much. If the expectation of result, I think it could be working in another issue if any problem has been figured out. @lyricnz

lyricnz commented 2 years ago

The search behaviour changed recently - now it searches from where the cursor currently is, so you can do repeated search (by hitting / [enter]).

Yes, there is kindof an edge case where if you search for something slightly obscure (say "coin") it first goes to name/symbol=coin, then each repeat starts from that point (with a substring/partial search). It doesn't seem to be possible to do an approximate search before the full-patch result.

vuon9 commented 2 years ago

The search behaviour changed recently - now it searches from where the cursor currently is, so you can do repeated search (by hitting / [enter]).

Yes, there is kindof an edge case where if you search for something slightly obscure (say "coin") it first goes to name/symbol=coin, then each repeat starts from that point (with a substring/partial search). It doesn't seem to be possible to do an approximate search before the full-patch result.

Will it be solved by have temp var for keyword after sanitizing, and keep original keyword storing as current?


Update: The given keyword already properly store as the last query search, I think can ignore my above question.

lyricnz commented 2 years ago

This PR didn't create the issue. It is already present. I'm not sure it's actually a problem though.

miguelmota commented 2 years ago

Thanks for the PR @vuon9! LGTM, going to merge 👍