MCPcopy Create free account
hub / github.com/breck7/scroll / skipExtendingChars

Function skipExtendingChars

external/.scrollLibs.js:825–830  ·  view source on GitHub ↗
(str, pos, dir)

Source from the content-addressed store, hash-verified

823
824 // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.
825 function skipExtendingChars(str, pos, dir) {
826 while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) {
827 pos += dir
828 }
829 return pos
830 }
831
832 // Returns the value from the range [`from`; `to`] that satisfies
833 // `pred` and is closest to `from`. Assumes that at least `to`

Callers 2

coordsCharInnerFunction · 0.85
moveCharLogicallyFunction · 0.85

Calls 1

isExtendingCharFunction · 0.85

Tested by

no test coverage detected