Fix final-space handling of translateToString cache - #6127
PerBothner wants to merge 1 commit into
Conversation
|
I saw that when I rewrote the line caching, but did not think that deliberately appending SP is a thing. I agree that the trimmed version is the more useful here. If we need to restore full versions from cache values at some point, we could save the Edit: Could you change that in only caching the trimmed version? |
Perhaps not - but xterm.js implements a lot of corner cases that no-one actually uses. And this can be user-visible even: Type an input line ending it with some spaces, and then try selecting and copying it. (How it works depends on the terminal, and whether the input is raw or canonical; the point is that it is user-visible, so we should probably be consistent.)
That might be reasonable but I think the |
More critically: When merging master into PR #5797 I ran into some testsuite failures that were related to this. Didn't gig into exactly why my branch failed while master didn't, but it was related to the string cache, and this seemed a good fix in both master and my branch. |
This
trimEndcall in intranslateToString:incorrectly trims off significant (explicitly witten) whitespace at the end of a line.
It fails if you add these lines to the end of the
'should cache canonical string translations'test inBufferLine.test.ts:My proposed fix is to simplify the test in
translateToStringto just:Relatedly: I believe only the
trimRight == truecase is useful. The only examples oftrimRight == falseI could find were in test case except for one place in theaddon-searchwhich is trying to get the translated string for the "logical line"; that should be redone if string caching is done at theLogicalInelevel, as I believe it should.