summaryrefslogtreecommitdiffstatshomepage
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 7a5a238df2..49ffd6ed2c 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -2912,9 +2912,10 @@ static void nv_zet(cmdarg_T *cap)
int n = curwin->w_view_width - win_col_off(curwin);
if (col + siso < n) {
col = 0;
- } else {
- // TODO(zeertzjq): check for overflow
+ } else if (siso - n < INT_MAX - col) {
col = (int)(col + siso - n + 1);
+ } else {
+ col = INT_MAX;
}
if (curwin->w_leftcol != col) {
curwin->w_leftcol = col;