import re


def check_indent_keys(document):
    """ Check whether the word before the cursor was an indent key (which
    will trigger a reevaluation of the line's indent)"""

    lw_start = document.find_previous_word_beginning() or 0
    lw_end = 0# document.find_previous_word_ending() or 0
    col = document.cursor_position_col
    #print('Prev token from', lw_start, 'to', lw_end)
    last_tok = document.current_line[col+lw_start:col+lw_end]
    #print('Prev token from', lw_start, 'to', lw_end, ':', last_tok)
    return re.match(
        r'\{|\}|\(|\)|\[|\]|,|where|let|deriving|in|::|->|=>|\||=',
        last_tok)