|
1 | 1 | local state = require('opencode.state') |
2 | 2 | local config = require('opencode.config') |
3 | 3 |
|
4 | | -local PAD_LINES = 2 |
5 | | - |
6 | 4 | local M = {} |
7 | 5 |
|
8 | 6 | function M.create_buf() |
@@ -76,30 +74,10 @@ function M.set_content(lines) |
76 | 74 | end |
77 | 75 | vim.api.nvim_set_option_value('modifiable', true, { buf = windows.output_buf }) |
78 | 76 | local padded = vim.tbl_extend('force', {}, lines) |
79 | | - for _ = 1, PAD_LINES do |
80 | | - table.insert(padded, '') |
81 | | - end |
82 | 77 | vim.api.nvim_buf_set_lines(windows.output_buf, 0, -1, false, padded) |
83 | 78 | vim.api.nvim_set_option_value('modifiable', false, { buf = windows.output_buf }) |
84 | 79 | end |
85 | 80 |
|
86 | | -function M.append_content(lines, offset) |
87 | | - if not M.mounted() then |
88 | | - return |
89 | | - end |
90 | | - |
91 | | - local windows = state.windows |
92 | | - if not windows or not windows.output_buf then |
93 | | - return |
94 | | - end |
95 | | - |
96 | | - local cur_count = vim.api.nvim_buf_line_count(windows.output_buf) |
97 | | - |
98 | | - vim.api.nvim_set_option_value('modifiable', true, { buf = windows.output_buf }) |
99 | | - vim.api.nvim_buf_set_lines(windows.output_buf, cur_count - PAD_LINES, cur_count - PAD_LINES, false, lines) |
100 | | - vim.api.nvim_set_option_value('modifiable', false, { buf = windows.output_buf }) |
101 | | -end |
102 | | - |
103 | 81 | function M.focus_output(should_stop_insert) |
104 | 82 | if should_stop_insert then |
105 | 83 | vim.cmd('stopinsert') |
|
0 commit comments