aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mbyte.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-11-27 20:48:51 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-11-27 20:48:51 -0300
commite5a386d2f819ee3a357384279d1a7810ec213087 (patch)
treecbb173280c736f89523b63a9c28429878131a995 /src/nvim/mbyte.c
parent98b11f5db3a99ef633ad77ddc6b22dc428873e95 (diff)
parent7b0f7ea87c71ad79dfd9e087b5992761533bef6e (diff)
downloadrneovim-e5a386d2f819ee3a357384279d1a7810ec213087.tar.gz
rneovim-e5a386d2f819ee3a357384279d1a7810ec213087.tar.bz2
rneovim-e5a386d2f819ee3a357384279d1a7810ec213087.zip
Merge PR #1568 'Remove code defined under USE_IM_CONTROL #ifdefs'
Diffstat (limited to 'src/nvim/mbyte.c')
-rw-r--r--src/nvim/mbyte.c21
1 files changed, 20 insertions, 1 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;
+}