From 6c99cc1700fda0c04500ee03b7e5f3ca22c7710c Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 14 Jun 2015 12:25:08 +0900 Subject: Add bind action for executing arbitrary command (#265) e.g. fzf --bind "ctrl-m:execute(less {})" fzf --bind "ctrl-t:execute[tmux new-window -d 'vim {}']" --- src/item.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/item.go') diff --git a/src/item.go b/src/item.go index 7c2f94d5..1eeb1802 100644 --- a/src/item.go +++ b/src/item.go @@ -86,10 +86,15 @@ func (i *Item) Rank(cache bool) Rank { // AsString returns the original string func (i *Item) AsString() string { + return *i.StringPtr() +} + +// StringPtr returns the pointer to the original string +func (i *Item) StringPtr() *string { if i.origText != nil { - return *i.origText + return i.origText } - return *i.text + return i.text } func (item *Item) colorOffsets(color int, bold bool, current bool) []colorOffset { -- cgit v1.2.3