Re: Property settings for individual files

"'Neil Hodgson' via scite-interest" <[email protected]>
Newsgroups gmane.editors.scite.general
Message-ID <[email protected]>
   A complete version of this feature is now committed.

>   An initial commit adds file path properties (FilePath, FileDir, FileName, FileExt, FileNameExt)

   There is now also RelativePath which is the path from the directory properties file directory to the current file. If there is a directory properties file in the directory above lexilla, scintilla, and scite, then there may be RelativePath values like lexilla/lexers/LexAda.cxx (on Unix) or scintilla\win32\PlatWin.cxx (on Win32) - paths have local directory separators so they are easier to pass to local applications.

>   There could be pattern matching to match multiple files (“Bug*.md”) and simpler syntax such as
> 
> match Bug1216.md
>        lexer.markdown.header.eolfill=1

   This has now been implemented with a pattern matcher with many features similar to EditorConfig. Multi-character ‘*’ and single character ‘?’ wildcards work as does ‘**’ that allows ‘/‘; [set], [!set], and [a-z] sets; {a,b} alternates; and {10..19} numeric sequences. If a match fails with the relative path then its tried again with just the file name. Match expressions use ‘/‘ to separate directories even on Win32 as this allows files to be more easily shared between Unix and Win32 and ‘\’ is used for quoting special characters.

match **/Lex*.cxx
    colour.code.comment.line=fore:#70B060

match scintilla/gtk/*.{h,cxx,c}
    lexer.cpp.escape.sequence=1

match *.cpp
    styling.within.preprocessor=1

https://editorconfig.org

   There are some aspects that could change in the future.

   On Win32 and macOS, the relative path and pattern are lower-cased before matching. However, these systems are case-preserving and most developers stick to particular cases in file names so it may be better to perform case-sensitive matches or provide an option. There is no attempt to perform Unicode normalization so there could be match failures for accented characters that are not in the file system’s normalization form.

   Trailing spaces are removed from match expressions (so use [ ] if necessary) and there should be exactly one space between “match” and the expression. Backslash quoting (match x\{a}\[2].tex) should only work on the top-level of the match expression but this hasn’t been tested much.

   This feature makes directory (or project) properties files more useful and it may be time to default them on (properties.directory.enable=1). Enabling directory properties has a runtime cost as whenever a file becomes current, a directory properties file is sought in each parent directory up to the root directory, stopping when found.

   Changes available from the repositories
git clone https://github.com/ScintillaOrg/lexilla
hg clone http://hg.code.sf.net/p/scintilla/scite
   or from
https://www.scintilla.org/scite.zip  Source
https://www.scintilla.org/wscite.zip Windows executable (64-bit)

   Neil

-- 
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/scite-interest/590177AC-2B95-48DC-B391-877B4BF058DD%40me.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.