branch: externals/jinx commit 03721c03805f87126dcd54174ceeb3b1384e2e37 Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
jinx--check-region: Move forward or backward to word boundary --- jinx.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/jinx.el b/jinx.el index 8320fd821b..72e1f9f831 100644 --- a/jinx.el +++ b/jinx.el @@ -342,11 +342,13 @@ position." (set-syntax-table jinx--syntax-table) ;; Ensure that region starts and ends at word boundaries (goto-char start) - (re-search-backward "\\s-\\|^") - (setq start (match-end 0)) + (unless (looking-at-p "\\<") + (re-search-backward "\\<\\|^") + (setq start (match-beginning 0))) (goto-char end) - (re-search-forward "\\s-\\|$") - (setq end (match-beginning 0)) + (unless (looking-at-p "\\>") + (re-search-forward "\\>\\|$") + (setq end (match-beginning 0))) (jinx--delete-overlays start end) (goto-char start) (while (re-search-forward "\\<\\w+\\>" end t)