From 935e7d6aaba51ff8f44be286473dce222cfcbe32 Mon Sep 17 00:00:00 2001 From: Dan Kaplun Date: Sat, 3 May 2014 06:10:04 -0500 Subject: [PATCH] Adds "search wrapped" message --- lib/slap.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/slap.js b/lib/slap.js index e4addbd..295f5a3 100644 --- a/lib/slap.js +++ b/lib/slap.js @@ -210,9 +210,9 @@ Slap.prototype._initHandlers = function () { } else { pos = textUtil.find(self.editor.lines(), pattern); if (pos) { - if (Coordinate.linear.cmp(pos, self.editor.cursor()) === 0) { - self.message("this is the only occurrence", 'info'); - } + self.message(Coordinate.linear.cmp(pos, self.editor.cursor()) !== 0 + ? "search wrapped" + : "this is the only occurrence", 'info'); self.editor.select(null, pos); } else { self.message("no matches", 'warning');