mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
given a list `A B C D` if I run `A B C D +[move:-1 [A]]` I get `B C A D`. However, if I were to do `A B C D +[move:1[D]]` it doesn't wrap around, and I get `A B C D`. This fixes that such that `A B C D +[move:-1 [A]]` gives 'A B C D`
This commit is contained in:
parent
52d32fe3fd
commit
9c3a6976f0
@ -84,8 +84,9 @@ Extended filter operators to manipulate the current list.
|
|||||||
var results = prepare_results(source),
|
var results = prepare_results(source),
|
||||||
index = results.indexOf(operator.operand),
|
index = results.indexOf(operator.operand),
|
||||||
count = parseInt(operator.suffix) || 1,
|
count = parseInt(operator.suffix) || 1,
|
||||||
marker = results.splice(index, 1);
|
marker = results.splice(index, 1),
|
||||||
return results.slice(0, index + count).concat(marker).concat(results.slice(index + count));
|
offset = (index + count) > 0 ? index + count : 0;
|
||||||
|
return results.slice(0, offset).concat(marker).concat(results.slice(offset));
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user