(is_in_indent): refactoring, return gboolean instead of int.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2012-08-08 13:55:41 +04:00
parent dc9df84693
commit d3b7b5987b

View File

@ -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;
}
/* --------------------------------------------------------------------------------------------- */