having a little difficulties understanding the problem but I don't think the problem is here.
He is loading the file, flipping two lines and resaving it, then showing his results elsewhere where the
display index is still where it was the last time.
Changing the strings here and have it reflect position change in remote code or even other components isn't
going to change the cursor viewing index that I know of.
When the poster states doing down, I get the impression the line got switched and the cursor didn't move up
to reflect that. if that being the case, its not fixable here