Commit graph

77 commits

Author SHA1 Message Date
Takumi Sueda 1e185a785f Add FuzzyLongestSort flag 2023-03-08 23:33:08 +09:00
Yuta Hayashibe dc559668f3 Fix typos 2021-07-24 23:32:15 +09:00
narugit a7cd43ff22 Apply 256color configuration 2020-06-06 21:38:11 +09:00
narugit a14f3abf35 Add configuration for 256color 2020-06-06 21:38:11 +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
Daisuke Maki b60d067747 Call SetCursor when drawing the prompt 2018-03-30 10:07:42 +09:00
lestrrat 7a70f43e5d
Merge branch 'master' into topic/print-query 2017-12-27 08:44:09 +09:00
Daisuke Maki d213c89cab Rename to Top -> FirstItem, Bottom -> LastItem 2017-12-27 07:14:11 +09:00
Anders Eurenius 3058ce77f4 Add scroll to top and bottom 2017-12-26 15:28:00 +01:00
Daisuke Maki d25a14bf40 peco --print-query prints out the query as first line 2017-12-26 21:16:34 +09: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 8069f8eb2f Make Resume a blocking operation
This is required because we need to make sure we know termbox
has been initialized before attempting to make another drawing
operation.

Notably, without proper termbox initialization, screen.Size() returns a
bogus value, and we miss the line location where we left off to execute
the external command specified by --exec
2017-03-16 23:16:12 +09:00
Daisuke Maki aaa77cd3c8 remove unused structs and fields 2017-03-15 09:01:01 +09:00
Daisuke Maki f3e9250486 Add some environment variables 2017-03-06 17:06:50 +09:00
Daisuke Maki c37f3a3ae8 Remove tty, as previously noted 2017-03-06 09:42:26 +09:00
Daisuke Maki 8ca4f61967 Remove ExecuteCommand, hello --exec
--exec is a new, and far better tool to execute external commands
from peco results. It is invoked when `Finish` action is called,
and pipes selected line(s) to the specified command. If there were
saved lines, every saved line plus the currently selected line is
piped to the command. Otherwise, only the currently selected line
is piped.

When the command exits, execution goes back to peco, where you can
keep doing incremental searches, and again execute external commands.

When you are done, you are expected to exit out of peco using
the `Cancel` action
2017-03-03 15:40:09 +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 a78051dcbe Properly suspend termbox before executing external command
This makes sure that termbox does not inadvertantly steal our
commands while executing external commands, and also makes sure
we explicitly reset the screen.

Also, make sure we use a temporary selection.
2017-03-03 13:53:41 +09:00
Daisuke Maki b94d764f51 goimports 2017-02-26 18:13:43 +09:00
Daisuke Maki 6cef077bc5 Add tests and some docs 2017-02-26 16:27:25 +09:00
Daisuke Maki ff10112452 PoC implementation for #384
* missing docs
* missing tests
2017-02-26 08:27:11 +09:00
Daisuke Maki 6216146848 Actually implement it 2017-02-09 20:17:38 +09:00
Daisuke Maki c5a069a15d Add new option to the command line 2017-02-09 19:10:25 +09:00
Daisuke Maki eccb83e040 remove dead code detected by deadcode utility 2016-12-15 09:45:56 +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 b1ea3c36b1 separate interface 2016-12-14 08:54:59 +09:00
Daisuke Maki 0ea80d7d90 remove unused field and params 2016-12-13 07:15:46 +09:00
Daisuke Maki 3476752a12 remove unused fields 2016-12-13 07:13:10 +09:00
Daisuke Maki 2dbfd78205 Rework #369
* --fuzzy-filter seems unnecessary
* regexp.Regexp is overkill. Implement in terms of Index*()
2016-12-12 17:12:07 +09:00
Eric F 21179c2c38 Implement #242: Made the fuzzy filter configurable 2016-12-08 17:20:55 +11:00
Eric F 4c4b4535ed Implement #242: fuzzy finder filter
- The fuzzy finder is implemented as a new filter, which
re-uses the RegexpFilter.
- A new queryTransformer field has been added to the RegexpFilter
struct to allow changing the user query before applying the filter.
- The new queryTransformer is used for the fuzzy filter to change
the user query into a regexp.
- Also added a test in filter_test.go
2016-11-28 00:00:28 +11: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 8b384d914e Skip reading from rcfiles when running tests 2016-10-05 14:19:00 +09:00
Daisuke Maki bf689d4255 Tweak things 2016-09-25 04:26:37 -05: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 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
Daisuke Maki 7f70d73996 pass the id generator instead of state 2016-07-01 15:26:56 +09:00
Daisuke Maki b14cd4955b Make sure to initial buffer.start 2016-07-01 14:41:35 +09:00
Daisuke Maki 07a22aa466 refactor idgen so that it exits gracefully 2016-07-01 14:13:27 +09:00
Daisuke Maki aaebbf9d05 protect selection race 2016-06-23 05:14:09 -04:00
Daisuke Maki 3b98bf9bde protect regexpfilter, one more filter set 2016-06-23 05:07:42 -04:00
Daisuke Maki 9cbe49c72d protect peco from race 2016-06-23 04:56:09 -04:00
Daisuke Maki a6589820d0 protect caret race 2016-06-23 04:34:31 -04:00
Daisuke Maki ca7a273d98 protect filterset race 2016-06-23 04:14:44 -04:00
Daisuke Maki 464919f631 Remove unused field/method 2016-06-23 03:40:55 -04:00