microsoft / codetour

VS Code extension that allows you to record and play back guided tours of codebases, directly within the editor.
https://aka.ms/codetour
MIT License
4.34k stars 109 forks source link

"Insert code" option is inserting extra new line, and not count it on line dislocation #231

Open JonatasAmaral opened 2 years ago

JonatasAmaral commented 2 years ago

Hi. I'm doing a tour, with requires inserting a mock in a unit test. And found this bug:

The Insert Code option, in inserting the "new line" character at the end of the code block too: . . . \n ```

The "line" parameter of the tour thought, just add up the amount of code lines, not the extra \n bit. So it offsets the tour box from the original line.

Code_MkuEVLU4fi

Without this new line between code and the closing back-ticks, it doesn't match the code block sintax, so the option is not available

lostintangent commented 2 years ago

Thanks for reporting this! This is definitely an odd bug, and so I'll take a look at see what's going on here. Stay tuned!