(count, backwards)
| 380 | |
| 381 | // find: (count, backwards) => |
| 382 | find(count, backwards) { |
| 383 | const initialRange = this.selection.getRangeAt(0).cloneRange(); |
| 384 | for (let i = 0, end = count; i < end; i++) { |
| 385 | const nextQuery = FindMode.getQuery(backwards); |
| 386 | if (!nextQuery) { |
| 387 | HUD.show("No query to find.", 1000); |
| 388 | return; |
| 389 | } |
| 390 | if (!FindMode.execute(nextQuery, { colorSelection: false, backwards })) { |
| 391 | this.movement.setSelectionRange(initialRange); |
| 392 | HUD.show(`No matches for '${FindMode.query.rawQuery}'`, 1000); |
| 393 | return; |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | // The find was successfull. If we're in caret mode, then we should now have a selection, so we |
| 398 | // can drop back into visual mode. |
| 399 | if ((this.name === "caret") && (this.selection.toString().length > 0)) { |
| 400 | const mode = new VisualMode(); |
| 401 | mode.init(); |
| 402 | return mode; |
| 403 | } |
| 404 | } |
| 405 | |
| 406 | // Yank the selection; always exits; collapses the selection; set @yankedText and return it. |
| 407 | yank(args) { |
no test coverage detected