eval { if ($direction eq '-forward') { $w->markSet('insert', 'sel.last'); $w->markSet('current', 'sel.last'); } else { $w->markSet('insert', 'sel.first'); $w->markSet('current', 'sel.first'); } };