introduce last_relevant_char() for gh-10