From 41dd24e8da9a812cb41e022c33dbe9835361d7b6 Mon Sep 17 00:00:00 2001 From: "Sky.G.Uieen" Date: Wed, 8 Jul 2020 12:19:22 +0900 Subject: Add custom color (#1196) * Updated author, changelog for supporting color of string, number, keyword * Added string, number, keyword custom color --- AUTHORS | 1 + changelog.rst | 2 +- pgcli/pgclirc | 3 +++ pgcli/pgstyle.py | 3 +++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 07b19b81..12298156 100644 --- a/AUTHORS +++ b/AUTHORS @@ -110,6 +110,7 @@ Contributors: * Panos Mavrogiorgos (pmav99) * Igor Kim (igorkim) * Anthony DeBarros (anthonydb) + * Seungyong Kwak (GUIEEN) Creator: -------- diff --git a/changelog.rst b/changelog.rst index f2510394..e81d0b73 100644 --- a/changelog.rst +++ b/changelog.rst @@ -7,7 +7,7 @@ Features: * Make the output more compact by removing the empty newline. (Thanks: `laixintao`_) * Add support for using [pspg](https://github.com/okbob/pspg) as a pager (#1102) * Update python version in Dockerfile -* Support setting color for null value +* Support setting color for null, string, number, keyword value Bug fixes: ---------- diff --git a/pgcli/pgclirc b/pgcli/pgclirc index 29d1dbd8..e97afdab 100644 --- a/pgcli/pgclirc +++ b/pgcli/pgclirc @@ -170,6 +170,9 @@ arg-toolbar = 'noinherit bold' arg-toolbar.text = 'nobold' bottom-toolbar.transaction.valid = 'bg:#222222 #00ff5f bold' bottom-toolbar.transaction.failed = 'bg:#222222 #ff005f bold' +literal.string = '#ba2121' +literal.number = '#666666' +keyword = 'bold #008000' # style classes for colored table output output.header = "#00ff5f bold" diff --git a/pgcli/pgstyle.py b/pgcli/pgstyle.py index 71fa571a..2ee3e200 100644 --- a/pgcli/pgstyle.py +++ b/pgcli/pgstyle.py @@ -35,6 +35,9 @@ TOKEN_TO_PROMPT_STYLE = { Token.Output.OddRow: "output.odd-row", Token.Output.EvenRow: "output.even-row", Token.Output.Null: "output.null", + Token.Literal.String: "literal.string", + Token.Literal.Number: "literal.number", + Token.Keyword: "keyword", } # reverse dict for cli_helpers, because they still expect Pygments tokens. -- cgit v1.2.3