Fix #2, set v:searchforward outside function