Skip to content

Conversation

@NotMyself
Copy link

@NotMyself NotMyself commented Sep 2, 2021

Fixes #196
Fixes #187

This PR fixes a couple of issues we were running into this week.

  1. Inserting code causes the tour step line numbers to get out of sync with the step selection.
  2. The line adjustment that is done can cause inappropriate updates to the tour files.
  3. Code can be inserted multiple times potentially causing an issue.

To fix these things, the following updates were made.

  1. added a new setting codetour.adjustOnInsertCodeSnippet.
  2. command codetour.insertCodeSnippet checks setting prior to doing any adjustments.
  3. command codetour.insertCodeSnippet checks the line of text at the insert location to see if the code block already contains that line. If so, it early outs due to the code already being inserted prior.

@NotMyself
Copy link
Author

@lostintangent take a look at this method of detecting duplicate inserts. I think it works as expected. But I am unsure if pulling the entire contents of the doc to do a comparison is the best approach.

@jesposito
Copy link

Looking forward to this functionality!

@kazemicode
Copy link

Would love to see this functionality integrated into the plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Line adjustment on code insert does not update selection Insert Code - can repeat insert multiple times

3 participants