~lioploum/offpunk

79a3f9875f5598c2bb82f026287844a813da7e99 — Ploum 3 months ago 0a9fb62
More informative prompt in LESS
2 files changed, 10 insertions(+), 9 deletions(-)

M CHANGELOG
M opnk.py
M CHANGELOG => CHANGELOG +1 -0
@@ 10,6 10,7 @@
- offpunk: add list autocompletion to "tour"
- offpunk: removed "blackbox", which has not been used nor maintained
- offpunk: "gus" was broken, it is functionnal again
- opnk/offpunk: more informative prompt in less

## 2.1 - December 15th 2023
- freshly updated gemtext/rss links are highlighted ("new_link" theme option)

M opnk.py => opnk.py +9 -9
@@ 48,16 48,16 @@ else:
# -S : do not wrap long lines. Wrapping is done by offpunk, longlines
# are there on purpose (surch in asciiart)
#--incsearch : incremental search starting rev581
if less_version >= 581:
    less_base = "less --incsearch --save-marks -~ -XRfMWiS"
elif less_version >= 572:
    less_base = "less --save-marks -XRfMWiS"
else:
    less_base = "less -XRfMWiS"
_DEFAULT_LESS = less_base + " \"+''\" %s"
_DEFAULT_CAT = less_base + " -EF %s"

def less_cmd(file, histfile=None,cat=False,grep=None):
    less_prompt = "page %%d/%%D- lines %%l/%%L - %%Pb\%%"
    if less_version >= 581:
        less_base = "less --incsearch --save-marks -~ -XRfWiS -P \"%s\""%less_prompt
    elif less_version >= 572:
        less_base = "less --save-marks -XRfMWiS"
    else:
        less_base = "less -XRfMWiS"
    _DEFAULT_LESS = less_base + " \"+''\" %s"
    _DEFAULT_CAT = less_base + " -EF %s"
    if histfile:
        env = {"LESSHISTFILE": histfile}
    else: