sandy

text editor
git clone git://git.suckless.org/sandy
Log | Files | Refs | README | LICENSE

commit 5088df23c7bd5aa3cfad8b860a08f89b4b96d1d9
parent bf136561b21a6a47e69fd4184a09d7a5f6077bb0
Author: Rafael Garcia <rafael.garcia.gallego@gmail.com>
Date:   Wed,  3 Aug 2011 15:37:48 +0200

Simpler, more consistent f_repeat for insert actions.
Diffstat:
sandy.c | 15++-------------
1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/sandy.c b/sandy.c @@ -399,25 +399,14 @@ f_pipero(const Arg *arg) { void /* Repeat the last action. Your responsibility: call only if t_rw() */ f_repeat(const Arg *arg) { - Filepos pos; - bool was_sel; - i_sortpos(&fsel, &fcur); switch(lastaction) { case LastDelete: if(t_sel()) f_delete(&(const Arg){ .m = m_tosel }); break; case LastInsert: - if(undos && undos->flags & UndoIns) { - if((was_sel=t_sel())) { /* Convenience: delete selection before repeating insertion */ - f_delete(&(const Arg) { .m = m_tosel }); - undos->flags^=RedoMore; - } - pos=fsel; - f_insert(&(const Arg){ .v = (was_sel?undos->prev:undos)->str }); - if(was_sel) undos->flags^=UndoMore; - fsel=pos; - } + if(undos && undos->flags & UndoIns) + f_insert(&(const Arg){ .v = undos->str }); break; case LastPipe: f_pipe(&(const Arg) { .v = getenv(envs[EnvPipe]) });