Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Right now, we have a problem with this diff.
- Image a file:
- ```
- line 1
- line 2
- ``
- and the diff changes it to
- ```
- line 1
- line 2_1
- ```
- when the characters are streming in, let's say line 1 has already been streamed in. And now, line 2 is being streamed: `lin`
- what would the diff look like? since we update char by char, we'll have
- line 1 -> no chage
- line 2 -> deleted
- line 3 -> addition of `lin`
- This makes a weird graphic effect where at the very bottom of the diff, you see a bunch of characters streaming in.
- To fix this, we should only dispatch the diff when the newcode that's being streamed in adds a new line
- So, let's say, line 1 begins streaming. We break newCode by newline and only send the code for lines that have full new lines.
- When the code stops streaming, there might not be a new line at the end of it - that's fine, i will handle that case separately.
- Fix this code to change this
Advertisement
Add Comment
Please, Sign In to add comment