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
Add keep selection feature #230
Conversation
d6c4d4b
to
411a8eb
Compare
@@ -497,7 +498,13 @@ func (m *CustomMatcher) Line(quit chan struct{}, q string, buffer []Line) []Line | |||
for { | |||
b, _, err := buf.ReadLine() | |||
if len(b) > 0 { | |||
iter <- NewMatchedLine(string(b), m.enableSep, nil) | |||
for i, line := range lines[idx:] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コードを細かく見てないんですが、このループの効率の悪さが若干気になります…
他に方法はないものでしょうか
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
指摘ありがとうございます!
いい方法がぱっと思いつかなくて苦し紛れでした…。
なにか妙案がないか考えてみてますが、いまの Custom Matcher のときの選択のロジックから元の行数を得るのはなかなか難しそうな気がしています。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
子供と風呂に入りながら「ああ、そういうことだな」と気づきましたw>CustomMatcher
仕様変えないと難しそうですね
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
もともとの仕様はシンプルで CustomMatcher 作りやかったので、余計なことをしてしまったかもしれません 😲
といいつつ絞り込みつつ選択していくのはべんりだと思っているのでいい塩梅になるといいのですが。
これ、僕の元の選択されてるバッファを作るところの質がいけてないんですよねぇ。 |
By default this feature is disabled, keeping backward compatibiity. This should fix #230
Brief
I propose keep selection feature.
Merge this patch then selection is kept when applied new query.
Thus we select multi line with incremental search.
Use case
git ls-file
result.gibo -l
result (simonwhitaker/gibo)thank you.