Commit graph

38 commits

Author SHA1 Message Date
Daisuke Maki fc18c0d3de Methodically add function comments 2026-02-20 10:55:49 +09:00
Daisuke Maki 95e13933c2 Do away with interface.go files 2026-02-18 21:12:19 +09:00
Daisuke Maki c8748a736e Extract drawRefreshInterval constant 2026-02-18 15:57:20 +09:00
Daisuke Maki dfe029958c tweak handling 2026-02-18 09:45:26 +09:00
Daisuke Maki 8d5a0f672c Check scanner.Err() after scan loop 2026-02-18 09:20:04 +09:00
Daisuke Maki 46331edcfd Check for far wider range of things in lint 2026-02-18 07:49:40 +09:00
Daisuke Maki 4922d24a68 simplify 2026-02-17 19:05:51 +09:00
Daisuke Maki ffc3e85bd0 consolidate SendStatusMsg 2026-02-17 07:17:45 +09:00
Daisuke Maki f5f6262d82 use types in pipelines 2026-02-16 23:51:36 +09:00
Daisuke Maki 49f7153598 Add ANSI color support 2026-02-16 20:06:53 +09:00
Daisuke Maki 2c591ff8ed Batch sending source -> filter 2026-02-16 10:58:18 +09:00
Daisuke Maki 835f4698c2 Use ctx.Done() to check for Send() success/failure 2026-02-16 09:59:59 +09:00
Daisuke Maki e4f2b4837d optimizations around memory usage 2026-02-14 15:47:37 +09:00
Daisuke Maki db63d9f380 Add linting fixes 2026-02-14 07:48:23 +09:00
Daisuke Maki b749b6191b some cleanups 2020-01-10 12:19:44 +09:00
Daisuke Maki 143638649c Add a new flag to pass to NewSource to detect infinite source
my previous detection for continueous input was completely wrong.
Now we just assume that anything coming in from Stdin could be infinite.
Additionally, in case we think it's infinite but we were actually able
to close the Reader stream, we consider it non-infinite after that
point.
2020-01-10 09:28:39 +09:00
Daisuke Maki 43ee9051f8 Fix blocking issue cased by #491
... by punting the problem when the input is an infinite stream.
This commit fixes the blocking, but the subsequent queries don't seem
to be properly running

refs #494
2020-01-09 20:22:18 +09:00
lestrrat 5027605f27
Merge branch 'master' into master 2018-10-25 16:50:15 +09:00
Daisuke Maki d02bb4122c Workaround glide being stubborn wrt lestrrat/go-pdebug -> lestrrat-go/pdebug 2018-10-25 09:50:16 +09:00
Thomas Aynaud 281db7f5e3 Go fmt 2018-06-18 13:50:20 +02:00
Daisuke Maki 98936082f0 Only calculate the column size when necessary
This trims down the calculation required by #409 to only those lines
that will appear on screen, and still controls how far right we can
scroll to
2017-03-17 09:42:33 +09:00
Daisuke Maki f3e9250486 Add some environment variables 2017-03-06 17:06:50 +09:00
Daisuke Maki 75d0d54da6 Fix test 2017-03-03 15:52:42 +09:00
Daisuke Maki 482fa7fc6d Change default scan buffer size to 256kb
...and make it configurable
2017-03-03 14:21:38 +09:00
Daisuke Maki c59137c2bd Resume reading from source when we are done reading
In order to serve the user filtered results as fast as possible,
we start reading from Source as soon as we have acquired a few lines
from STDIN or file.

So in case of #389, we started to process the source while we
are still reading from STDIN. But that means our buffer is not
quite ready with all of the input from STDIN.

Meanwhile, the filtering thinks it's done when we reach end of input
mark prematurely, and it never resumed reading. This is why we have
less lines than we should.

Now, in order to fix this, we need to process as much as we have, and
then come back to see if we have more. We do this by looping until
the setupDone channel is closed, and we have exhaused our buffer.

This fixes #389, but it also shows that the processing is a little
different when we run the filter for the first, and subsuquent
executions. Apparently the next execution takes a little bit longer
to *draw* (note: I have not checked if it's the filtering that's slow,
or that simply if the draw timings are off)
2017-02-28 23:09:36 +09:00
Daisuke Maki b94d764f51 goimports 2017-02-26 18:13:43 +09:00
Daisuke Maki b500e2f628 Remove unused Append() 2016-12-14 18:23:59 +09:00
Daisuke Maki 47be5c7c85 Integrate ExternalCommand into the new format 2016-12-14 14:59:38 +09:00
Daisuke Maki 61b5d22fb8 Move stuff around for better code organization 2016-12-14 11:00:22 +09:00
Daisuke Maki ef5ed5f8eb seems like we failed to bail out of the for
instead, we seem to be just bailing out of the select
2016-10-30 10:55:45 +09:00
Daisuke Maki c8a43049f3 Use an interface for peco.Hub()
This allows us to plug a dummy hub.Hub instance, and avoid nasty
code for testing
2016-10-22 10:50:55 +09:00
Daisuke Maki 82a9d29697 Move the fail-safe notify sync.Once call to a defer, so we don't have to remember calling it 2016-10-22 10:34:05 +09:00
Daisuke Maki e1f82e731a Use ctx when setting up the source 2016-10-22 10:28:03 +09:00
Daisuke Maki 2c735b9f29 Test, and fix options
I should've done this a long time ago, but what's done is done.
There was one more omission between v0.3.x and v0.4.x, which is
buffer-size :/

At least I'm glad I got this out of the way.
2016-09-03 19:54:52 +09:00
Daisuke Maki 821af182ab reinstate single key jump
the caching was more agressive than before, and we forgot to
initialize the structure correctly

TODO: Write tests to catch this

fixes #331
2016-08-22 17:56:32 +09:00
Daisuke Maki 7851980a11 Remove unprotected debug statement 2016-08-18 18:19:48 +09:00
Daisuke Maki 87b4ad48a0 fix to work with new pipeline 2016-08-18 11:04:40 +09:00
Daisuke Maki f578cfc850 Various tweaks to remove locking and interdependency
* Source does not depend on MemoryBuffer
* Remove a bunch of mutexes
* Change them to RWMutex where applicable
2016-07-02 16:19:17 +09:00