Commit graph

32 commits

Author SHA1 Message Date
Daisuke Maki 5beaeb6328 Only do the page re-calculation if we have a running query
refs #260
2015-09-28 16:52:08 +09:00
Daisuke Maki 7ee40fe3b0 Conditionally bake in debug code 2015-03-17 15:37:52 +09:00
Daisuke Maki a18faef700 remove unused parameter from SendDraw 2015-03-17 15:37:50 +09:00
Daisuke Maki 4af9fc5b43 lestrrat's work in progress 2015-03-17 15:37:48 +09:00
Daisuke Maki 4594f2d26d newMutex, sync.Locker 2014-10-14 16:44:33 +09:00
Daisuke Maki a62bc068b2 Rip out termbox functions from main code so we can assigh a dummy later
in tests
2014-08-21 21:12:48 +09:00
Daisuke Maki 73473f0201 golint 2014-07-23 18:12:50 +09:00
Daisuke Maki 065ca648c4 This change show current key sequence being handled 2014-07-15 09:23:03 +09:00
Daisuke Maki 8c1bcab562 more golint 2014-07-12 16:22:08 +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 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
Takashi Kokubun 85f8629311 Accept key sequence 2014-07-03 23:50:44 +09:00
Daisuke Maki 675bb8b7c0 refactor deep blocks 2014-07-03 19:05:01 +09:00
Daisuke Maki 888f8fd7b3 style fix 2014-07-03 16:32:24 +09:00
Daisuke Maki ca5cbb6fb1 Refactor keymap
Created Action/ActionFunc to wrap common operations
refs #121
2014-07-02 21:31:49 +09:00
mattn 539d404868 Refactor workaround code 2014-06-25 10:16:35 +09:00
mattn cfcd30edcd Don't handle ModAlt if no M-XXX mappings 2014-06-25 09:50:30 +09:00
Daisuke Maki f55b8496f5 change delay to 200 2014-06-25 08:53:57 +09:00
Daisuke Maki 3d91dc37e0 Protect mod with a mutex
The reason I'm not using defer mutex.Unlock() here is because I don't
want to keep the mutex around while handleKeyEvent() is being
processed.
2014-06-25 08:51:58 +09:00
Daisuke Maki 30107213b3 Modify comments so I know what's going on 2014-06-25 06:19:01 +09:00
mattn 61a8f7c8a2 Handle Alt/Esc both 2014-06-25 03:36:48 +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
Daisuke Maki c3f3ad2686 Make sore to keep polling for events 2014-06-16 09:57:57 +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 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
Daisuke Maki 8bde00d181 Allow moving caret, and insert/delete based on that position 2014-06-11 13:21:12 +09:00
Daisuke Maki b6f3d5b268 start out by displaying the caret 2014-06-11 12:56:11 +09:00
Daisuke Maki 30957e24f1 Attempt to implement keymaps 2014-06-11 10:18:23 +09:00
Daisuke Maki 17bc6ab0d1 Rename project to peco 2014-06-10 13:19:45 +09:00
Daisuke Maki 98a68a6306 Allow paing via left/right arrows 2014-06-10 11:48:50 +09:00
Daisuke Maki 137cbb16b1 Move stuff around 2014-06-10 10:55:21 +09:00