Fix a regression introduced by feec45b (Fix warning highlight for trailing whitespace (#1037), 2023-05-17) where trailing space at the end of an unchanged token is highlighted if the token follows an insertion. This happens because when the token is split in two to separate trailing whitespace the two halves end up being tagged with different edit operations. This can be seen in the test changes in test_infer_edits_14 and test_infer_edits_16 introduced by feec45b which changed the operation from PlusNoop to Insertion when splitting trailing whitespace from unchanged tokens. Fix this by using the same operation when adding both halves of a split token and correcting the tests.
Fix a regression introduced by feec45b (Fix warning highlight for trailing whitespace (#1037), 2023-05-17) where trailing space at the end of an unchanged token is highlighted if the token follows an insertion. This happens because when the token is split in two to separate trailing whitespace the two halves end up being tagged with different edit operations. This can be seen in the test changes in
test_infer_edits_14
andtest_infer_edits_16
introduced by feec45b which changed the operation fromPlusNoop
toInsertion
when splitting trailing whitespace from unchanged tokens. Fix this by using the same operation when adding both halves of a split token and correcting the tests.Fixes #1658