+static inline int
+_rl_vi_advance_point (void)
+{
+ int point;
+
+ point = rl_point;
+ if (rl_point < rl_end)
+#if defined (HANDLE_MULTIBYTE)
+ {
+ if (MB_CUR_MAX == 1 || rl_byte_oriented)
+ rl_point++;
+ else
+ {
+ point = rl_point;
+ rl_point = _rl_forward_char_internal (1);
+ if (point == rl_point || rl_point > rl_end)
+ rl_point = rl_end;
+ }
+ }
+#else
+ rl_point++;
+#endif
+
+ return point;
+}
+
+/* Move the cursor back one character. */
+static inline void
+_rl_vi_backup (void)
+{
+ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
+ rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_NONZERO);
+ else
+ rl_point--;
+}
+
+/* Move the point back one character, returning the starting value and not
+ doing anything at the beginning of the line */
+static inline int
+_rl_vi_backup_point (void)
+{
+ int point;
+
+ point = rl_point;
+ if (rl_point > 0)
+#if defined (HANDLE_MULTIBYTE)
+ {
+ if (MB_CUR_MAX == 1 || rl_byte_oriented)
+ rl_point--;
+ else
+ {
+ point = rl_point;
+ rl_point = _rl_backward_char_internal (1);
+ if (rl_point < 0)
+ rl_point = 0; /* XXX - not really necessary */
+ }
+ }
+#else
+ rl_point--;
+#endif
+ return point;
+}
+