MCPcopy Index your code
hub / github.com/DHTMLX/gantt / searchInVisualLine

Function searchInVisualLine

samples/common/codehighlight/codemirror.js:6909–6922  ·  view source on GitHub ↗
(partPos, dir, wrappedLineExtent)

Source from the content-addressed store, hash-verified

6907 // the current bidi part
6908
6909 var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {
6910 var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder
6911 ? new Pos(start.line, mv(ch, 1), "before")
6912 : new Pos(start.line, ch, "after"); };
6913
6914 for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {
6915 var part = bidi[partPos];
6916 var moveInStorageOrder = (dir > 0) == (part.level != 1);
6917 var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);
6918 if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }
6919 ch = moveInStorageOrder ? part.from : mv(part.to, -1);
6920 if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }
6921 }
6922 };
6923
6924 // Case 3a: Look for other bidi parts on the same visual line
6925 var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);

Callers 1

moveVisuallyFunction · 0.85

Calls 2

mvFunction · 0.85
getResFunction · 0.85

Tested by

no test coverage detected