Can Scite support .editorconfig / is there a plugin that adds this support?

155 views
Skip to first unread message

Andrej Mitrovic

unread,
May 8, 2014, 6:39:36 AM5/8/14
to scite-i...@googlegroups.com
It seems like this .editorconfig[1] is supposed to be a multi-editor compatible config file for source-code repositories. Just recently we've had a pull request from someone adding this file to one of our repositories. The idea is nice, although I don't think SciTE supports this out of the box. I guess this is similar to a SciTEDirectory.properties file. Does anyone know of a SciTE plugin that supports .editorconfig?

[1] : http://editorconfig.org

Neil Hodgson

unread,
May 10, 2014, 4:10:48 AM5/10/14
to scite-i...@googlegroups.com
Andrej Mitrovic:

It seems like this .editorconfig[1] is supposed to be a multi-editor compatible config file for source-code repositories. Just recently we've had a pull request from someone adding this file to one of our repositories. The idea is nice, although I don't think SciTE supports this out of the box. I guess this is similar to a SciTEDirectory.properties file. Does anyone know of a SciTE plugin that supports .editorconfig?

   SciTE doesn’t support this and I know of no plugins for it.. I think there was another request for this but can’t find any record. It might be possible to use the director interface to implement it.
   There are very few properties understood by editorconfig, so I can’t see it being all that useful.

   Neil

Neil Hodgson

unread,
Apr 24, 2018, 8:40:31 PM4/24/18
to scite-i...@googlegroups.com
Since there has been some interest in supporting .editorconfig and it seems to be gaining in popularity, I have implemented support for SciTE.

.editorconfig doesn’t cover many properties but, because it is implemented by multiple editors, it allows some of the basics like line ends, tab size, and indentation to be specified by projects to avoid files diverging when edited by different people and applications.

The implementation for SciTE doesn’t use the library from editorconfig.org as that adds a dependency to the PCRE regular expression library since it converts file patterns into regular expressions to test for matches. Instead, a PatternMatch function performs matches directly without converting to regular expressions. It currently implements all of the editorconfig matching rules except for numeric sequences where {1..99} matches a number between 1 and 99. The C++11 <regex> library wasn’t used as implementations often have poor Unicode semantics with, for example, “?” not matching multibyte characters.

This code evaluates .editorconfig after SciTE’s other properties files and overrides their settings. It is enabled with the enable.editor.config property. This should probably default to on in future releases as that seems safest but could default to off for the initial release in case of bugs.

A patch containing the implementation is attached.

http://editorconfig.org

Neil
editorconfig.patch

Neil Hodgson

unread,
Apr 27, 2018, 11:14:51 PM4/27/18
to scite-i...@googlegroups.com
The .editorconfig support has been committed with minor changes from the previous patch. It is enabled with editor.config.enable=1.
https://sourceforge.net/p/scintilla/scite/ci/e0280df0e6cab176bac1644c4e5c310eaa26ede4/

If there are any inconsistencies with other editors or the EditorConfig specification (apart from the missing numeric range match) then please report them here. A later release could enable .editorconfig by default.

http://editorconfig.org

Neil

Reply all
Reply to author
Forward
0 new messages