mirror of
https://github.com/peco/peco.git
synced 2026-09-10 07:16:29 -04:00
Merge pull request #175 from kei-s/fix-prompt-option
Fix to show prompt by command line option
This commit is contained in:
commit
e11b2b8ab5
|
|
@ -161,6 +161,10 @@ func main() {
|
|||
}
|
||||
}
|
||||
|
||||
if len(opts.OptPrompt) > 0 {
|
||||
ctx.SetPrompt(opts.OptPrompt)
|
||||
}
|
||||
|
||||
// Deprecated. --no-ignore-case options will be removed in later.
|
||||
if opts.OptNoIgnoreCase {
|
||||
ctx.SetCurrentMatcher(peco.CaseSensitiveMatch)
|
||||
|
|
@ -225,10 +229,6 @@ func main() {
|
|||
view.Refresh()
|
||||
}
|
||||
|
||||
if len(opts.OptPrompt) > 0 {
|
||||
ctx.SetPrompt([]rune(opts.OptPrompt))
|
||||
}
|
||||
|
||||
ctx.WaitDone()
|
||||
|
||||
st = ctx.ExitStatus
|
||||
|
|
|
|||
6
ctx.go
6
ctx.go
|
|
@ -43,7 +43,6 @@ type Ctx struct {
|
|||
result []Match
|
||||
mutex sync.Mutex
|
||||
query []rune
|
||||
prompt []rune
|
||||
caretPos int
|
||||
currentLine int
|
||||
currentPage *PageInfo
|
||||
|
|
@ -69,7 +68,6 @@ func NewCtx(o CtxOptions) *Ctx {
|
|||
[]Match{},
|
||||
sync.Mutex{},
|
||||
[]rune{},
|
||||
[]rune{},
|
||||
0,
|
||||
o.InitialIndex(),
|
||||
&PageInfo{0, 1, 0},
|
||||
|
|
@ -289,6 +287,6 @@ func (s *signalHandler) Loop() {
|
|||
}
|
||||
}
|
||||
|
||||
func (c *Ctx) SetPrompt(p []rune) {
|
||||
c.prompt = p
|
||||
func (c *Ctx) SetPrompt(p string) {
|
||||
c.config.Prompt = p
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue