handle better old less versions
This commit is contained in:
parent
040f077836
commit
a401e75ec9
10
offpunk.py
10
offpunk.py
|
@ -101,12 +101,6 @@ else:
|
||||||
if not _NEW_CHAFA and not _HAS_TIMG:
|
if not _NEW_CHAFA and not _HAS_TIMG:
|
||||||
print("Before Chafa 1.10, you also need python-pil")
|
print("Before Chafa 1.10, you also need python-pil")
|
||||||
|
|
||||||
# Test with https://www.valerybonneau.com/romans/nouvelles-noires-pour-se-rire-du-desespoir/
|
|
||||||
# Chafa 1.8 without -w: 9s
|
|
||||||
# Chafa 1.8 with -w 1 : 9s
|
|
||||||
# Chafa 1.8 with -w 5 : 9s
|
|
||||||
# Chafa 1.8 with -w 9 : 9s
|
|
||||||
# Timg : 22s
|
|
||||||
#return ANSI text that can be show by less
|
#return ANSI text that can be show by less
|
||||||
def inline_image(img_file,width):
|
def inline_image(img_file,width):
|
||||||
#Chafa is faster than timg inline. Let use that one by default
|
#Chafa is faster than timg inline. Let use that one by default
|
||||||
|
@ -254,8 +248,10 @@ else:
|
||||||
#--incsearch : incremental search starting rev581
|
#--incsearch : incremental search starting rev581
|
||||||
if less_version >= 581:
|
if less_version >= 581:
|
||||||
less_base = "less --incsearch --save-marks -~ -XRfMWiS"
|
less_base = "less --incsearch --save-marks -~ -XRfMWiS"
|
||||||
else:
|
elif less_version >= 572:
|
||||||
less_base = "less --save-marks -XRfMWiS"
|
less_base = "less --save-marks -XRfMWiS"
|
||||||
|
else:
|
||||||
|
less_base = "less -XRfMWiS"
|
||||||
_DEFAULT_LESS = less_base + " \"+''\" %s"
|
_DEFAULT_LESS = less_base + " \"+''\" %s"
|
||||||
_DEFAULT_CAT = less_base + " -EF %s"
|
_DEFAULT_CAT = less_base + " -EF %s"
|
||||||
def less_cmd(file, histfile=None,cat=False,grep=None):
|
def less_cmd(file, histfile=None,cat=False,grep=None):
|
||||||
|
|
Loading…
Reference in New Issue