1
0
鏡像自 https://github.com/quitesimpleorg/hs9001.git 已同步 2025-07-01 21:03:49 +02:00

3 次程式碼提交

作者 SHA1 備註 日期
bb2450b8ec history: Only start search when at least 2 chars have been entered
Starting search with the first character leads to a noticable delay.
This hack ensures a more pleasant experience.
2021-08-08 12:38:25 +02:00
67050d32b9 Implement bash CTRL-R reverse history
Fork customized liner into own repo bash.
Rename -being and -end options to -after and -before.
2021-08-08 11:40:33 +02:00
33183dd7d3 Begin liner integration 2021-08-08 11:40:33 +02:00

查看文件

@ -12,6 +12,10 @@ type history struct {
}
func (h *history) GetHistoryByPrefix(prefix string) (ph []string) {
/* Hack for performance reasons */
if len(prefix) < 2 {
return
}
opts := searchopts{}
opts.order = "DESC"
cmdqry := prefix + "%"
@ -27,6 +31,10 @@ func (h *history) GetHistoryByPrefix(prefix string) (ph []string) {
return
}
func (h *history) GetHistoryByPattern(pattern string) (ph []string, pos []int) {
/* Hack for performance reasons */
if len(pattern) < 2 {
return
}
opts := searchopts{}
opts.order = "DESC"
cmdqry := "%" + pattern + "%"