aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/man.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-02-02 19:02:58 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-02-02 19:02:58 +0000
commitb255fa570d8b041e4c81e3454d51e06100c2fa4f (patch)
treed3b246b467500ca48067ed4a45d2fa53966cd9f1 /runtime/lua/man.lua
parenteeccad2ff1ae8892fe9e06d733a7b07a166eecb0 (diff)
parent0bd07bea095a8000cffa4f379c1fa53e009c1143 (diff)
downloadrneovim-20230125_mix.tar.gz
rneovim-20230125_mix.tar.bz2
rneovim-20230125_mix.zip
Merge branch 'aucmd_textputpost' into 20230125_mix20230125_mix
Diffstat (limited to 'runtime/lua/man.lua')
-rw-r--r--runtime/lua/man.lua16
1 files changed, 11 insertions, 5 deletions
diff --git a/runtime/lua/man.lua b/runtime/lua/man.lua
index 732a4ab92e..0956022ac6 100644
--- a/runtime/lua/man.lua
+++ b/runtime/lua/man.lua
@@ -149,15 +149,21 @@ local function highlight_line(line, linenr)
if overstrike then
local last_hl = hls[#hls]
if char == prev_char then
- if char == '_' and attr == UNDERLINE and last_hl and last_hl.final == byte then
- -- This underscore is in the middle of an underlined word
- attr = UNDERLINE
+ if char == '_' and attr == ITALIC and last_hl and last_hl.final == byte then
+ -- This underscore is in the middle of an italic word
+ attr = ITALIC
else
attr = BOLD
end
elseif prev_char == '_' then
- -- char is underlined
- attr = UNDERLINE
+ -- Even though underline is strictly what this should be. <bs>_ was used by nroff to
+ -- indicate italics which wasn't possible on old typewriters so underline was used. Modern
+ -- terminals now support italics so lets use that now.
+ -- See:
+ -- - https://unix.stackexchange.com/questions/274658/purpose-of-ascii-text-with-overstriking-file-format/274795#274795
+ -- - https://cmd.inp.nsk.su/old/cmd2/manuals/unix/UNIX_Unleashed/ch08.htm
+ -- attr = UNDERLINE
+ attr = ITALIC
elseif prev_char == '+' and char == 'o' then
-- bullet (overstrike text '+^Ho')
attr = BOLD