To: vim_dev@googlegroups.com Subject: Patch 9.0.0934 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0934 Problem: Various code formatting issues. Solution: Improve code formatting. Files: src/arglist.c, src/list.c, src/main.c, src/ops.c, src/libvterm/src/parser.c, src/gui_xim.c, src/screen.c, src/terminal.c *** ../vim-9.0.0933/src/arglist.c 2022-11-12 17:00:27.780096220 +0000 --- src/arglist.c 2022-11-23 23:48:00.384720678 +0000 *************** *** 413,420 **** didone = FALSE; for (match = 0; match < ARGCOUNT; ++match) ! if (vim_regexec(®match, alist_name(&ARGLIST[match]), ! (colnr_T)0)) { didone = TRUE; vim_free(ARGLIST[match].ae_fname); --- 413,419 ---- didone = FALSE; for (match = 0; match < ARGCOUNT; ++match) ! if (vim_regexec(®match, alist_name(&ARGLIST[match]), (colnr_T)0)) { didone = TRUE; vim_free(ARGLIST[match].ae_fname); *** ../vim-9.0.0933/src/list.c 2022-09-28 16:16:10.256335629 +0100 --- src/list.c 2022-11-21 22:51:00.788054119 +0000 *************** *** 109,114 **** --- 109,116 ---- /* * Allocate space for a list, plus "count" items. + * This uses one allocation for efficiency. + * The reference count is not set. * Next list_set_item() must be called for each item. */ list_T * *************** *** 117,149 **** list_T *l; l = (list_T *)alloc_clear(sizeof(list_T) + count * sizeof(listitem_T)); ! if (l != NULL) { ! list_init(l); ! if (count > 0) { ! listitem_T *li = (listitem_T *)(l + 1); ! int i; ! ! l->lv_len = count; ! l->lv_with_items = count; ! l->lv_first = li; ! l->lv_u.mat.lv_last = li + count - 1; ! for (i = 0; i < count; ++i) ! { ! if (i == 0) ! li->li_prev = NULL; ! else ! li->li_prev = li - 1; ! if (i == count - 1) ! li->li_next = NULL; ! else ! li->li_next = li + 1; ! ++li; ! } } } return l; } --- 119,152 ---- list_T *l; l = (list_T *)alloc_clear(sizeof(list_T) + count * sizeof(listitem_T)); ! if (l == NULL) ! return NULL; ! ! list_init(l); ! ! if (count > 0) { ! listitem_T *li = (listitem_T *)(l + 1); ! int i; ! l->lv_len = count; ! l->lv_with_items = count; ! l->lv_first = li; ! l->lv_u.mat.lv_last = li + count - 1; ! for (i = 0; i < count; ++i) { ! if (i == 0) ! li->li_prev = NULL; ! else ! li->li_prev = li - 1; ! if (i == count - 1) ! li->li_next = NULL; ! else ! li->li_next = li + 1; ! ++li; } } + return l; } *** ../vim-9.0.0933/src/main.c 2022-11-22 12:40:44.066427878 +0000 --- src/main.c 2022-11-22 16:51:07.428839279 +0000 *************** *** 1298,1313 **** #endif // Trigger CursorMoved if the cursor moved. ! if (!finish_op && ( ! has_cursormoved() #ifdef FEAT_PROP_POPUP ! || popup_visible #endif #ifdef FEAT_CONCEAL ! || curwin->w_p_cole > 0 #endif ! ) ! && !EQUAL_POS(last_cursormoved, curwin->w_cursor)) { if (has_cursormoved()) apply_autocmds(EVENT_CURSORMOVED, NULL, NULL, --- 1298,1312 ---- #endif // Trigger CursorMoved if the cursor moved. ! if (!finish_op && (has_cursormoved() #ifdef FEAT_PROP_POPUP ! || popup_visible #endif #ifdef FEAT_CONCEAL ! || curwin->w_p_cole > 0 #endif ! ) ! && !EQUAL_POS(last_cursormoved, curwin->w_cursor)) { if (has_cursormoved()) apply_autocmds(EVENT_CURSORMOVED, NULL, NULL, *************** *** 1401,1410 **** } #endif ! /* ! * Before redrawing, make sure w_topline is correct, and w_leftcol ! * if lines don't wrap, and w_skipcol if lines wrap. ! */ update_topline(); validate_cursor(); --- 1400,1407 ---- } #endif ! // Before redrawing, make sure w_topline is correct, and w_leftcol ! // if lines don't wrap, and w_skipcol if lines wrap. update_topline(); validate_cursor(); *** ../vim-9.0.0933/src/ops.c 2022-11-15 13:46:08.473979055 +0000 --- src/ops.c 2022-11-23 11:17:57.819912049 +0000 *************** *** 3422,3428 **** #if defined(FEAT_EVAL) || defined(PROTO) /* ! * Mark the global 'operatorfunc' callback with 'copyID' so that it is not * garbage collected. */ int --- 3422,3428 ---- #if defined(FEAT_EVAL) || defined(PROTO) /* ! * Mark the global 'operatorfunc' callback with "copyID" so that it is not * garbage collected. */ int *** ../vim-9.0.0933/src/libvterm/src/parser.c 2022-10-16 19:26:31.676328577 +0100 --- src/libvterm/src/parser.c 2022-11-23 12:32:53.750285756 +0000 *************** *** 34,40 **** if(vt->parser.callbacks && vt->parser.callbacks->csi) if((*vt->parser.callbacks->csi)( ! vt->parser.v.csi.leaderlen ? vt->parser.v.csi.leader : NULL, vt->parser.v.csi.args, vt->parser.v.csi.argi, vt->parser.intermedlen ? vt->parser.intermed : NULL, --- 34,40 ---- if(vt->parser.callbacks && vt->parser.callbacks->csi) if((*vt->parser.callbacks->csi)( ! vt->parser.v.csi.leaderlen ? vt->parser.v.csi.leader : NULL, vt->parser.v.csi.args, vt->parser.v.csi.argi, vt->parser.intermedlen ? vt->parser.intermed : NULL, *** ../vim-9.0.0933/src/gui_xim.c 2022-08-26 10:33:49.062709862 +0100 --- src/gui_xim.c 2022-11-23 11:17:57.819912049 +0000 *************** *** 133,139 **** #if defined(FEAT_EVAL) || defined(PROTO) /* ! * Mark the global 'imactivatefunc' and 'imstatusfunc' callbacks with 'copyID' * so that they are not garbage collected. */ int --- 133,139 ---- #if defined(FEAT_EVAL) || defined(PROTO) /* ! * Mark the global 'imactivatefunc' and 'imstatusfunc' callbacks with "copyID" * so that they are not garbage collected. */ int *** ../vim-9.0.0933/src/screen.c 2022-11-12 17:44:08.268849881 +0000 --- src/screen.c 2022-11-23 23:58:26.964868769 +0000 *************** *** 1017,1023 **** char_u *stl; char_u *p; char_u *opt_name; ! int opt_scope = 0; stl_hlrec_T *hltab; stl_hlrec_T *tabtab; win_T *ewp; --- 1017,1023 ---- char_u *stl; char_u *p; char_u *opt_name; ! int opt_scope = 0; stl_hlrec_T *hltab; stl_hlrec_T *tabtab; win_T *ewp; *** ../vim-9.0.0933/src/terminal.c 2022-11-23 20:19:17.129682462 +0000 --- src/terminal.c 2022-11-23 23:58:50.024876053 +0000 *************** *** 1234,1241 **** gui_mch_flush(); } #endif ! // Make sure an invoked autocmd doesn't delete the buffer (and the ! // terminal) under our fingers. ++term->tl_buffer->b_locked; // save and restore curwin and curbuf, in case the autocmd changes them --- 1234,1241 ---- gui_mch_flush(); } #endif ! // Make sure an invoked autocmd doesn't delete the buffer (and the ! // terminal) under our fingers. ++term->tl_buffer->b_locked; // save and restore curwin and curbuf, in case the autocmd changes them *** ../vim-9.0.0933/src/version.c 2022-11-23 23:30:54.212631668 +0000 --- src/version.c 2022-11-24 00:07:50.192999300 +0000 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 934, /**/ -- "Microsoft is like Coke. It's a secret formula, all the money is from distribution, and their goal is to get Coke everywhere. Open source is like selling water. There are water companies like Perrier and Poland Spring, but you're competing with something that's free." -- Carl Howe /// 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 ///