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

Function getOption

lib/web/CodeMirror/keymap/vim.js:506–526  ·  view source on GitHub ↗
(name, cm, cfg)

Source from the content-addressed store, hash-verified

504 }
505
506 function getOption(name, cm, cfg) {
507 var option = options[name];
508 cfg = cfg || {};
509 var scope = cfg.scope;
510 if (!option) {
511 return new Error('Unknown option: ' + name);
512 }
513 if (option.callback) {
514 var local = cm && option.callback(undefined, cm);
515 if (scope !== 'global' && local !== undefined) {
516 return local;
517 }
518 if (scope !== 'local') {
519 return option.callback();
520 }
521 return;
522 } else {
523 var local = (scope !== 'global') && (cm && cm.state.vim.options[name]);
524 return (local || (scope !== 'local') && option || {}).value;
525 }
526 }
527
528 defineOption('filetype', undefined, 'string', ['ft'], function(name, cm) {
529 // Option is local. Do nothing for global.

Callers 3

handleKeyInsertModeFunction · 0.70
parseQueryFunction · 0.70
VimFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected