Mercurial > vim
comparison src/change.c @ 28425:ef62a0ea2a78 v8.2.4737
patch 8.2.4737: // in JavaScript string recognized as comment
Commit: https://github.com/vim/vim/commit/1655619717ff109ea8bf1002883636d5af345e48
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Apr 11 17:36:37 2022 +0100
patch 8.2.4737: // in JavaScript string recognized as comment
Problem: // in JavaScript string recognized as comment.
Solution: Only check for linecomment if 'cindent' is set. (closes https://github.com/vim/vim/issues/10151)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 11 Apr 2022 18:45:02 +0200 |
parents | a9a56b567709 |
children | 38698deeda58 |
comparison
equal
deleted
inserted
replaced
28424:6c275c41f7e5 | 28425:ef62a0ea2a78 |
---|---|
1657 if (flags & OPENLINE_DO_COM) | 1657 if (flags & OPENLINE_DO_COM) |
1658 { | 1658 { |
1659 lead_len = get_leader_len(saved_line, &lead_flags, | 1659 lead_len = get_leader_len(saved_line, &lead_flags, |
1660 dir == BACKWARD, TRUE); | 1660 dir == BACKWARD, TRUE); |
1661 #ifdef FEAT_CINDENT | 1661 #ifdef FEAT_CINDENT |
1662 if (lead_len == 0 && do_cindent && dir == FORWARD) | 1662 if (lead_len == 0 && curbuf->b_p_cin && do_cindent && dir == FORWARD) |
1663 { | 1663 { |
1664 // Check for a line comment after code. | 1664 // Check for a line comment after code. |
1665 comment_start = check_linecomment(saved_line); | 1665 comment_start = check_linecomment(saved_line); |
1666 if (comment_start != MAXCOL) | 1666 if (comment_start != MAXCOL) |
1667 { | 1667 { |