Sublime Forum

No text predicctión

#1

Hi all, I’ve a problem with text prediction.
In CSS if I write “v” I can see this options: visibility, vertical-align and font-variant. But if I wrote “visibility:” no options for values appear, and then if I write “h”, “hidden” doesn’t appear. I can see: height, min-height, max-height…
It’s a big problem, I wan’t to leave working with DW but there I have all predicctions and sometimes I can’t remember the write spelling.

Maybe isn’t the same problem, but in HTML if I wrote “<di” automaticaly I see “div” as option, but once created, if I write inside “

”, “st”, I can’t see “style” as option for autocomplete.

Sorry, that’s my better english, and tanks for help.

Kike

0 Likes

#2

Hi there and welcome.

Suggestions have some intelligence in sublime. If something is syntactically out of context it won’t make suggestions, or it’ll guess the wrong context. In your example, if you just type visibility: into an empty CSS file it mis-suggests as you point out. But it works inside a correct CSS block, so:

#hello { visibility: <ctrl+space> }

Pressing ctrl+space with the cursor in that position will bring up the complete suggestion list, and typing ‘h’ will filter it giving you a single ‘hidden’; tab autocomplete will work on the topmost list item.

So basically: use correct syntax and you’ll get the right suggestions.

I’m at a loss as to why sublime suggests height etc. out of context; probably it has to do with mismatched regex in the tmLanguage file for CSS or something along those lines. In any case it’s syntactically incorrect at this scope, so I wouldn’t worry about it; suggestions, autocomplete and colouring are all designed to work with code that’s syntactically correct for the language, and aren’t designed to handle user errors in syntax.

S

0 Likes

#3

Lot of thanx, with ctrl+space works, that’s what I need :wink:

0 Likes