Skip to content

Commit

Permalink
Fix some sequences not printing in titles/filenames
Browse files Browse the repository at this point in the history
This fixes issue #51: for example "temp\home" is shown as "temp ome".
  • Loading branch information
lefth committed Jul 17, 2022
1 parent 3fc8f67 commit 6826747
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/SimpleHistory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,12 @@ function draw_list()
end
end

-- example in the mpv source suggests this escape method for set_osd_ass:
-- https://github.com/mpv-player/mpv/blob/94677723624fb84756e65c8f1377956667244bc9/player/lua/stats.lua#L145
local ESC_BACKSLASH = "\\" .. string.char(0xE2, 0x81, 0xA0)
p = p:gsub("\\", ESC_BACKSLASH)
:gsub("{", "\\{")
:gsub("^ ", "\\h")
osd_msg = osd_msg .. osd_color .. osd_key .. osd_index .. p

if list_contents[#list_contents - i][osd_time_type] and tonumber(list_contents[#list_contents - i][osd_time_type]) > 0 then
Expand Down

0 comments on commit 6826747

Please sign in to comment.