**Ver.1 Accumulating deltas**
Improved Text Editor scrolling with the trackpad,
by accumulating deltas that are less than one line/character.
Makes the scroll speed match the speed in other Blender editors,
and other macOS applications as well.
***
**Ver.2 Smooth scrolling**
In fact, it works much better, I prefer this way with gesture phases.
Implementing gesture phases: P2080 or https://developer.blender.org/D8760?id=31074
fix D8797 is also required for correct functioning.
```
lines=10
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -2708,6 +2708,15 @@ static int text_scroll_modal(bContext *C, wmOperator *op, const wmEvent *event)
ARegion *region = CTX_wm_region(C);
switch (event->type) {
+ case MOUSEPAN:
+ tsc->mval_delta[0] = event->x - event->prevx;
+ tsc->mval_delta[1] = event->y - event->prevy;
+ text_scroll_apply(C, op, event);
+ if (ELEM(GESTURE_PHASE_ENDED, event->phase, event->momentumPhase)) {
+ scroll_exit(C, op);
+ return OPERATOR_FINISHED;
+ }
+ break;
case MOUSEMOVE:
if (tsc->zone == SCROLLHANDLE_BAR) {
text_scroll_apply(C, op, event);
@@ -2759,7 +2768,8 @@ static int text_scroll_invoke(bContext *C, wmOperator *op, const wmEvent *event)
st->flags |= ST_SCROLL_SELECT;
- if (event->type == MOUSEPAN) {
+ /* Some devices, e.g. tablets, may not support phases. */
+ if (event->type == MOUSEPAN && !ISMOUSE_GESTURE_WITH_PHASE(event)) {
text_update_character_width(st);
tsc->mval_prev[0] = event->x;
```