feat(run: winbar tp panel

This commit is contained in:
Barrett Ruth 2025-09-19 21:32:40 -04:00
parent 9d98c3ed54
commit 99c7844aa8
3 changed files with 11 additions and 9 deletions

View file

@ -327,13 +327,12 @@ characters below) >
│ 3 │ AC │ 9.0 │ 2000 │ 256 │ 0 │
│ 4 │ RTE │ 0.0 │ 2000 │ 256 │139 (SIGUSR2)│
└─────┴────────┴──────────────┴───────────┴──────────┴─────────────┘
┌─ Expected vs Actual ───────────────────┐
│ │
│ 4[-2-]{+3+} │
│ 100 │
│ hello w[-o-]r{+o+}ld │
│ │
└────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────┐
│Expected vs Actual │
│4[-2-]{+3+} │
│ 100 │
│ hello w[-o-]r{+o+}ld │
└──────────────────────────────────────────────────────────────────┘
<
Status Indicators ~

View file

@ -82,7 +82,7 @@ M.defaults = {
diff_mode = 'vim',
next_test_key = '<c-n>',
prev_test_key = '<c-p>',
toggle_diff_key = 't',
toggle_diff_key = '<c-t>',
max_output_lines = 50,
},
diff = {

View file

@ -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 = 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 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_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 backend = diff_backend.get_best_backend('git')
@ -441,7 +444,7 @@ local function toggle_run_panel(is_debug)
end
setup_keybindings_for_buffer = function(buf)
vim.keymap.set('n', 'q', function()
vim.keymap.set('n', '<c-q>', function()
toggle_run_panel()
end, { buffer = buf, silent = true })
vim.keymap.set('n', config.run_panel.toggle_diff_key, function()