format_lines() wraps non-comments into comments if the last entry in 'comments' starts with ://

Đang mở
#22,100 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 13 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
56/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c, vim
Lĩnh vực
devtools

Hướng nghiên cứu

Start by tracing gqap into the formatting logic that handles format_lines() and comment leaders; the issue identifies a C buffer with a // comment followed by code as a reproducer. Check whether formatting treats the code line as a comment when the last entry in comments starts with ://. Done means the two lines remain unchanged and the cursor moves down one line for this reproduction.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug
Steps to reproduce

Run vim --clean foo.c, where foo.c contains:

// A comment.
int x = 1;

... and run gqap; the two lines are wrapped, and you end up with // A comment. int x = 1;

Expected behaviour

The buffer doesn't change (the cursor just moves down one line).

Version of Vim

9.2.0792 (current HEAD)

Environment

I used Vim 9.2.0792 on Linux, but I suspect this behaviour is probably broken back to 8.2 (see next comment).

Logs and stack traces

Ngôn ngữ chính
Vim Script
Star
41.4k
Fork
6.2k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của vim/vim

Tất cả issue của vim/vim

Issue tương tự

Thêm issue về DevTools

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.