1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-28 06:08:05 +03:00

Document that fg face is optional

This commit is contained in:
Maxime Coste 2019-12-03 21:17:33 +11:00
parent 36dce6a2d0
commit 0b66aa8dda
2 changed files with 3 additions and 2 deletions

View File

@ -7,7 +7,7 @@ color, a background color, and some attributes. The value of a face has the
following format: following format:
--------------------------------------- ---------------------------------------
fg_color[,bg_color][+attributes][@base] [fg_color][,bg_color][+attributes][@base]
--------------------------------------- ---------------------------------------
'fg_color', 'bg_color':: 'fg_color', 'bg_color'::
@ -20,6 +20,7 @@ fg_color[,bg_color][+attributes][@base]
keep the existing color keep the existing color
*rgb:RRGGBB*::: *rgb:RRGGBB*:::
hexadecimal value hexadecimal value
if unspecified, *default* is used.
'attributes':: 'attributes'::
string whose individual letters set an attribute: string whose individual letters set an attribute:

View File

@ -9,7 +9,7 @@ namespace Kakoune
static FaceRegistry::FaceSpec parse_face(StringView facedesc) static FaceRegistry::FaceSpec parse_face(StringView facedesc)
{ {
constexpr StringView invalid_face_error = "invalid face description, expected <fg>[,<bg>][+<attr>][@base] or just [base]"; constexpr StringView invalid_face_error = "invalid face description, expected [<fg>][,<bg>][+<attr>][@base] or just [base]";
if (all_of(facedesc, [](char c){ return is_word(c); }) and not is_color_name(facedesc)) if (all_of(facedesc, [](char c){ return is_word(c); }) and not is_color_name(facedesc))
return {Face{}, facedesc.str()}; return {Face{}, facedesc.str()};