sdiff: implement the `|` marker for changed lines

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

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
76/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
rust
Lĩnh vực
cli

Hướng nghiên cứu

Start in src/side_diff.rs and trace how the current engine diff’s Left, Right, and Both results are consumed. Verify the change with the provided diff -y example, including a hunk with unequal deletion and insertion counts. Done means positional pairs in each contiguous change hunk print with |, while leftovers retain < or > and unchanged lines remain unaffected.

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

Mô tả

src/side_diff.rs currently emits only <, > and blank gutters. Lines that exist in both files but differ are printed as a separate deletion and insertion instead of a single row with |.

The | is produced at print time, by pairing positionally inside a contiguous change hunk. For a run of N deletions and M insertions, the first min(N, M) are printed as pairs with |, and the leftovers keep < or >. The pairing is positional, so the two lines of a | row need nothing in common:

$ diff -y --width=40 L R      # L: a,b1,b2,b3,c   R: a,X,c
a			a
b1		   |	X
b2		   <
b3		   <
c			c

So the change is confined to the consumption of the current engine diff's. Buffer the run of Left/Right results, and on the next Both (or at EOF) flush it with the pairing above.

Ngôn ngữ chính
Rust
Star
276
Fork
39
Merge trung bình
3 giờ 27 phút
Pull request đã merge (30 ngày)
3

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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 uutils/diffutils

Tất cả issue của uutils/diffutils

Issue tương tự

Thêm issue về Rust

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.