MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / getIndex

Function getIndex

lib/web/CodeMirror/keymap/vim.js:3099–3108  ·  view source on GitHub ↗
(ranges, cursor, end)

Source from the content-addressed store, hash-verified

3097 }
3098 // getIndex returns the index of the cursor in the selections.
3099 function getIndex(ranges, cursor, end) {
3100 for (var i = 0; i < ranges.length; i++) {
3101 var atAnchor = end != 'head' && cursorEqual(ranges[i].anchor, cursor);
3102 var atHead = end != 'anchor' && cursorEqual(ranges[i].head, cursor);
3103 if (atAnchor || atHead) {
3104 return i;
3105 }
3106 }
3107 return -1;
3108 }
3109 function getSelectedAreaRange(cm, vim) {
3110 var lastSelection = vim.lastSelection;
3111 var getCurrentSelectedAreaRange = function() {

Callers 1

selectBlockFunction · 0.85

Calls 1

cursorEqualFunction · 0.85

Tested by

no test coverage detected