[Geany-devel] Fix autocompletion for CSS files

Thanh Tran trongthanh at xxxxx
Fri Oct 5 05:58:29 UTC 2012

Hi guys,

I'm a front-end web developer and I enjoy using Geany so much. Currently with some global tags files and minor filetypes tweak, I'm able to code HTML & JavaScript quite comfortably. 

However, it is still a pain to make use of the global tag completion in CSS since Geany doesn't recognize minus/short dash "-" character as a word character and terminate the auto completion hint box as soon as I type the "-" character. Another issue with this is experimental vendor prefixed properties (for e.g: -webkit-filter) are not hinted if I don't remove the initial "-".

I'm not an experienced C/C++ developer so I avoided touching Geany source code as much as possible. But for this one I have to tinker with the source and was able to fix the issue with some quick edits. I'm aware that my edits might break things and are not root cause solutions. So I'm hoping that you guys can help fix it. My edits which I'm sharing here are just to get the ideas:


Besides, my edits also add colon ":" as trigger character to show the calltip (in CSS ONLY of course) so that it will display useful information to set value for the CSS property. (see attachment). With a full CSS tags file, the autocompletion and the calltip will greatly enhance CSS coding experience in Geany. Again, this is just my proposal.

In another note, I already tried adding "-" to wordchars settings in filetypes.css and use editor_find_current_word_sciwc() but it is only effective if I remove the dash in whitespace_chars in filetypes.common. The risk of breaking things by changing the filetypes.common is too great that I can't use that function. But ultimately, I have a feeling that current Geany hasn't use everything Scintilla providing and is not flexible enough when handling word chars & white space chars.

Anyway, I'm pretty happy with Geany right now and believe that Geany can be better than commercialized one like SublimeText which I think is overrated.

Thanh Tran
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/devel/attachments/20121005/e09750d7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CSS_calltip.png
Type: image/png
Size: 44641 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20121005/e09750d7/attachment.png>

More information about the Devel mailing list