themes are now applied instantly

This commit is contained in:
Lionel Dricot 2023-09-02 12:41:55 +02:00
parent 2fa2fbc718
commit 1a2cff83af
2 changed files with 3 additions and 3 deletions

View File

@ -318,7 +318,7 @@ class GeminiClient(cmd.Cmd):
params["validity"] = 60
# Use cache or mark as to_fetch if resource is not cached
if handle and not self.sync_only:
displayed = self.opencache.opnk(url,mode=mode,grep=grep,**params)
displayed = self.opencache.opnk(url,mode=mode,grep=grep,theme=self.theme,**params)
modedurl = mode_url(url,mode)
if not displayed:
#if we cant display, we mark to sync what is not local

View File

@ -177,7 +177,7 @@ class opencache():
else:
return None
def opnk(self,inpath,mode=None,terminal=True,grep=None,**kwargs):
def opnk(self,inpath,mode=None,terminal=True,grep=None,theme=None,**kwargs):
#Return True if inpath opened in Terminal
# False otherwise
#if terminal = False, we dont try to open in the terminal,
@ -196,7 +196,7 @@ class opencache():
else:
print("%s does not exist"%inpath)
return
renderer = self.get_renderer(inpath,mode=mode)
renderer = self.get_renderer(inpath,mode=mode,theme=theme)
if renderer and mode:
renderer.set_mode(mode)
self.last_mode[inpath] = mode