1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-04-14 15:19:12 +08:00

Update issue template (#4446)

This commit is contained in:
Wang Shidong 2021-08-29 16:37:19 +08:00 committed by GitHub
parent 0c29068182
commit dc93c46f6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 38 additions and 21 deletions

View File

@ -1,10 +1,9 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
title: ""
labels: ""
assignees: ""
---
<!-- bug reporting without issue template will be closed automatically -->
@ -13,9 +12,7 @@ assignees: ''
## The reproduce ways from Vim starting (Required!)
## Debug info
Please press <kbd>SPC h I</kbd>, debug info will be put into clipboard, then paste all content below.
## Output of the `:SPDebugInfo!`
## Screenshots

View File

@ -46,7 +46,7 @@ function! s:template() abort
\ '',
\ '## Environment Information',
\ '',
\ '- OS: ' . SpaceVim#api#import('system').name,
\ '- OS: ' . SpaceVim#api#import('system').name(),
\ '- vim version: ' . (has('nvim') ? '-' : s:CMP.version()),
\ '- neovim version: ' . (has('nvim') ? s:CMP.version() : '-'),
\ '- SpaceVim version: ' . g:spacevim_version,

View File

@ -40,8 +40,12 @@ if $SPACEVIM_LUA && has('nvim')
function! SpaceVim#logger#viewLog(...) abort
let bang = get(a:000, 0, 0)
return luaeval('require("spacevim.logger").viewLog(require("spacevim").eval("bang"))')
if a:0 >= 1
let bang = get(a:000, 0, 0)
return luaeval('require("spacevim.logger").viewLog(require("spacevim").eval("bang"))')
else
return luaeval('require("spacevim.logger").viewLog()')
endif
endfunction
function! SpaceVim#logger#setLevel(level) abort

View File

@ -89,4 +89,12 @@ function M.has(feature)
return M.eval('float2nr(has("' .. feature .. '"))')
end
function M.echo(msg)
if vim.api ~= nil then
vim.api.nvim_echo({{msg}}, false, {})
else
vim.command('echo ' .. build_argv({msg}))
end
end
return M

View File

@ -3,6 +3,7 @@ local M = {}
local logger = require('spacevim.api').import('logger')
local cmd = require('spacevim').cmd
local call = require('spacevim').call
local echo = require('spacevim').echo
local fn = nil
if vim.fn == nil then
fn = require('spacevim').fn
@ -57,7 +58,8 @@ function M.viewRuntimeLog()
-- M.syntax_extra()
end
function M.viewLog(bang)
function M.viewLog(...)
local argvs={...}
local info = "<details><summary> SpaceVim debug information </summary>\n\n"
.. "### SpaceVim options :\n\n"
.. "```toml\n"
@ -74,17 +76,23 @@ function M.viewLog(bang)
.. "```log\n"
.. logger.view(logger.level)
.. "\n```\n</details>\n\n"
if bang == 1 then
cmd('tabnew')
cmd('setl nobuflisted')
cmd('nnoremap <buffer><silent> q :tabclose!<CR>')
-- put info into buffer
fn.append(0, fn.split(info, "\n"))
cmd('setl nomodifiable')
cmd('setl buftype=nofile')
cmd('setl filetype=markdown')
if argvs ~= nil and #argvs >= 1 then
local bang = argvs[1]
if bang == 1 then
cmd('tabnew')
cmd('setl nobuflisted')
cmd('nnoremap <buffer><silent> q :tabclose!<CR>')
-- put info into buffer
fn.append(0, fn.split(info, "\n"))
cmd('setl nomodifiable')
cmd('setl buftype=nofile')
cmd('setl filetype=markdown')
else
echo(info)
end
else
return info
end
return info
end
function M.syntax_extra()