diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-10-22 12:36:12 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-10-22 12:36:12 -0700 |
commit | c16466e9d12aeea064fa3b0d2b3f0823c152b5f8 (patch) | |
tree | c242825364531420699c52b3dd25b963de3e436f | |
parent | 8270e33c0a820ccb14c1cc6b97460db0a5748f0a (diff) | |
download | mnpgr-c16466e9d12aeea064fa3b0d2b3f0823c152b5f8.tar.gz mnpgr-c16466e9d12aeea064fa3b0d2b3f0823c152b5f8.tar.bz2 mnpgr-c16466e9d12aeea064fa3b0d2b3f0823c152b5f8.zip |
Interpolate number of columns into name.
- Problem: if the user views the same man page from different
terminal windows that don't have the same width, the
remembered locations don't make sense.
- Solution: interpolate the width into the temporary file name,
so that Vim remembers the position separately for each
width.
-rwxr-xr-x | mnpgr.tl | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -34,6 +34,10 @@ "map b \002\r" "map <space> \006"))) +(defvarl cols (or (getenv "MANWIDTH") + (getenv "COLUMNS") + "80")) + (defun grave-accent (x) (casequal x ("a" "à") @@ -90,7 +94,7 @@ (match @(or `@page(@section)` ;; for "man whatever" `@page\\.@section`) ;; for "man -l file.1" (getenv "MAN_PN") - (with-resources ((rendered-file (path-cat mnpgr-dir `@page.@section`) + (with-resources ((rendered-file (path-cat mnpgr-dir `@page.@section.@cols`) (remove-path rendered-file))) (with-stream (s (open-file rendered-file "w")) (let ((ofilt (make-overstrike-filter (lambda (str) (put-string str s))))) |