comparison src/search.c @ 26516:9596c652420b v8.2.3787

patch 8.2.3787: no proper formatting of a C line comment after a statement Commit: https://github.com/vim/vim/commit/6e371ecb27227ff8fedd8561d0f3880a17576848 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Dec 12 14:16:39 2021 +0000 patch 8.2.3787: no proper formatting of a C line comment after a statement Problem: No proper formatting of a C line comment after a statement. Solution: Find the start of the line comment, insert the comment leader and indent the comment properly.
author Bram Moolenaar <Bram@vim.org>
date Sun, 12 Dec 2021 15:30:03 +0100
parents 8369fcaad30d
children 0d798c7e1865
comparison
equal deleted inserted replaced
26515:48000f73fe08 26516:9596c652420b
14 14
15 #ifdef FEAT_EVAL 15 #ifdef FEAT_EVAL
16 static void set_vv_searchforward(void); 16 static void set_vv_searchforward(void);
17 static int first_submatch(regmmatch_T *rp); 17 static int first_submatch(regmmatch_T *rp);
18 #endif 18 #endif
19 static int check_linecomment(char_u *line);
20 #ifdef FEAT_FIND_ID 19 #ifdef FEAT_FIND_ID
21 static void show_pat_in_path(char_u *, int, 20 static void show_pat_in_path(char_u *, int,
22 int, int, FILE *, linenr_T *, long); 21 int, int, FILE *, linenr_T *, long);
23 #endif 22 #endif
24 23
2715 /* 2714 /*
2716 * Check if line[] contains a / / comment. 2715 * Check if line[] contains a / / comment.
2717 * Return MAXCOL if not, otherwise return the column. 2716 * Return MAXCOL if not, otherwise return the column.
2718 * TODO: skip strings. 2717 * TODO: skip strings.
2719 */ 2718 */
2720 static int 2719 int
2721 check_linecomment(char_u *line) 2720 check_linecomment(char_u *line)
2722 { 2721 {
2723 char_u *p; 2722 char_u *p;
2724 2723
2725 p = line; 2724 p = line;