To: vim_dev@googlegroups.com Subject: Patch 8.2.5076 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.5076 Problem: Unnecessary code. Solution: Remove code and replace with function call. (closes #10552) Files: src/drawline.c, src/getchar.c *** ../vim-8.2.5075/src/drawline.c 2022-06-07 10:16:09.449398791 +0100 --- src/drawline.c 2022-06-10 15:24:32.529981006 +0100 *************** *** 2116,2129 **** mb_utf8 = FALSE; } ! if ((trailcol != MAXCOL && ptr > line + trailcol && c == ' ') ! || (leadcol != 0 && ptr < line + leadcol && c == ' ')) { if (leadcol != 0 && in_multispace && ptr < line + leadcol && wp->w_lcs_chars.leadmultispace != NULL) { c = wp->w_lcs_chars.leadmultispace[multispace_pos++]; ! if (wp->w_lcs_chars.leadmultispace[multispace_pos] == NUL) multispace_pos = 0; } --- 2116,2130 ---- mb_utf8 = FALSE; } ! if (c == ' ' && ((trailcol != MAXCOL && ptr > line + trailcol) ! || (leadcol != 0 && ptr < line + leadcol))) { if (leadcol != 0 && in_multispace && ptr < line + leadcol && wp->w_lcs_chars.leadmultispace != NULL) { c = wp->w_lcs_chars.leadmultispace[multispace_pos++]; ! if (wp->w_lcs_chars.leadmultispace[multispace_pos] ! == NUL) multispace_pos = 0; } *************** *** 2133,2139 **** else if (ptr < line + leadcol && wp->w_lcs_chars.lead) c = wp->w_lcs_chars.lead; ! else if (leadcol != 0 && c == ' ' && wp->w_lcs_chars.space) c = wp->w_lcs_chars.space; --- 2134,2140 ---- else if (ptr < line + leadcol && wp->w_lcs_chars.lead) c = wp->w_lcs_chars.lead; ! else if (leadcol != 0 && wp->w_lcs_chars.space) c = wp->w_lcs_chars.space; *** ../vim-8.2.5075/src/getchar.c 2022-06-06 16:22:42.845514743 +0100 --- src/getchar.c 2022-06-10 15:19:51.562032323 +0100 *************** *** 1115,1147 **** * Returns the length of what was inserted. */ int ! ins_char_typebuf(int c, int modifier) { char_u buf[MB_MAXBYTES * 3 + 4]; ! int len = 0; ! if (modifier != 0) ! { ! buf[0] = K_SPECIAL; ! buf[1] = KS_MODIFIER; ! buf[2] = modifier; ! buf[3] = NUL; ! len = 3; ! } ! if (IS_SPECIAL(c)) ! { ! buf[len] = K_SPECIAL; ! buf[len + 1] = K_SECOND(c); ! buf[len + 2] = K_THIRD(c); ! buf[len + 3] = NUL; ! len += 3; ! } ! else ! { ! char_u *end = add_char2buf(c, buf + len); ! *end = NUL; ! len = end - buf; ! } (void)ins_typebuf(buf, KeyNoremap, 0, !KeyTyped, cmd_silent); return len; } --- 1115,1126 ---- * Returns the length of what was inserted. */ int ! ins_char_typebuf(int c, int modifiers) { char_u buf[MB_MAXBYTES * 3 + 4]; ! int len = special_to_buf(c, modifiers, TRUE, buf); ! buf[len] = NUL; (void)ins_typebuf(buf, KeyNoremap, 0, !KeyTyped, cmd_silent); return len; } *** ../vim-8.2.5075/src/version.c 2022-06-10 14:51:48.374373394 +0100 --- src/version.c 2022-06-10 15:21:43.778011491 +0100 *************** *** 736,737 **** --- 736,739 ---- { /* Add new patch number below this line */ + /**/ + 5076, /**/ -- BEDEVERE: Look! It's the old man from scene 24 - what's he Doing here? ARTHUR: He is the keeper of the Bridge. He asks each traveler five questions ... GALAHAD: Three questions. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///