Improve history search behavior.

Cursor movement and kill/yank operations now break out of search mode
(with the buffer set to the current item). ^G now clears the buffer
when terminating the search (without touching the kill buffer).
This commit is contained in:
Dan Haffey 2015-11-15 16:52:59 -08:00 committed by Raymond Pasco
parent ca08029644
commit d6d460cd49

View File

@ -537,13 +537,11 @@
?: =(0 (lent buf.say.inp))
ta-bel
(ta-hom:ta-nex %set ~)
%l ?^ ris ta-bel
?: =(0 pos.inp) ta-bel
+>(pos.inp (dec pos.inp))
%r ?^ ris ta-bel
?: =((lent buf.say.inp) pos.inp)
%l ?: =(0 pos.inp) ta-bel
+>(pos.inp (dec pos.inp), ris ~)
%r ?: =((lent buf.say.inp) pos.inp)
ta-bel
+>(pos.inp +(pos.inp))
+>(pos.inp +(pos.inp), ris ~)
%u =. ris ~
?:(=(0 pos.hit) ta-bel (ta-mov (dec pos.hit)))
==
@ -584,7 +582,7 @@
|= key=@ud
^+ +>
?+ key ta-bel
%a +>(pos.inp 0)
%a +>(pos.inp 0, ris ~)
%b (ta-aro %l)
%c ta-bel(ris ~)
%d ?: &(=(0 pos.inp) =(0 (lent buf.say.inp)))
@ -592,11 +590,12 @@
ta-del
%e +>(pos.inp (lent buf.say.inp))
%f (ta-aro %r)
%g ta-bel(ris ~)
%g ?~ ris ta-bel
(ta-hom(pos.hit num.hit, ris ~) [%set ~])
%k =+ len=(lent buf.say.inp)
?: =(pos.inp len)
ta-bel
%- ta-hom(kil `(slag pos.inp buf.say.inp))
%- ta-hom(kil `(slag pos.inp buf.say.inp), ris ~)
(ta-cut pos.inp (sub len pos.inp))
%l +>(+> (se-blit %clr ~))
%n (ta-aro %d)
@ -611,6 +610,7 @@
ta-bel
=+ sop=?:(=(len pos.inp) (dec pos.inp) pos.inp)
=. pos.inp +(sop)
=. ris ~
%- ta-hom
:~ %mor
[%del sop]
@ -618,12 +618,12 @@
==
%u ?: =(0 pos.inp)
ta-bel
%- ta-hom(kil `(scag pos.inp buf.say.inp))
%- ta-hom(kil `(scag pos.inp buf.say.inp), ris ~)
(ta-cut 0 pos.inp)
%v ta-bel
%x +>(+> se-anon)
%y ?~ kil ta-bel
(ta-hom (ta-cat pos.inp u.kil))
(ta-hom(ris ~) (ta-cat pos.inp u.kil))
==
::
++ ta-cru :: hear crud