MCPcopy
hub / github.com/philc/vimium / yank

Method yank

content_scripts/mode_visual.js:407–423  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

405
406 // Yank the selection; always exits; collapses the selection; set @yankedText and return it.
407 yank(args) {
408 if (args == null) {
409 args = {};
410 }
411 this.yankedText = this.selection.toString();
412 this.exit();
413 HUD.copyToClipboard(this.yankedText);
414
415 let message = this.yankedText.replace(/\s+/g, " ");
416 if (15 < this.yankedText.length) {
417 message = message.slice(0, 12) + "...";
418 }
419 const plural = this.yankedText.length === 1 ? "" : "s";
420 HUD.show(`Yanked ${this.yankedText.length} character${plural}: \"${message}\".`, 2500);
421
422 return this.yankedText;
423 }
424}
425
426// A movement can be either a string or a function.

Callers 5

initMethod · 0.95
"y"Function · 0.80
"Y"Function · 0.80
"p"Function · 0.80
"P"Function · 0.80

Calls 2

exitMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected