feat(run: winbar tp panel
This commit is contained in:
parent
9d98c3ed54
commit
99c7844aa8
3 changed files with 11 additions and 9 deletions
|
|
@ -327,13 +327,12 @@ characters below) >
|
||||||
│ 3 │ AC │ 9.0 │ 2000 │ 256 │ 0 │
|
│ 3 │ AC │ 9.0 │ 2000 │ 256 │ 0 │
|
||||||
│ 4 │ RTE │ 0.0 │ 2000 │ 256 │139 (SIGUSR2)│
|
│ 4 │ RTE │ 0.0 │ 2000 │ 256 │139 (SIGUSR2)│
|
||||||
└─────┴────────┴──────────────┴───────────┴──────────┴─────────────┘
|
└─────┴────────┴──────────────┴───────────┴──────────┴─────────────┘
|
||||||
┌─ Expected vs Actual ───────────────────┐
|
┌──────────────────────────────────────────────────────────────────┐
|
||||||
│ │
|
│Expected vs Actual │
|
||||||
│ 4[-2-]{+3+} │
|
│4[-2-]{+3+} │
|
||||||
│ 100 │
|
│ 100 │
|
||||||
│ hello w[-o-]r{+o+}ld │
|
│ hello w[-o-]r{+o+}ld │
|
||||||
│ │
|
└──────────────────────────────────────────────────────────────────┘
|
||||||
└────────────────────────────────────────┘
|
|
||||||
<
|
<
|
||||||
|
|
||||||
Status Indicators ~
|
Status Indicators ~
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ M.defaults = {
|
||||||
diff_mode = 'vim',
|
diff_mode = 'vim',
|
||||||
next_test_key = '<c-n>',
|
next_test_key = '<c-n>',
|
||||||
prev_test_key = '<c-p>',
|
prev_test_key = '<c-p>',
|
||||||
toggle_diff_key = 't',
|
toggle_diff_key = '<c-t>',
|
||||||
max_output_lines = 50,
|
max_output_lines = 50,
|
||||||
},
|
},
|
||||||
diff = {
|
diff = {
|
||||||
|
|
|
||||||
|
|
@ -259,6 +259,8 @@ local function toggle_run_panel(is_debug)
|
||||||
|
|
||||||
vim.api.nvim_set_option_value('filetype', 'cptest', { buf = expected_buf })
|
vim.api.nvim_set_option_value('filetype', 'cptest', { buf = expected_buf })
|
||||||
vim.api.nvim_set_option_value('filetype', 'cptest', { buf = actual_buf })
|
vim.api.nvim_set_option_value('filetype', 'cptest', { buf = actual_buf })
|
||||||
|
vim.api.nvim_set_option_value('winbar', 'Expected', { win = expected_win })
|
||||||
|
vim.api.nvim_set_option_value('winbar', 'Actual', { win = actual_win })
|
||||||
|
|
||||||
local expected_lines = vim.split(expected_content, '\n', { plain = true, trimempty = true })
|
local expected_lines = vim.split(expected_content, '\n', { plain = true, trimempty = true })
|
||||||
local actual_lines = vim.split(actual_content, '\n', { plain = true, trimempty = true })
|
local actual_lines = vim.split(actual_content, '\n', { plain = true, trimempty = true })
|
||||||
|
|
@ -296,6 +298,7 @@ local function toggle_run_panel(is_debug)
|
||||||
vim.api.nvim_win_set_buf(diff_win, diff_buf)
|
vim.api.nvim_win_set_buf(diff_win, diff_buf)
|
||||||
|
|
||||||
vim.api.nvim_set_option_value('filetype', 'cptest', { buf = diff_buf })
|
vim.api.nvim_set_option_value('filetype', 'cptest', { buf = diff_buf })
|
||||||
|
vim.api.nvim_set_option_value('winbar', 'Expected vs Actual', { win = diff_win })
|
||||||
|
|
||||||
local diff_backend = require('cp.diff')
|
local diff_backend = require('cp.diff')
|
||||||
local backend = diff_backend.get_best_backend('git')
|
local backend = diff_backend.get_best_backend('git')
|
||||||
|
|
@ -441,7 +444,7 @@ local function toggle_run_panel(is_debug)
|
||||||
end
|
end
|
||||||
|
|
||||||
setup_keybindings_for_buffer = function(buf)
|
setup_keybindings_for_buffer = function(buf)
|
||||||
vim.keymap.set('n', 'q', function()
|
vim.keymap.set('n', '<c-q>', function()
|
||||||
toggle_run_panel()
|
toggle_run_panel()
|
||||||
end, { buffer = buf, silent = true })
|
end, { buffer = buf, silent = true })
|
||||||
vim.keymap.set('n', config.run_panel.toggle_diff_key, function()
|
vim.keymap.set('n', config.run_panel.toggle_diff_key, function()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue