Mode: htmlmixed
I wanted hint to show up automatically instead of a manual keyboard shortcut. So I have this:
cm.on('inputRead', function onChange(editor, input) {
if (input.text[0] === ';' || input.text[0] === ' ') { return; }
CodeMirror.commands.autocomplete(cm, null, { completeSingle: false })
});

It should show tag/attribute suggestions only when writing a tag (after <) or inside a tag.
The mode itself does not do any kind of completion, so you must be doing something in addition to setting the mode to htmlmixed.
Yes. I wanted hint to show up automatically instead of a manual keyboard shortcut. So I have this:
cm.on('inputRead', function onChange(editor, input) {
if (input.text[0] === ';' || input.text[0] === ' ') { return; }
CodeMirror.commands.autocomplete(cm, null, { completeSingle: false })
});
Is this the right way to show automatic completion hints?
Well, your code is popping up autocompletion on every character, so that's what you get. I'm not sure what you consider wrong about the suggestions in your screenshot, but they all appear to be valid tags there. If you want to only complete when the cursor is in a tag name or after a <, you'll have to program your completion logic that way.
I get it. Thanks @marijnh
Most helpful comment
Yes. I wanted hint to show up automatically instead of a manual keyboard shortcut. So I have this:
Is this the right way to show automatic completion hints?