MCPcopy
hub / github.com/ajaxorg/ace / testSelection

Function testSelection

src/keyboard/vim_test.js:1724–1735  ·  view source on GitHub ↗
(name, before, pos, keys, sel)

Source from the content-addressed store, hash-verified

1722});
1723
1724function testSelection(name, before, pos, keys, sel) {
1725 return testVim(name, function(cm, vim, helpers) {
1726 var ch = before.search(pos)
1727 var line = before.substring(0, ch).split('\n').length - 1;
1728 if (line) {
1729 ch = before.substring(0, ch).split('\n').pop().length;
1730 }
1731 cm.setCursor(line, ch);
1732 helpers.doKeys.apply(this, keys.split(''));
1733 eq(sel, cm.getSelection());
1734 }, {value: before});
1735}
1736testSelection('viw_middle_spc', 'foo \tbAr\t baz', /A/, 'viw', 'bAr');
1737testSelection('vaw_middle_spc', 'foo \tbAr\t baz', /A/, 'vaw', 'bAr\t ');
1738testSelection('viw_middle_punct', 'foo \tbAr,\t baz', /A/, 'viw', 'bAr');

Callers 1

vim_test.jsFile · 0.70

Calls 6

testVimFunction · 0.85
splitMethod · 0.80
substringMethod · 0.80
popMethod · 0.80
eqFunction · 0.70
getSelectionMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…