Commit graph

75 commits

Author SHA1 Message Date
Daisuke Maki 9f06c37030 version++; this is v0.2.0 2014-07-07 12:09:30 +09:00
Daisuke Maki 4c7616b515 Delay the terminal initialization until incoming buffer is ready
This change fixes #144 by delaying all the terminal initialization
until there's something coming in from the standard input.

Without this, for example, a succesive chain of commands that expect to
use stdin will fail, because peco might accidentally grab the stdin
under the hood. With this change, peco is forced to wait to do any
terminal related stuff until some output has been spewed by the
previous command (which is most likely when the command is ready to
give up the control of the terminal), so things work again.
2014-07-07 09:44:35 +09:00
Yuya Takeyama 751752cd36 Add --prompt option 2014-07-05 18:38:34 +09:00
HIROSE Masaaki e552754549 Document on --initial-index 2014-07-03 10:08:13 +09:00
HIROSE Masaaki e7b4659f4b Change number of --initial-index from one-based index to zero-based (same as percol) 2014-07-03 00:18:25 +09:00
HIROSE Masaaki 2184a62a7f Support --initial-index option like percol 2014-07-02 20:44:44 +09:00
Daisuke Maki 3b35ac2883 Refactor NewCtx so that it receives the options struct
see
9660496d99 (commitcomment-6857198)
2014-07-02 09:00:42 +09:00
Daisuke Maki 9660496d99 Implement -b / --buffer-size
This adds -b / --buffer-size to the peco binary. It basically limits the
maximum number of lines that peco will hold at any given time, allowing
you to keep peco running for a long time, even when you are receiving an
infinite stream of lines.

By default the buffer size is unlimited. If --buffer-size is specified,
lines will be thrown away in FIFO order
2014-07-02 00:32:08 +09:00
Daisuke Maki 1624c5fb7b Slightly refactor the component kick start
I just realized you should be able to put all this in a loop, so I did
2014-07-01 20:31:05 +09:00
Daisuke Maki 407f6bd25c version++; v0.1.12 2014-07-01 15:28:03 +09:00
Daisuke Maki d5c61e88cd Change IsTty() to IsTty(uintptr) 2014-07-01 12:02:17 +09:00
Daisuke Maki 6d6c57c1ce Implement an asynchronous buffer reader
should fix #113
2014-07-01 10:16:10 +09:00
Daisuke Maki 0eb4507877 change ExecQuery() to not take any parameters
ExecQuery() now just executes c.query if it's not an empty string
2014-07-01 08:47:46 +09:00
mattn 99a06edc5a Output error message when specified file is not exists 2014-07-01 02:37:31 +09:00
Daisuke Maki a4bebcc69a version++; this be v0.1.11 2014-06-30 20:22:10 +09:00
Daisuke Maki 7e9bb7994d version++; v0.1.10 2014-06-25 22:46:17 +09:00
lestrrat 294298ddf2 Merge pull request #96 from peco/windows-esc-alt
Add SetInputMode() for windows. Windows can handle Esc/Alt both
2014-06-25 22:38:10 +09:00
mattn 2cce54d258 Add SetInputMode() for windows. Windows can handle Esc/Alt both 2014-06-25 15:28:54 +09:00
Daisuke Maki 31217d58f9 version++; v0.1.9 2014-06-25 15:25:05 +09:00
Daisuke Maki 6387a2a493 version++; v0.1.8 2014-06-25 12:54:55 +09:00
mattn 61a8f7c8a2 Handle Alt/Esc both 2014-06-25 03:36:48 +09:00
Syohei YOSHIDA 76ee53b552 Support Alt(Meta) key prefix 2014-06-24 14:06:20 +09:00
Daisuke Maki ce0419b99d version++ and stuff. v0.1.7 it is now 2014-06-22 09:45:16 +09:00
Daisuke Maki 9c9034ed90 ugh, stray debug code 2014-06-22 08:17:38 +09:00
Daisuke Maki 29cf8bb6aa Automatically update GOMAXPROCS to NumCPU() so we can leverage all the
resources

If GOMAXPROCS is explicitly set, uses that instead
2014-06-22 08:08:53 +09:00
Mitsutaka Mimura 9f5e5c3c60 fix package path 2014-06-21 20:10:52 +09:00
Daisuke Maki 5a926a6a30 version++ and stuff. v0.1.6 it is now 2014-06-18 17:42:53 +09:00
Daisuke Maki ec7595069f version++ and stuff. v0.1.5 it is now 2014-06-18 16:46:17 +09:00
Daisuke Maki ec17301353 remove extra \ 2014-06-18 16:41:00 +09:00
Daisuke Maki f0e6374dd4 Note that --null is experimental in the help message, too 2014-06-18 15:16:46 +09:00
Daisuke Maki 3285e19dae Rename --zero to --null 2014-06-18 14:39:55 +09:00
Daisuke Maki 124a994499 Merge branch 'master' into make-some-pizza
Conflicts:
	ctx.go
	keymap.go
	matchers.go
2014-06-18 14:32:00 +09:00
Daisuke Maki 155ef64f81 Revemo -0. Now it's just --zero 2014-06-18 14:05:47 +09:00
Daisuke Maki 6f4e89e787 Implement -0 (--zero)
This makes peco accept lines with NUL(\0) characters.
Anything before the NUL is used as the string to be displayed
in the peco view AND used for matching.
Anything after the NUL is used as the output when peco is done

Should fix #76
2014-06-18 13:29:11 +09:00
Daisuke Maki 79e8737ebf version++ and stuff. v0.1.4 it is now 2014-06-17 19:53:13 +09:00
Daisuke Maki da28d412f2 version++ and stuff. v0.1.3 it is now 2014-06-17 18:35:10 +09:00
Daisuke Maki 6043ed2969 Change where LocateRcfile() is definited so we can test it
refs #67
2014-06-17 10:51:52 +09:00
Daisuke Maki 70527e7c13 Respect XDG base directory structure.
This implements searching for directories in
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html,
and then falls back to ~/.peco/config.json

refs #67
2014-06-17 07:01:48 +09:00
Daisuke Maki 649ac78efa unexport 2014-06-16 15:34:38 +09:00
Daisuke Maki f6a176c4b0 Implment multiple-line selection
Should fix #43
2014-06-16 12:38:20 +09:00
Daisuke Maki 36811ab1af set st to the saved value in ctx.ExitStatus 2014-06-16 11:55:33 +09:00
Daisuke Maki 651eb0edd2 version++ and stuff. v0.1.2 it is now 2014-06-16 10:38:41 +09:00
Daisuke Maki d981e17907 Workaround termbox
termbox's PollEvent() blocks, and on particular instances it blocks
even after termbox.Close() is called. In order to workaround this,
we isolate termbox.PollEvent() in a goroutine so we can just wait
for something to come in via a channel.

In this scenario, once our main functions exit, termbox's polling
is cleaned up by go itself, and we don't get stuck in that loop.
2014-06-16 09:42:07 +09:00
Daisuke Maki 42dce7969f Work with sigint/interrupt properly 2014-06-16 09:41:57 +09:00
Daisuke Maki 2a03cdd02c Fix synchronization
Because previously everything has been written using non-buffered
channels, the request to refresh the screen would always block.
This resulted in the main thread always waiting to write to
ctx.drawCh until viewer.Loop() registered itself to the waitgroup
via wg.Add(), therefore making the successive wg.Wait() actually wait.

When (this change does not do this) we do use buffered channels,
this guarantee breaks, and the main thread goes immediately to
wg.Wait() before viewer.Loop() has the chance to register
itself to the wait group

This change explicitly forces the main thread to call wg.Add()
to prevent this from happening
2014-06-13 18:08:36 +09:00
cubicdaiya 526199b277 go fmt ./... 2014-06-13 17:53:00 +09:00
mattn eea8c59e53 Configurable Default Matcher 2014-06-13 14:36:53 +09:00
Daisuke Maki f50f3e62e6 Temporarily do away with hardcoding.
See thigs thread: https://twitter.com/lestrrat/status/477080761653157888
But I couldn't come to a clever answer yet, so punting it for now
2014-06-12 22:59:25 +09:00
lestrrat e0797a8164 Merge pull request #33 from lestrrat/releng_tools
Releng tools
2014-06-12 22:30:41 +09:00
lestrrat c5f0de6d9c Merge pull request #31 from mattn/custom-match
Custom match
2014-06-12 21:16:41 +09:00