@@ -112,8 +112,6 @@ function M.setup(windows)
112112 M .recover_input (windows )
113113
114114 require (' opencode.ui.context_bar' ).render (windows )
115-
116- M .add_winbar_padding (windows )
117115end
118116
119117function M .update_dimensions (windows )
@@ -198,7 +196,6 @@ function M.set_content(text, windows)
198196 local lines = type (text ) == ' table' and text or vim .split (tostring (text ), ' \n ' )
199197
200198 vim .api .nvim_buf_set_lines (windows .input_buf , 0 , - 1 , false , lines )
201- M .add_winbar_padding (windows )
202199end
203200
204201function M .set_current_line (text , windows )
@@ -208,7 +205,6 @@ function M.set_current_line(text, windows)
208205 end
209206
210207 vim .api .nvim_set_current_line (text )
211- M .add_winbar_padding (windows )
212208end
213209
214210function M .remove_mention (mention_name , windows )
@@ -229,7 +225,6 @@ function M.remove_mention(mention_name, windows)
229225
230226 vim .api .nvim_buf_set_lines (windows .input_buf , 0 , - 1 , false , lines )
231227 require (' opencode.ui.mention' ).highlight_all_mentions (windows .input_buf )
232- M .add_winbar_padding (windows )
233228end
234229
235230function M .is_empty ()
@@ -242,34 +237,6 @@ function M.is_empty()
242237 return # lines == 0 or (# lines == 1 and lines [1 ] == ' ' )
243238end
244239
245- function M .add_winbar_padding (windows )
246- if not M .mounted (windows ) then
247- return
248- end
249-
250- local ns_id = vim .api .nvim_create_namespace (' winbar_padding' )
251- vim .api .nvim_buf_clear_namespace (windows .input_buf , ns_id , 0 , - 1 )
252-
253- vim .api .nvim_buf_set_extmark (windows .input_buf , ns_id , 0 , 0 , {
254- virt_lines = { { { ' ' } } },
255- virt_lines_above = true ,
256- })
257-
258- M .apply_topfill_workaround (windows )
259- end
260-
261- function M .apply_topfill_workaround (windows )
262- if not M .mounted (windows ) then
263- return
264- end
265-
266- local topfill = 1
267- local win = windows .input_win
268- if win and vim .api .nvim_win_is_valid (win ) then
269- vim .fn .win_execute (win , ' lua vim.fn.winrestview({ topfill = ' .. topfill .. ' })' )
270- end
271- end
272-
273240function M .setup_keymaps (windows )
274241 local keymap = require (' opencode.keymap' )
275242 keymap .setup_window_keymaps (config .keymap .input_window , windows .input_buf )
@@ -283,7 +250,6 @@ function M.setup_autocmds(windows, group)
283250 M .refresh_placeholder (windows )
284251 state .last_focused_opencode_window = ' input'
285252 require (' opencode.ui.context_bar' ).render ()
286- M .apply_topfill_workaround (windows )
287253 end ,
288254 })
289255
@@ -294,9 +260,6 @@ function M.setup_autocmds(windows, group)
294260 state .input_content = input_lines
295261 M .refresh_placeholder (windows , input_lines )
296262 require (' opencode.ui.context_bar' ).render ()
297- if # input_lines == 0 or (# input_lines == 1 and input_lines [1 ] == ' ' ) then
298- M .add_winbar_padding (windows )
299- end
300263 end ,
301264 })
302265
0 commit comments