feat: clearcol
This commit is contained in:
parent
114187164e
commit
13933fc7fd
6 changed files with 40 additions and 1 deletions
|
|
@ -1,10 +1,13 @@
|
|||
local M = {}
|
||||
|
||||
local helpers = require('cp.helpers')
|
||||
local utils = require('cp.utils')
|
||||
|
||||
local function create_none_diff_layout(parent_win, expected_content, actual_content)
|
||||
local expected_buf = utils.create_buffer_with_options()
|
||||
local actual_buf = utils.create_buffer_with_options()
|
||||
helpers.clearcol(expected_buf)
|
||||
helpers.clearcol(actual_buf)
|
||||
|
||||
vim.api.nvim_set_current_win(parent_win)
|
||||
vim.cmd.split()
|
||||
|
|
@ -42,6 +45,8 @@ end
|
|||
local function create_vim_diff_layout(parent_win, expected_content, actual_content)
|
||||
local expected_buf = utils.create_buffer_with_options()
|
||||
local actual_buf = utils.create_buffer_with_options()
|
||||
helpers.clearcol(expected_buf)
|
||||
helpers.clearcol(actual_buf)
|
||||
|
||||
vim.api.nvim_set_current_win(parent_win)
|
||||
vim.cmd.split()
|
||||
|
|
@ -89,6 +94,7 @@ end
|
|||
|
||||
local function create_git_diff_layout(parent_win, expected_content, actual_content)
|
||||
local diff_buf = utils.create_buffer_with_options()
|
||||
helpers.clearcol(diff_buf)
|
||||
|
||||
vim.api.nvim_set_current_win(parent_win)
|
||||
vim.cmd.split()
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ local M = {}
|
|||
local cache = require('cp.cache')
|
||||
local config_module = require('cp.config')
|
||||
local constants = require('cp.constants')
|
||||
local helpers = require('cp.helpers')
|
||||
local layouts = require('cp.ui.layouts')
|
||||
local logger = require('cp.log')
|
||||
local state = require('cp.state')
|
||||
|
|
@ -262,6 +263,7 @@ function M.ensure_io_view()
|
|||
if config.hooks and config.hooks.setup_io_output then
|
||||
pcall(config.hooks.setup_io_output, output_buf, state)
|
||||
end
|
||||
|
||||
if config.hooks and config.hooks.setup_io_input then
|
||||
pcall(config.hooks.setup_io_input, input_buf, state)
|
||||
end
|
||||
|
|
@ -440,6 +442,7 @@ function M.toggle_panel(panel_opts)
|
|||
vim.cmd('silent only')
|
||||
|
||||
local tab_buf = utils.create_buffer_with_options()
|
||||
helpers.clearcol(tab_buf)
|
||||
local main_win = vim.api.nvim_get_current_win()
|
||||
vim.api.nvim_win_set_buf(main_win, tab_buf)
|
||||
vim.api.nvim_set_option_value('filetype', 'cp', { buf = tab_buf })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue