mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-09-18 07:40:42 +00:00
Change to natural counting in range[N] operator (#3609)
* Add range operator and documentation * Use 1-based counting in range[N], update docs
This commit is contained in:
committed by
Jeremy Ruston
parent
0f3912ba95
commit
b9df224f99
@@ -34,8 +34,16 @@ exports.range = function(source,operator,options) {
|
||||
}
|
||||
switch(parts.length) {
|
||||
case 1:
|
||||
beg = 0;
|
||||
end = parts[0];
|
||||
if (end >= 1) {
|
||||
beg = 1;
|
||||
}
|
||||
else if (end <= -1) {
|
||||
beg = -1;
|
||||
}
|
||||
else {
|
||||
return [];
|
||||
}
|
||||
inc = 1;
|
||||
break;
|
||||
case 2:
|
||||
|
||||
Reference in New Issue
Block a user