MCPcopy
hub / github.com/kekingcn/kkFileView / indexOf

Function indexOf

server/src/main/resources/static/js/codemirror.js:50–52  ·  view source on GitHub ↗
(array,elt)

Source from the content-addressed store, hash-verified

48{return n+(end-i)}
49n+=nextTab-i;n+=tabSize-(n%tabSize);i=nextTab+1;}}
50var Delayed=function(){this.id=null;this.f=null;this.time=0;this.handler=bind(this.onTimeout,this);};Delayed.prototype.onTimeout=function(self){self.id=0;if(self.time<=+new Date){self.f();}else{setTimeout(self.handler,self.time- +new Date);}};Delayed.prototype.set=function(ms,f){this.f=f;var time=+new Date+ms;if(!this.id||time<this.time){clearTimeout(this.id);this.id=setTimeout(this.handler,ms);this.time=time;}};function indexOf(array,elt){for(var i=0;i<array.length;++i)
51{if(array[i]==elt){return i}}
52return-1}
53var scrollerGap=50;var Pass={toString:function(){return"CodeMirror.Pass"}};var sel_dontScroll={scroll:false},sel_mouse={origin:"*mouse"},sel_move={origin:"+move"};function findColumn(string,goal,tabSize){for(var pos=0,col=0;;){var nextTab=string.indexOf("\t",pos);if(nextTab==-1){nextTab=string.length;}
54var skipped=nextTab-pos;if(nextTab==string.length||col+skipped>=goal)
55{return pos+Math.min(skipped,goal-col)}

Callers 14

offFunction · 0.70
signalCursorActivityFunction · 0.70
lineNoFunction · 0.70
removeReadOnlyRangesFunction · 0.70
regLineChangeFunction · 0.70
patchDisplayFunction · 0.70
normalizeSelectionFunction · 0.70
copyHistoryArrayFunction · 0.70
makeChangeInnerFunction · 0.70
loopFunction · 0.70
codemirror.jsFile · 0.70
readTextFromFileFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected