Adds "search wrapped" message

This commit is contained in:
Dan Kaplun 2014-05-03 06:10:04 -05:00
parent 9bfeb1d861
commit 935e7d6aab

View File

@ -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');