From 7b0f7ea87c71ad79dfd9e087b5992761533bef6e Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Thu, 27 Nov 2014 20:33:11 -0300 Subject: ui: Move check_col/check_row functions to mbyte.c These functions were only being used by mbyte.c, so move them and add the "static" modifier. --- src/nvim/mbyte.c | 21 ++++++++++++++++++++- src/nvim/ui.c | 23 ----------------------- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index 2240c1fe83..d79a46ceaa 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -103,7 +103,6 @@ #include "nvim/screen.h" #include "nvim/spell.h" #include "nvim/strings.h" -#include "nvim/ui.h" #include "nvim/os/os.h" #include "nvim/arabic.h" @@ -3972,3 +3971,23 @@ char_u * string_convert_ext(vimconv_T *vcp, char_u *ptr, int *lenp, return retval; } + +// Check bounds for column number +static int check_col(int col) +{ + if (col < 0) + return 0; + if (col >= (int)screen_Columns) + return (int)screen_Columns - 1; + return col; +} + +// Check bounds for row number +static int check_row(int row) +{ + if (row < 0) + return 0; + if (row >= (int)screen_Rows) + return (int)screen_Rows - 1; + return row; +} diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 7b34ff9d55..526cc3e47e 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -102,26 +102,3 @@ void ui_cursor_shape(void) conceal_check_cursur_line(); } -/* - * Check bounds for column number - */ -int check_col(int col) -{ - if (col < 0) - return 0; - if (col >= (int)screen_Columns) - return (int)screen_Columns - 1; - return col; -} - -/* - * Check bounds for row number - */ -int check_row(int row) -{ - if (row < 0) - return 0; - if (row >= (int)screen_Rows) - return (int)screen_Rows - 1; - return row; -} -- cgit