I am trying to have autocomplete fire automatically in HTML mode if certain conditions are met.
First is if a < brackets is typed, I accomplish this in the onkeyup handler like this.
var __Cursor = editor.getDoc().getCursor();
var __Token = editor.getTokenAt(__Cursor);
if (bAutoHintHtml) { bAuto = (__Token.string === ‘<’ && __Token.type === “tag bracket”) }
Which works perfectly. I then want to open autocomplete after a space inside of any HTML tag. I thought I could use
__Token.state.inTag but it is always null, or it is incorrect.
My question is, is there a sure fire way to know I am inside a tag?