/// Get digraph. /// Allow for both char1-char2 and char2-char1 /// /// @param char1 /// @param char2 /// @param meta_char /// /// @return The digraph. int getdigraph(int char1, int char2, int meta_char) { int retval; if (((retval = getexactdigraph(char1, char2, meta_char)) == char2) && (char1 != char2) && ((retval = getexactdigraph(char2, char1, meta_char)) == char1)) { return char2; } return retval; }
void listdigraphs(void) { digr_T *dp; msg_putchar('\n'); dp = digraphdefault; for (int i = 0; dp->char1 != NUL && !got_int; ++i) { digr_T tmp; // May need to convert the result to 'encoding'. tmp.char1 = dp->char1; tmp.char2 = dp->char2; tmp.result = getexactdigraph(tmp.char1, tmp.char2, FALSE); if ((tmp.result != 0) && (tmp.result != tmp.char2) && (has_mbyte || (tmp.result <= 255))) { printdigraph(&tmp); } dp++; os_breakcheck(); } dp = (digr_T *)user_digraphs.ga_data; for (int i = 0; i < user_digraphs.ga_len && !got_int; ++i) { printdigraph(dp); os_breakcheck(); dp++; } // clear screen, because some digraphs may be wrong, in which case we messed // up ScreenLines must_redraw = CLEAR; }