959959
960960internal .colorscheme = function (opts )
961961 local before_background = vim .o .background
962- local before_color = vim .api . nvim_exec ( " colorscheme" , true )
962+ local before_color = vim .cmd . colorscheme ( )
963963 local need_restore = true
964964
965965 local colors = opts .colors or { before_color }
@@ -999,7 +999,7 @@ internal.colorscheme = function(opts)
999999 del_win (status .layout .preview .border .winid )
10001000 end
10011001 end
1002- vim .cmd ( " colorscheme " .. entry .value )
1002+ vim .cmd . colorscheme ( entry .value )
10031003 end ,
10041004 }
10051005 else
@@ -1015,7 +1015,7 @@ internal.colorscheme = function(opts)
10151015 local lines = vim .api .nvim_buf_get_lines (bufnr , 0 , - 1 , false )
10161016 vim .api .nvim_buf_set_lines (self .state .bufnr , 0 , - 1 , false , lines )
10171017 end
1018- vim .cmd ( " colorscheme " .. entry .value )
1018+ vim .cmd . colorscheme ( entry .value )
10191019 end ,
10201020 }
10211021 end
@@ -1038,7 +1038,7 @@ internal.colorscheme = function(opts)
10381038
10391039 actions .close (prompt_bufnr )
10401040 need_restore = false
1041- vim .cmd ( " colorscheme " .. selection .value )
1041+ vim .cmd . colorscheme ( selection .value )
10421042 end )
10431043
10441044 return true
@@ -1052,7 +1052,7 @@ internal.colorscheme = function(opts)
10521052 close_windows (status )
10531053 if need_restore then
10541054 vim .o .background = before_background
1055- vim .cmd ( " colorscheme " .. before_color )
1055+ vim .cmd . colorscheme ( before_color )
10561056 end
10571057 end
10581058 end
0 commit comments