summaryrefslogtreecommitdiff
path: root/src/item.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-06-14 12:25:08 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-06-14 12:25:08 +0900
commit6c99cc1700fda0c04500ee03b7e5f3ca22c7710c (patch)
treea6a671d49f562937a50d15c7439fe7682e7033d5 /src/item.go
parentfe5b190a7d8612bb90de272d26470bd02dc76a64 (diff)
downloadfzf-6c99cc1700fda0c04500ee03b7e5f3ca22c7710c.tar.gz
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 {}']"
Diffstat (limited to 'src/item.go')
-rw-r--r--src/item.go9
1 files changed, 7 insertions, 2 deletions
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 {