updates

- better handling of narrowed buffer
- fixed bug on completing replce without matches