-- add debug print backtrace on cursor
-- function backtrace()
--    local pos = vim.api.nvim_win_get_cursor(0)[2]
--    local line = vim.api.nvim_get_current_line()
--    local nline = line:sub(0, pos) .. 'debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)' .. line:sub(pos + 1)
--    vim.api.nvim_set_current_line(nline)
-- end
--vim.api.nvim_create_user_command('backtrace', 'echo "debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)"', {'bang': v:true})
--
local PHP = {}

PHP.backtrace = function()
    local pos = vim.api.nvim_win_get_cursor(0)[2]
    local line = vim.api.nvim_get_current_line()
    local nline = line:sub(0, pos) .. 'debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)' .. line:sub(pos + 1)
    vim.api.nvim_set_current_line(nline)
end
