move-point.mjs 299 B

12345678910
  1. export default movePoint
  2. // Note! `move` only works inside lines! It’s not possible to move past other
  3. // chunks (replacement characters, tabs, or line endings).
  4. function movePoint(point, offset) {
  5. point.column += offset
  6. point.offset += offset
  7. point._bufferIndex += offset
  8. return point
  9. }