Commit graph

66 commits

Author SHA1 Message Date
Daisuke Maki 7ee40fe3b0 Conditionally bake in debug code 2015-03-17 15:37:52 +09:00
Daisuke Maki e8915c03cb More refactoring for testing 2015-03-17 15:37:48 +09:00
Daisuke Maki 4594f2d26d newMutex, sync.Locker 2014-10-14 16:44:33 +09:00
Daisuke Maki 4c078d6505 Fix a race condition that existed between clear status and print status
For whatever reason I was thinking at the time, I had split the channels
to receive request to print to and clear the status message. This
basically means that, even if you meant to print X and then clear it
in 500 milliseconds, the clear request could actually arrive BEFORE
the print message.

This change basically puts all the status related request into one
channel, so that all requests can come sequentially
2014-09-08 14:41:06 +09:00
Daisuke Maki 065ca648c4 This change show current key sequence being handled 2014-07-15 09:23:03 +09:00
Daisuke Maki 620e324c5e golint 2014-07-12 16:41:30 +09:00
Daisuke Maki 7d3310fce5 Create combined actions.
This change still doesn't work, as data modification happens at
different goroutines and some things just don't make sense then
2014-07-11 14:39:31 +09:00
Daisuke Maki 9bbfaac77d Various structural changes
* Compile ahocorosick matcher laizly
* Move key mappings to keyseq, as we do not directly interface them in
  the main peco package
2014-07-06 18:39:24 +09:00
Daisuke Maki 9264c9fa7e Remove global Keyseq, embed in Keymap 2014-07-05 22:29:34 +09:00
Daisuke Maki 8d84660f67 Start moving away from the old way of using the Keymap object 2014-07-05 21:47:14 +09:00
Daisuke Maki 8c3e629dad Various
* Alt key mod now work again
* Use TrimSpace
* Remove some unused code (need to delete a LOT more)
2014-07-05 21:30:30 +09:00
Daisuke Maki 000b5fc607 Change rules for receiving key sequences
* Longest sequence always wins
* If you would like to break out of typing in a sequence, you must
  call peco.Cancel
* The Konami command now needs to start with C-x

TODO: remove all that Keymap code that doesn't get used anymore
2014-07-05 18:22:42 +09:00
Daisuke Maki 11d9a209d9 Very crude hook-up of keymap to ahocorasick keyseq 2014-07-05 11:29:24 +09:00
Takashi Kokubun 85f8629311 Accept key sequence 2014-07-03 23:50:44 +09:00
Daisuke Maki 24554f1235 Document and rename stuff 2014-07-03 05:51:52 +09:00
Daisuke Maki ca5cbb6fb1 Refactor keymap
Created Action/ActionFunc to wrap common operations
refs #121
2014-07-02 21:31:49 +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
Daisuke Maki 1d02edb519 Very small refactoring
Rename stuff like Finish() which was confusing with action 'Finish'
2014-06-30 08:49:52 +09:00
negipo 8586fb84d9 Add also Esc 2014-06-29 19:32:11 +09:00
negipo 63df87b238 Use C-c for handleCancel 2014-06-29 19:12:30 +09:00
mattn cfcd30edcd Don't handle ModAlt if no M-XXX mappings 2014-06-25 09:50:30 +09:00
Daisuke Maki 2fb1468435 Kill unused var 2014-06-24 22:49:55 +09:00
Daisuke Maki bdfced0609 Refactor #89
This is what I really meant to do. i.e.

   type Keymap [2]map[termbox.Key]KeymapHandler

seemed too hard for the regular human being.
In this change it's

   type Keymap [ModMax]RawKeymap
   type RawKeymap map[termbox.Key]KeymapHandler
2014-06-24 22:41:46 +09:00
Syohei YOSHIDA 76ee53b552 Support Alt(Meta) key prefix 2014-06-24 14:06:20 +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 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 6426682e06 Make default binding ToggleSelectAndSelectNext
refs #74
2014-06-17 19:48:05 +09:00
Daisuke Maki 5930da410b Allow removing a keymap 2014-06-17 19:47:36 +09:00
lestrrat 2f1afe5522 Merge pull request #74 from ryotarai/ToggleSelectionAndSelectNext
Add ToggleSelectionAndSelectNext handler which executes.
2014-06-17 19:36:39 +09:00
lestrrat bd90ed614f Merge pull request #73 from sugyan/master
fix crush on empty current Match
2014-06-17 19:35:54 +09:00
Ryota Arai 4035a5c7e9 Add ToggleSelectionAndSelectNext handler.
ToggleSelectionAndSelectNext handler executes ToggleSelection and
SelectNext.
2014-06-17 19:09:41 +09:00
Syohei YOSHIDA c49f6c6d46 Fix binding 'C-Space' issue
We should check both 'ev.Key' and 'ev.Ch'. Because ev.Key is always '0'
if input does not have prefix('Ctrl-', 'Alt-') or input is not some
special key. If user binds some command to 'C-Space' or 'C-2', 'C-~'
(then that command is set to 'input.config.Keymap[0]'), the command
is executed by inputting non-prefix key like 'a', 'b', 'c'.
2014-06-17 18:50:50 +09:00
sugyan 6b67f008d2 fix crush on empty current Match
Handlefinish crashes when there is no matches on current query.
2014-06-17 18:50:13 +09:00
Daisuke Maki 4d113e09af Assign Ctrl-Space to ToggleSelection 2014-06-17 18:23:08 +09:00
Daisuke Maki be241e0e5e Merge branch 'master' into refactor-match
Conflicts:
	keymap.go
2014-06-16 15:19:29 +09:00
Daisuke Maki 53135d1c72 Refactor match into DidMatch and NoMatch
Save that extra pointer to [][]int for the match indices
2014-06-16 15:10:53 +09:00
Daisuke Maki cf1efe937b Remove silly if 2014-06-16 12:50:32 +09:00
Daisuke Maki f6a176c4b0 Implment multiple-line selection
Should fix #43
2014-06-16 12:38:20 +09:00
lestrrat 52c5f5b762 Merge pull request #56 from k0kubun/end_of_file
Add EOF handler
2014-06-16 07:29:06 +09:00
Takashi Kokubun 4d0eebe5b3 Add EOF handler 2014-06-15 18:06:07 +09:00
Takashi Kokubun 5e1b31582a Delete forward char by C-d 2014-06-15 16:54:34 +09:00
mattn 90bd1add05 Reset query 2014-06-12 22:41:54 +09:00
mattn a422ba6b20 More emacs-ish 2014-06-12 22:34:10 +09:00
mattn e44894ced1 Add CTRL-A/CTRL-E 2014-06-12 22:18:22 +09:00
mattn 1886b28ef2 Emacs like key-binding 2014-06-12 22:16:55 +09:00
Daisuke Maki 64e63a2daa Fix docs, assign Ctrl-r for rotate matcher 2014-06-12 21:23:27 +09:00
mattn e1aef87936 Implement custom matcher 2014-06-12 20:02:26 +09:00
mattn f717a2be42 Implement ToggleIgnoreCase handler 2014-06-12 18:38:29 +09:00
Syohei YOSHIDA 02af63556a Clear 'current' information in DeleteAll command(#25) 2014-06-12 16:31:03 +09:00
Daisuke Maki f5f7d1ba74 refactor handlerName-to-handler mapping
this should effectively replace and fix https://github.com/lestrrat/peco/pull/21
2014-06-12 11:49:45 +09:00