diff --git a/src/editor/edit.c b/src/editor/edit.c index 7383b2066..7eadcee59 100644 --- a/src/editor/edit.c +++ b/src/editor/edit.c @@ -723,15 +723,23 @@ edit_get_prev_utf (WEdit * edit, long byte_index, int *char_width) /* --------------------------------------------------------------------------------------------- */ /* high level cursor movement commands */ /* --------------------------------------------------------------------------------------------- */ +/** check whether cursor is in indent part of line + * + * @param edit editor object + * + * @return TRUE if cursor is in indent, FALSE otherwise + */ -static int +static gboolean is_in_indent (WEdit * edit) { - long p = edit_bol (edit, edit->curs1); - while (p < edit->curs1) - if (!strchr (" \t", edit_get_byte (edit, p++))) - return 0; - return 1; + long p; + + for (p = edit_bol (edit, edit->curs1); p < edit->curs1; p++) + if (strchr (" \t", edit_get_byte (edit, p)) == NULL) + return FALSE; + + return TRUE; } /* --------------------------------------------------------------------------------------------- */