MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / clipToLine

Function clipToLine

static/js/codemirror/keymap/vim.js:1510–1517  ·  view source on GitHub ↗
(cm, curStart, curEnd)

Source from the content-addressed store, hash-verified

1508 // 'dw' should word, but not the newline, while 'w' should advance the
1509 // caret to the first character of the next line.
1510 function clipToLine(cm, curStart, curEnd) {
1511 var selection = cm.getRange(curStart, curEnd);
1512 var lines = selection.split('\n');
1513 if (lines.length > 1 && isWhiteSpaceString(lines.pop())) {
1514 curEnd.line--;
1515 curEnd.ch = lineLength(cm, curEnd.line);
1516 }
1517 }
1518
1519 // Expand the selection to line ends.
1520 function expandSelectionToLine(cm, curStart, curEnd) {

Callers 1

VimFunction · 0.85

Calls 4

isWhiteSpaceStringFunction · 0.85
lineLengthFunction · 0.70
splitMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected