codemirror
Advanced tools
Comparing version 5.55.0 to 5.56.0
@@ -382,8 +382,10 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others | ||
scrollToActive: function() { | ||
var node = this.hints.childNodes[this.selectedHint] | ||
var margin = this.completion.options.scrollMargin || 0; | ||
var node1 = this.hints.childNodes[Math.max(0, this.selectedHint - margin)]; | ||
var node2 = this.hints.childNodes[Math.min(this.data.list.length - 1, this.selectedHint + margin)]; | ||
var firstNode = this.hints.firstChild; | ||
if (node.offsetTop < this.hints.scrollTop) | ||
this.hints.scrollTop = node.offsetTop - firstNode.offsetTop; | ||
else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight) | ||
this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + firstNode.offsetTop; | ||
if (node1.offsetTop < this.hints.scrollTop) | ||
this.hints.scrollTop = node1.offsetTop - firstNode.offsetTop; | ||
else if (node2.offsetTop + node2.offsetHeight > this.hints.scrollTop + this.hints.clientHeight) | ||
this.hints.scrollTop = node2.offsetTop + node2.offsetHeight - this.hints.clientHeight + firstNode.offsetTop; | ||
}, | ||
@@ -390,0 +392,0 @@ |
@@ -267,3 +267,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others | ||
if (token.string.match(/^[.`"\w@][\w$#]*$/g)) { | ||
if (token.string.match(/^[.`"'\w@][\w$#]*$/g)) { | ||
search = token.string; | ||
@@ -270,0 +270,0 @@ start = token.start; |
@@ -32,3 +32,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others | ||
function findBreakPoint(text, column, wrapOn, killTrailingSpace) { | ||
function findBreakPoint(text, column, wrapOn, killTrailingSpace, forceBreak) { | ||
var at = column | ||
@@ -38,2 +38,11 @@ while (at < text.length && text.charAt(at) == " ") at++ | ||
if (wrapOn.test(text.slice(at - 1, at + 1))) break; | ||
if (at == 0 && !forceBreak) { | ||
// didn't find a break point before column, in non-forceBreak mode try to | ||
// find one after 'column'. | ||
for (at = column + 1; at < text.length - 1; ++at) { | ||
if (wrapOn.test(text.slice(at - 1, at + 1))) break; | ||
} | ||
} | ||
for (var first = true;; first = false) { | ||
@@ -52,2 +61,3 @@ var endOfText = at; | ||
var wrapOn = options.wrapOn || /\s\S|-[^\.\d]/; | ||
var forceBreak = options.forceBreak !== false; | ||
var killTrailing = options.killTrailingSpace !== false; | ||
@@ -74,3 +84,3 @@ var changes = [], curLine = "", curNo = from.line; | ||
var firstBreak = curLine.length > column && leadingSpace == spaceTrimmed && | ||
findBreakPoint(curLine, column, wrapOn, killTrailing); | ||
findBreakPoint(curLine, column, wrapOn, killTrailing, forceBreak); | ||
// If this isn't broken, or is broken at a different point, remove old break | ||
@@ -87,8 +97,12 @@ if (!firstBreak || firstBreak.from != oldLen || firstBreak.to != oldLen + spaceInserted) { | ||
while (curLine.length > column) { | ||
var bp = findBreakPoint(curLine, column, wrapOn, killTrailing); | ||
changes.push({text: ["", leadingSpace], | ||
from: Pos(curNo, bp.from), | ||
to: Pos(curNo, bp.to)}); | ||
curLine = leadingSpace + curLine.slice(bp.to); | ||
++curNo; | ||
var bp = findBreakPoint(curLine, column, wrapOn, killTrailing, forceBreak); | ||
if (bp.from != bp.to || forceBreak) { | ||
changes.push({text: ["", leadingSpace], | ||
from: Pos(curNo, bp.from), | ||
to: Pos(curNo, bp.to)}); | ||
curLine = leadingSpace + curLine.slice(bp.to); | ||
++curNo; | ||
} else { | ||
break; | ||
} | ||
} | ||
@@ -95,0 +109,0 @@ } |
@@ -91,3 +91,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others | ||
//proc and datastep | ||
define('def', '_all_ _character_ _cmd_ _freq_ _i_ _infile_ _last_ _msg_ _null_ _numeric_ _temporary_ _type_ abort abs addr adjrsq airy alpha alter altlog altprint and arcos array arsin as atan attrc attrib attrn authserver autoexec awscontrol awsdef awsmenu awsmenumerge awstitle backward band base betainv between blocksize blshift bnot bor brshift bufno bufsize bxor by byerr byline byte calculated call cards cards4 catcache cbufno cdf ceil center cexist change chisq cinv class cleanup close cnonct cntllev coalesce codegen col collate collin column comamid comaux1 comaux2 comdef compbl compound compress config continue convert cos cosh cpuid create cross crosstab css curobs cv daccdb daccdbsl daccsl daccsyd dacctab dairy datalines datalines4 datejul datepart datetime day dbcslang dbcstype dclose ddm delete delimiter depdb depdbsl depsl depsyd deptab dequote descending descript design= device dflang dhms dif digamma dim dinfo display distinct dkricond dkrocond dlm dnum do dopen doptname doptnum dread drop dropnote dsname dsnferr echo else emaildlg emailid emailpw emailserver emailsys encrypt end endsas engine eof eov erf erfc error errorcheck errors exist exp fappend fclose fcol fdelete feedback fetch fetchobs fexist fget file fileclose fileexist filefmt filename fileref fmterr fmtsearch fnonct fnote font fontalias fopen foptname foptnum force formatted formchar formdelim formdlim forward fpoint fpos fput fread frewind frlen from fsep fuzz fwrite gaminv gamma getoption getvarc getvarn go goto group gwindow hbar hbound helpenv helploc hms honorappearance hosthelp hostprint hour hpct html hvar ibessel ibr id if index indexc indexw initcmd initstmt inner input inputc inputn inr insert int intck intnx into intrr invaliddata irr is jbessel join juldate keep kentb kurtosis label lag last lbound leave left length levels lgamma lib library libref line linesize link list log log10 log2 logpdf logpmf logsdf lostcard lowcase lrecl ls macro macrogen maps mautosource max maxdec maxr mdy mean measures median memtype merge merror min minute missing missover mlogic mod mode model modify month mopen mort mprint mrecall msglevel msymtabmax mvarsize myy n nest netpv new news nmiss no nobatch nobs nocaps nocardimage nocenter nocharcode nocmdmac nocol nocum nodate nodbcs nodetails nodmr nodms nodmsbatch nodup nodupkey noduplicates noechoauto noequals noerrorabend noexitwindows nofullstimer noicon noimplmac noint nolist noloadlist nomiss nomlogic nomprint nomrecall nomsgcase nomstored nomultenvappl nonotes nonumber noobs noovp nopad nopercent noprint noprintinit normal norow norsasuser nosetinit nosplash nosymbolgen note notes notitle notitles notsorted noverbose noxsync noxwait npv null number numkeys nummousekeys nway obs on open order ordinal otherwise out outer outp= output over ovp p(1 5 10 25 50 75 90 95 99) pad pad2 paired parm parmcards path pathdll pathname pdf peek peekc pfkey pmf point poisson poke position printer probbeta probbnml probchi probf probgam probhypr probit probnegb probnorm probsig probt procleave prt ps pw pwreq qtr quote r ranbin rancau ranexp rangam range ranks rannor ranpoi rantbl rantri ranuni read recfm register regr remote remove rename repeat replace resolve retain return reuse reverse rewind right round rsquare rtf rtrace rtraceloc s s2 samploc sasautos sascontrol sasfrscr sasmsg sasmstore sasscript sasuser saving scan sdf second select selection separated seq serror set setcomm setot sign simple sin sinh siteinfo skewness skip sle sls sortedby sortpgm sortseq sortsize soundex spedis splashlocation split spool sqrt start std stderr stdin stfips stimer stname stnamel stop stopover subgroup subpopn substr sum sumwgt symbol symbolgen symget symput sysget sysin sysleave sysmsg sysparm sysprint sysprintfont sysprod sysrc system t table tables tan tanh tapeclose tbufsize terminal test then timepart tinv tnonct to today tol tooldef totper transformout translate trantab tranwrd trigamma trim trimn trunc truncover type unformatted uniform union until upcase update user usericon uss validate value var weight when where while wincharset window work workinit workterm write wsum xsync xwait yearcutoff yes yyq min max', ['inDataStep', 'inProc']); | ||
define('def', '_all_ _character_ _cmd_ _freq_ _i_ _infile_ _last_ _msg_ _null_ _numeric_ _temporary_ _type_ abort abs addr adjrsq airy alpha alter altlog altprint and arcos array arsin as atan attrc attrib attrn authserver autoexec awscontrol awsdef awsmenu awsmenumerge awstitle backward band base betainv between blocksize blshift bnot bor brshift bufno bufsize bxor by byerr byline byte calculated call cards cards4 catcache cbufno cdf ceil center cexist change chisq cinv class cleanup close cnonct cntllev coalesce codegen col collate collin column comamid comaux1 comaux2 comdef compbl compound compress config continue convert cos cosh cpuid create cross crosstab css curobs cv daccdb daccdbsl daccsl daccsyd dacctab dairy datalines datalines4 datejul datepart datetime day dbcslang dbcstype dclose ddfm ddm delete delimiter depdb depdbsl depsl depsyd deptab dequote descending descript design= device dflang dhms dif digamma dim dinfo display distinct dkricond dkrocond dlm dnum do dopen doptname doptnum dread drop dropnote dsname dsnferr echo else emaildlg emailid emailpw emailserver emailsys encrypt end endsas engine eof eov erf erfc error errorcheck errors exist exp fappend fclose fcol fdelete feedback fetch fetchobs fexist fget file fileclose fileexist filefmt filename fileref fmterr fmtsearch fnonct fnote font fontalias fopen foptname foptnum force formatted formchar formdelim formdlim forward fpoint fpos fput fread frewind frlen from fsep fuzz fwrite gaminv gamma getoption getvarc getvarn go goto group gwindow hbar hbound helpenv helploc hms honorappearance hosthelp hostprint hour hpct html hvar ibessel ibr id if index indexc indexw initcmd initstmt inner input inputc inputn inr insert int intck intnx into intrr invaliddata irr is jbessel join juldate keep kentb kurtosis label lag last lbound leave left length levels lgamma lib library libref line linesize link list log log10 log2 logpdf logpmf logsdf lostcard lowcase lrecl ls macro macrogen maps mautosource max maxdec maxr mdy mean measures median memtype merge merror min minute missing missover mlogic mod mode model modify month mopen mort mprint mrecall msglevel msymtabmax mvarsize myy n nest netpv new news nmiss no nobatch nobs nocaps nocardimage nocenter nocharcode nocmdmac nocol nocum nodate nodbcs nodetails nodmr nodms nodmsbatch nodup nodupkey noduplicates noechoauto noequals noerrorabend noexitwindows nofullstimer noicon noimplmac noint nolist noloadlist nomiss nomlogic nomprint nomrecall nomsgcase nomstored nomultenvappl nonotes nonumber noobs noovp nopad nopercent noprint noprintinit normal norow norsasuser nosetinit nosplash nosymbolgen note notes notitle notitles notsorted noverbose noxsync noxwait npv null number numkeys nummousekeys nway obs on open order ordinal otherwise out outer outp= output over ovp p(1 5 10 25 50 75 90 95 99) pad pad2 paired parm parmcards path pathdll pathname pdf peek peekc pfkey pmf point poisson poke position printer probbeta probbnml probchi probf probgam probhypr probit probnegb probnorm probsig probt procleave prt ps pw pwreq qtr quote r ranbin rancau random ranexp rangam range ranks rannor ranpoi rantbl rantri ranuni rcorr read recfm register regr remote remove rename repeat repeated replace resolve retain return reuse reverse rewind right round rsquare rtf rtrace rtraceloc s s2 samploc sasautos sascontrol sasfrscr sasmsg sasmstore sasscript sasuser saving scan sdf second select selection separated seq serror set setcomm setot sign simple sin sinh siteinfo skewness skip sle sls sortedby sortpgm sortseq sortsize soundex spedis splashlocation split spool sqrt start std stderr stdin stfips stimer stname stnamel stop stopover sub subgroup subpopn substr sum sumwgt symbol symbolgen symget symput sysget sysin sysleave sysmsg sysparm sysprint sysprintfont sysprod sysrc system t table tables tan tanh tapeclose tbufsize terminal test then timepart tinv tnonct to today tol tooldef totper transformout translate trantab tranwrd trigamma trim trimn trunc truncover type unformatted uniform union until upcase update user usericon uss validate value var weight when where while wincharset window work workinit workterm write wsum xsync xwait yearcutoff yes yyq min max', ['inDataStep', 'inProc']); | ||
define('operator', 'and not ', ['inDataStep', 'inProc']); | ||
@@ -94,0 +94,0 @@ |
@@ -37,5 +37,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others | ||
"default": { noEndTag: true, reduceIndent: true}, | ||
"foreach": { variableScope: true, soyState: "var-def" }, | ||
"foreach": { variableScope: true, soyState: "for-loop" }, | ||
"ifempty": { noEndTag: true, reduceIndent: true}, | ||
"for": { variableScope: true, soyState: "var-def" }, | ||
"for": { variableScope: true, soyState: "for-loop" }, | ||
"call": { soyState: "templ-ref" }, | ||
@@ -133,2 +133,3 @@ "param": { soyState: "param-ref"}, | ||
state.soyState.push("list-literal"); | ||
state.context = new Context(state.context, "list-literal", state.variables); | ||
state.lookupVariables = false; | ||
@@ -261,2 +262,7 @@ return null; | ||
} | ||
if (match = stream.match(/^\$([\w]+)/)) { | ||
state.soyState.pop(); | ||
return ref(state.variables, match[1], !state.lookupVariables); | ||
} | ||
stream.next(); | ||
@@ -306,2 +312,5 @@ return null; | ||
return null; | ||
} else if (peekChar == "(") { | ||
state.soyState.push('param-type-template'); | ||
return null; | ||
} else if (peekChar == "<") { | ||
@@ -341,2 +350,15 @@ state.soyState.push('param-type-parameter'); | ||
case "param-type-template": | ||
if (stream.match(/[>]/)) { | ||
state.soyState.pop(); | ||
state.soyState.push('param-type'); | ||
return null; | ||
} | ||
if (stream.match(/^\w+/)) { | ||
state.soyState.push('param-type'); | ||
return "def"; | ||
} | ||
stream.next(); | ||
return null; | ||
case "var-def": | ||
@@ -351,2 +373,14 @@ if (match = stream.match(/^\$([\w]+)/)) { | ||
case "for-loop": | ||
if (stream.match(/\bin\b/)) { | ||
state.soyState.pop(); | ||
return "keyword"; | ||
} | ||
if (stream.peek() == "$") { | ||
state.soyState.push('var-def'); | ||
return null; | ||
} | ||
stream.next(); | ||
return null; | ||
case "record-literal": | ||
@@ -382,9 +416,8 @@ if (stream.match(/^[)]/)) { | ||
state.lookupVariables = true; | ||
popcontext(state); | ||
return null; | ||
} | ||
if (stream.match(/for\b/)) { | ||
state.soyState.push("var-def") | ||
return "keyword"; | ||
} else if (stream.match(/in\b/)) { | ||
if (stream.match(/\bfor\b/)) { | ||
state.lookupVariables = true; | ||
state.soyState.push('for-loop'); | ||
return "keyword"; | ||
@@ -412,2 +445,22 @@ } | ||
case "import": | ||
if (stream.eat(";")) { | ||
state.soyState.pop(); | ||
state.indent -= 2 * config.indentUnit; | ||
return null; | ||
} | ||
if (stream.match(/\w+(?=\s+as)/)) { | ||
return "variable"; | ||
} | ||
if (match = stream.match(/\w+/)) { | ||
return /(from|as)/.test(match[0]) ? "keyword" : "def"; | ||
} | ||
if (match = stream.match(/^["']/)) { | ||
state.soyState.push("string"); | ||
state.quoteKind = match[0]; | ||
return "string"; | ||
} | ||
stream.next(); | ||
return null; | ||
case "tag": | ||
@@ -510,2 +563,6 @@ var endTag = state.tag[0] == "/"; | ||
return "keyword"; | ||
} else if (!state.context && stream.match(/\bimport\b/)) { | ||
state.soyState.push("import"); | ||
state.indent += 2 * config.indentUnit; | ||
return "keyword"; | ||
} | ||
@@ -512,0 +569,0 @@ |
@@ -17,3 +17,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others | ||
{regex: /[+\-]?(?:nan(?::0x[0-9a-fA-F]+)?|infinity|inf|0x[0-9a-fA-F]+\.?[0-9a-fA-F]*p[+\/-]?\d+|\d+(?:\.\d*)?[eE][+\-]?\d*|\d+\.\d*|0x[0-9a-fA-F]+|\d+)/, token: "number"}, | ||
{regex: /mut|nop|block|if|then|else|loop|br_if|br_table|br|call(_indirect)?|drop|end|return(_call(_indirect)?)?|local\.(get|set|tee)|global\.(get|set)|i(32|64)\.(store(8|16)|(load(8|16)_[su]))|i64\.(load32_[su]|store32)|[fi](32|64)\.(const|load|store)|f(32|64)\.(abs|add|ceil|copysign|div|eq|floor|[gl][et]|max|min|mul|nearest|neg?|sqrt|sub|trunc)|i(32|64)\.(a[dn]d|c[lt]z|(div|rem)_[su]|eqz?|[gl][te]_[su]|mul|ne|popcnt|rot[lr]|sh(l|r_[su])|sub|x?or)|i64\.extend_[su]_i32|i32\.wrap_i64|i(32|64)\.trunc_f(32|64)_[su]|f(32|64)\.convert_i(32|64)_[su]|f64\.promote_f32|f32\.demote_f64|f32\.reinterpret_i32|i32\.reinterpret_f32|f64\.reinterpret_i64|i64\.reinterpret_f64|select|unreachable|current_memory|memory\.(size|grow)|type|func|param|result|local|global|module|table|memory|start|elem|data|align|offset|import|export|atomic\.notify|i64\.atomic\.(load32_u|store32|rmw32\.(a[dn]d|sub|x?or|(cmp)?xchg)_u)|i(32|64)\.atomic\.(wait|load((8|16)_u)?|store(8|16)?|rmw(\.(a[dn]d|sub|x?or|(cmp)?xchg)|(8|16)\.(a[dn]d|sub|x?or|(cmp)?xchg)_u))/, token: "keyword"}, | ||
{regex: /mut|nop|block|if|then|else|loop|br_if|br_table|br|call(_indirect)?|drop|end|return(_call(_indirect)?)?|local\.(get|set|tee)|global\.(get|set)|i(32|64)\.(store(8|16)|(load(8|16)_[su]))|i64\.(load32_[su]|store32)|[fi](32|64)\.(const|load|store)|f(32|64)\.(abs|add|ceil|copysign|div|eq|floor|[gl][et]|max|min|mul|nearest|neg?|sqrt|sub|trunc)|i(32|64)\.(a[dn]d|c[lt]z|(div|rem)_[su]|eqz?|[gl][te]_[su]|mul|ne|popcnt|rot[lr]|sh(l|r_[su])|sub|x?or)|i64\.extend_[su]_i32|i32\.wrap_i64|i(32|64)\.trunc_f(32|64)_[su]|f(32|64)\.convert_i(32|64)_[su]|f64\.promote_f32|f32\.demote_f64|f32\.reinterpret_i32|i32\.reinterpret_f32|f64\.reinterpret_i64|i64\.reinterpret_f64|select|unreachable|current_memory|memory(\.((atomic\.(notify|wait(32|64)))|grow|size))?|type|func|param|result|local|global|module|table|start|elem|data|align|offset|import|export|i64\.atomic\.(load32_u|store32|rmw32\.(a[dn]d|sub|x?or|(cmp)?xchg)_u)|i(32|64)\.atomic\.(load((8|16)_u)?|store(8|16)?|rmw(\.(a[dn]d|sub|x?or|(cmp)?xchg)|(8|16)\.(a[dn]d|sub|x?or|(cmp)?xchg)_u))|v128\.(load|store|const|not|andnot|and|or|xor|bitselect)|i(8x16|16x8|32x4|64x2)\.(shl|shr_[su])|i(8x16|16x8)\.(extract_lane_[su]|((add|sub)_saturate_[su])|avgr_u)|(i(8x16|16x8|32x4|64x2)|f(32x4|64x2))\.(splat|replace_lane|neg|add|sub)|i(8x16|16x8|32x4)\.(eq|ne|([lg][te]_[su])|abs|any_true|all_true|bitmask|((min|max)_[su]))|f(32x4|64x2)\.(eq|ne|[lg][te]|abs|sqrt|mul|div|min|max)|[fi](32x4|64x2)\.extract_lane|v8x16\.(shuffle|swizzle)|i16x8\.(load8x8_[su]|narrow_i32x4_[su]|widen_(low|high)_i8x16_[su]|mul)|i32x4\.(load16x4_[su]|widen_(low|high)_i16x8_[su]|mul|trunc_sat_f32x4_[su])|i64x2\.(load32x2_[su]|mul)|(v(8x16|16x8|32x4|64x2)\.load_splat)|i8x16\.narrow_i16x8_[su]|f32x4\.convert_i32x4_[su]/, token: "keyword"}, | ||
{regex: /\b(anyfunc|[fi](32|64))\b/, token: "atom"}, | ||
@@ -20,0 +20,0 @@ {regex: /\$([a-zA-Z0-9_`\+\-\*\/\\\^~=<>!\?@#$%&|:\.]+)/, token: "variable-2"}, |
{ | ||
"name": "codemirror", | ||
"version": "5.55.0", | ||
"version": "5.56.0", | ||
"main": "lib/codemirror.js", | ||
@@ -5,0 +5,0 @@ "style": "lib/codemirror.css", |
@@ -69,2 +69,2 @@ // EDITOR CONSTRUCTOR | ||
CodeMirror.version = "5.55.0" | ||
CodeMirror.version = "5.56.0" |
@@ -54,3 +54,3 @@ import { runInOp } from "../display/operations.js" | ||
to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)) | ||
else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted) | ||
else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == textLines.join("\n")) | ||
from = to = Pos(from.line, 0) | ||
@@ -136,2 +136,2 @@ } | ||
return div | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
2869730
64804