Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Development/talagan_ReaImGui Markdown.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
--[[
@description ReaImGui Markdown : A Markdown rendering library for ReaImGui
@version 0.1.1
@version 0.1.2
@author Ben 'Talagan' Babut
@license MIT
@donation https://www.paypal.com/donate/?business=3YEZMY9D6U8NC&no_recurring=1&currency_code=EUR
@links
Forum Thread https://forum.cockos.com/showthread.php?t=301055
@changelog
- [Rework] Minor refactoring of the styling system
- [Feature] Added autopad
@metapackage
@provides
[nomain] talagan_ReaImGui Markdown/reaimgui_markdown/**/*.lua
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package.path = reaper.ImGui_GetBuiltinPath() .. '/?.lua'

local use_dev_folder = false
local use_profiler = false
local use_debugger = false
local do_unit_tests = false

-----------------
Expand Down Expand Up @@ -39,6 +40,47 @@ if use_profiler then
profiler.run()
end

if use_debugger then
reaper.ShowConsoleMsg("Beware, debugging is on. Loading VS debug extension ...")

-- Use VSCode extension
local vscode_ext_path = os.getenv("HOME") .. "/.vscode/extensions/"
local p = 0
local sdir = ''
while sdir do
sdir = reaper.EnumerateSubdirectories(vscode_ext_path, p)
if not sdir then
reaper.ShowConsoleMsg(" failed *******.\n")
break
else
if sdir:match("antoinebalaine%.reascript%-docs") then
dofile(vscode_ext_path .. "/" .. sdir .. "/debugger/LoadDebug.lua")
reaper.ShowConsoleMsg(" OK!\n")
break
end
end
p = p + 1
end
end

-- We override Reaper's defer method for two reasons :
-- We want the full trace on errors
-- We want the debugger to pause on errors

local rdefer = reaper.defer
---@diagnostic disable-next-line: duplicate-set-field
reaper.defer = function(c)
return rdefer(function() xpcall(c,
function(err)
reaper.ShowConsoleMsg(err .. '\n\n' .. debug.traceback())
end)
end)
end





local entry = [[
# This is a header level 1
## This is a header level 2
Expand Down Expand Up @@ -141,7 +183,7 @@ This library is **`:orange:powered`** by [ReaImGui](https://forum.cockos.com/sho
]]

local ctx = ImGui.CreateContext('ReaImGui:Markdown Demo')
local imgui_md = ImGuiMd:new(ctx, "markdown_widget_1", { wrap = true }, {} )
local imgui_md = ImGuiMd:new(ctx, "markdown_widget_1", { wrap = true, autopad = false }, {} )

imgui_md:setText(entry)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function ReaImGuiMd:setPartialStyle(style)
end

function ReaImGuiMd:setStyle(style)
deepCopy(self.style, style)
self.style = deepCopy(style)
end

function ReaImGuiMd:setOptions(options)
Expand Down
Loading