mirror of
https://github.com/linuxserver/core.git
synced 2026-02-20 05:07:19 +08:00
fix regression in stripws
This commit is contained in:
parent
ea4f64e0c7
commit
23cbb33833
4
node_modules/ace/lib/ace/ext/whitespace.js
generated
vendored
4
node_modules/ace/lib/ace/ext/whitespace.js
generated
vendored
@ -131,7 +131,7 @@ exports.trimTrailingSpace = function(session, options) {
|
||||
if (options && options.keepCursorPosition) {
|
||||
if (session.selection.rangeCount) {
|
||||
session.selection.rangeList.ranges.forEach(function(x, i, ranges) {
|
||||
var next = ranges[i + 1]
|
||||
var next = ranges[i + 1];
|
||||
if (next && next.cursor.row == x.cursor.row)
|
||||
return;
|
||||
cursors.push(x.cursor);
|
||||
@ -148,7 +148,7 @@ exports.trimTrailingSpace = function(session, options) {
|
||||
var index = line.search(/\s+$/);
|
||||
|
||||
if (i == cursorRow) {
|
||||
if (index < cursors[ci].column)
|
||||
if (index < cursors[ci].column && index > min)
|
||||
index = cursors[ci].column;
|
||||
ci++;
|
||||
cursorRow = cursors[ci] ? cursors[ci].row : -1;
|
||||
|
||||
11
node_modules/ace/lib/ace/ext/whitespace_test.js
generated
vendored
11
node_modules/ace/lib/ace/ext/whitespace_test.js
generated
vendored
@ -183,6 +183,17 @@ module.exports = {
|
||||
trimEmpty: true,
|
||||
keepCursorPosition: true
|
||||
});
|
||||
|
||||
session.setValue("some text");
|
||||
session.selection.fromJSON([{
|
||||
start: {row:0,column:4},
|
||||
end: {row:0,column:4}
|
||||
}]);
|
||||
testOne("some text", {
|
||||
keepCursorPosition: true,
|
||||
trimEmpty: true
|
||||
});
|
||||
|
||||
next();
|
||||
},
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user