1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

math: move the math.mathutil generic min/max/abs fns to math (#13042)

This commit is contained in:
Delyan Angelov
2022-01-05 18:02:20 +02:00
committed by GitHub
parent de711da774
commit 59357e873d
24 changed files with 180 additions and 100 deletions

View File

@ -3,8 +3,8 @@
// Don't use this editor for any serious work.
// A lot of funtionality is missing compared to your favourite editor :)
import strings
import math.mathutil as mu
import os
import math
import term.ui as tui
enum Movement {
@ -330,11 +330,11 @@ fn (mut b Buffer) move_cursor(amount int, movement Movement) {
}
}
.page_up {
dlines := mu.min(b.cursor.pos_y, amount)
dlines := math.min(b.cursor.pos_y, amount)
b.move_updown(-dlines)
}
.page_down {
dlines := mu.min(b.lines.len - 1, b.cursor.pos_y + amount) - b.cursor.pos_y
dlines := math.min(b.lines.len - 1, b.cursor.pos_y + amount) - b.cursor.pos_y
b.move_updown(dlines)
}
.left {