fmoralesc / vim-tutor-mode

interactive tutorials for vim
84 stars 4 forks source link

Too easy to break interactive elements #31

Open 00dani opened 8 years ago

00dani commented 8 years ago

I started running through vim-01-beginner.tutor and it compares very favourably to the venerable vimtutor. However, while editing one of the interactive elements, I used D and Tutor immediately marked it correct. This is presumably because the correct input from the user is described in the concealed {expect} clause at the end of the line - as a result, Vim commands like D, A, and C can wipe it out very easily and unexpectedly, since the user doesn't know it's there.

I'm not sure how best to work around this. Perhaps an alternative syntax could permit entering the expectation on the line above or below the interactive line, so that the user can safely destroy the entire interactive line and not be marked correct? For instance (you wouldn't need to use expectations both above and below the editable line, of course):

---v {expect:this line is correct}
this line is NOT correct
---^ {expect:this line is correct}

Concealing the expectation would still be possible, as well as highlighting the line that the expectation applies to if desired.

Thoughts?

fmoralesc commented 8 years ago

This is a generally good idea, although it might add extra vertical space in the sequences where several items are listed.

At any rate, it would solve some issues concerning movement, and might make the mappings simpler.