webconfig: Allow setting pager colors

This commit is contained in:
Fabian Homborg 2018-11-29 15:18:00 +01:00
parent a02eac5a7a
commit be1c022861
2 changed files with 13 additions and 3 deletions

View file

@ -119,7 +119,11 @@ controllers.controller("colorsController", function($scope, $http) {
"autosuggestion",
"user",
"host",
"cancel"
"cancel",
"fish_pager_color_completion",
"fish_pager_color_description",
"fish_pager_color_prefix",
"fish_pager_color_progress"
];
var remaining = settingNames.length;
for (name of settingNames) {

View file

@ -735,10 +735,16 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_set_color_for_variable(self, name, color, background_color, bold,
underline):
"Sets a color for a fish color name, like 'autosuggestion'"
if not color:
color = 'normal'
"Sets a color for a fish color name, like 'autosuggestion'"
command = 'set -U fish_color_' + name
varname = 'fish_color' + name
# If the name already starts with "fish_", use it as the varname
# This is needed for 'fish_pager_color' vars.
if name.startswith('fish_'):
varname = name
# TODO: Check if the varname is allowable.
command = 'set -U ' + varname
if color:
command += ' ' + color
if background_color: