HTML hints not working just after >

Hi,

I was testing the HTML mode completion on the demo here: http://codemirror.net/demo/html5complete.html

If I place the cursor after a > (for example, at the end of the line with <body>, but any place just after > works) and hiy Ctrl+space, nothing happens. Then, if I first add a space (so that the cursor is not immediately after >) and hit Ctrl+space, I’m shown the hints.

The same thing doesn’t seem to happen with XML completion.

Mickaël

I can not reproduce this issue on Chrome (putting the cursor directly after <body> and pressing ctrl-space gives me a list of completions). Does it happen on all browsers for you? If now, which browser shows the problem?

I originally tested with firefox (actually Iceweasel), but to be sure I tried again with chrome (actually, chromium) and I still see the same problem.

If that’s relevant:

Iceweasel (33)

Chromium (38)

Konqueror (4.14)

Right, I managed to reproduce this now. See https://github.com/codemirror/CodeMirror/commit/5a400b673fedc8b008d3addb095c53fca3d1c238 for a fix.

Nice, thank you.

Hi

I have problem with hints while opening the tag. If I put ‘<’ before the text not the space then hints are not shown up it disappears. even though for the shortcut CTRL+space.

I don’t understand the problem. Can you try to describe it a bit more clearly?

please check the screen shot of 2nd one. I have tried to put the tag animal before the text “test”… but the hints not displayed. Also the short cut option CTRL+SPACE not working

I think I get what you mean now. Does https://github.com/codemirror/CodeMirror/commit/2c5d652f880722996364da40b3e2f27d308923bf help?

I think codemirror reacts in such a way that it treats the text after the charecter ‘<’ as a tagName. I cannot able to select the tag options (list of hints) when typing the text. if there is no immidiate space after the charecter ‘<’.

is there any way to change the way of codemirror works. the list of hits need to work even though text presence after enter the charecter ‘<’

I’ve decided to change CodeMirror’s completion logic to that of most other editors: When your cursor is in the middle of (or in front of) a word, that word is no longer included when searching for a completion. So completing at ‘foo|bar’ (where the | is the cursor) will now give you everything that starts with ‘foo’, and only replace the word ‘foo’, rather than looking for ‘foobar’ and replacing the whole word. See patch https://github.com/codemirror/CodeMirror/commit/2a083f19cde965b06222a676fe1ff8b56089627a

1 Like

This is what I expected…

Thanks…