File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -291,7 +291,12 @@ local function run_in_terminal(self, request)
291291 terminal_width = terminal_win and api .nvim_win_get_width (terminal_win ) or 80
292292 terminal_height = terminal_win and api .nvim_win_get_height (terminal_win ) or 40
293293 end
294- api .nvim_buf_set_name (terminal_buf , ' [dap-terminal] ' .. (self .config .name or body .args [1 ]))
294+ local terminal_buf_name = ' [dap-terminal] ' .. (self .config .name or body .args [1 ])
295+ local terminal_name_ok = pcall (api .nvim_buf_set_name , terminal_buf , terminal_buf_name )
296+ if not terminal_name_ok then
297+ log .warn (terminal_buf_name .. ' is not a valid buffer name' )
298+ api .nvim_buf_set_name (terminal_buf , ' [dap-terminal] <?>' )
299+ end
295300 pcall (api .nvim_buf_del_keymap , terminal_buf , " t" , " <CR>" )
296301 local ok , path = pcall (api .nvim_buf_get_option , cur_buf , ' path' )
297302 if ok then
You can’t perform that action at this time.
0 commit comments