MCPcopy
hub / github.com/witheve/Eve / getOption

Function getOption

src/codemirror.js:9775–9795  ·  view source on GitHub ↗
(name, cm, cfg)

Source from the content-addressed store, hash-verified

9773 }
9774
9775 function getOption(name, cm, cfg) {
9776 var option = options[name];
9777 cfg = cfg || {};
9778 var scope = cfg.scope;
9779 if (!option) {
9780 throw Error('Unknown option: ' + name);
9781 }
9782 if (option.callback) {
9783 var local = cm && option.callback(undefined, cm);
9784 if (scope !== 'global' && local !== undefined) {
9785 return local;
9786 }
9787 if (scope !== 'local') {
9788 return option.callback();
9789 }
9790 return;
9791 } else {
9792 var local = (scope !== 'global') && (cm && cm.state.vim.options[name]);
9793 return (local || (scope !== 'local') && option || {}).value;
9794 }
9795 }
9796
9797 defineOption('filetype', undefined, 'string', ['ft'], function(name, cm) {
9798 // Option is local. Do nothing for global.

Callers 3

handleKeyInsertModeFunction · 0.85
parseQueryFunction · 0.85
VimFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected