()
| 2456 | } |
| 2457 | var startPos = clipCursorToContent(cm, { line: lineStart, ch: 0 }); |
| 2458 | function doReplace() { |
| 2459 | for (var cursor = cm.getSearchCursor(query, startPos); |
| 2460 | cursor.findNext() && |
| 2461 | isInRange(cursor.from(), lineStart, lineEnd);) { |
| 2462 | var text = cm.getRange(cursor.from(), cursor.to()); |
| 2463 | var newText = text.replace(query, replacePart); |
| 2464 | cursor.replace(newText); |
| 2465 | } |
| 2466 | var vim = getVimState(cm); |
| 2467 | if (vim.visualMode) { |
| 2468 | exitVisualMode(cm, vim); |
| 2469 | } |
| 2470 | } |
| 2471 | if (cm.compoundChange) { |
| 2472 | // Only exists in v2 |
| 2473 | cm.compoundChange(doReplace); |
nothing calls this directly
no test coverage detected