diff: `-y` draws the gutter marker at the wrong column unless the gutter is 3 or 4 columns wide
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
- 68/100
Hướng nghiên cứu
Bắt đầu bằng cách theo dõi Config::separator_pos và process_half_line trong đường dẫn đầu ra side-by-side để xem dấu đánh dấu gutter được phát ra ở đâu và cột hai bắt đầu từ đâu. Tái hiện vấn đề bằng diff -y --width=40 và các tổ hợp width/tab-size được mô tả, sau đó thêm coverage hồi quy cho thấy dấu đánh dấu được căn giữa tại separator_pos khi gutter rộng hơn.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
In side-by-side output, Config::separator_pos holds the middle of the gutter, but the gutter marker is not written there. It goes wherever process_half_line stopped padding the left half line, which is one column past sdiff_half_width. separator_pos is only read afterwards, to pad from the marker to the start of column two.
For a gutter g columns wide, separator_pos is sdiff_half_width + (g - 1) / 2. The two positions agree only when g is 3 or 4. The default --width=130 --tabsize=8 produces a gutter of exactly 3, which is why the default output looks correct, but any width or tab size where the tab alignment pushes column two further past the balance point drifts. --width=130 --tabsize=4 is off by one, --width=200 --tabsize=8 by two, --width=130 --tabsize=128 by 61.
printf 'aa\n' > f1; : > f2
diff -y --width=40 f1 f2 | expand | cat -A
aa <$
diffutils diff -y --width=40 f1 f2 | expand | cat -A
aa <$
- Ngôn ngữ chính
- Rust
- Star
- 276
- Fork
- 39
- Merge trung bình
- 4 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 3
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của uutils/diffutils
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Tất cả issue của uutils/diffutils
Issue tương tự
-
bug github_actions
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
registrystack/registry-stack#1393 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
longbridge/gpui-kit#3223 ·
-
bug engine
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
rocky-data/rocky#2181 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
oasisprotocol/oasis-sdk#2523 ·
-
[indexer] [QA] Add a focused test for the new NonRetryableError / assertSocketAlive() behavior. Đang mởbot:ai-assisted component:indexer QA-roadmap status:untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
midnightntwrk/midnight-indexer#1557 ·