bugfix: special last_buf buf would lead to errors when global search is not used. thanks LazyZhu for reporting this in github issue #2.