370370
371371actions .close_pum = function (_ )
372372 if 0 ~= vim .fn .pumvisible () then
373- vim . api . nvim_feedkeys (vim . api .nvim_replace_termcodes (" <c-y>" , true , true , true ), " n" , true )
373+ a . nvim_feedkeys (a .nvim_replace_termcodes (" <c-y>" , true , true , true ), " n" , true )
374374 end
375375end
376376
@@ -479,7 +479,7 @@ actions.paste_register = function(prompt_bufnr)
479479
480480 -- ensure that the buffer can be written to
481481 if vim .bo [0 ].modifiable then
482- vim . api .nvim_paste (selection .content , true , - 1 )
482+ a .nvim_paste (selection .content , true , - 1 )
483483 end
484484end
485485
@@ -489,7 +489,7 @@ actions.insert_symbol = function(prompt_bufnr)
489489 local symbol = action_state .get_selected_entry ().value [1 ]
490490 actions .close (prompt_bufnr )
491491 vim .schedule (function ()
492- vim . api .nvim_put ({ symbol }, " " , true , true )
492+ a .nvim_put ({ symbol }, " " , true , true )
493493 end )
494494end
495495
@@ -500,7 +500,7 @@ actions.insert_symbol_i = function(prompt_bufnr)
500500 actions .close (prompt_bufnr )
501501 vim .schedule (function ()
502502 vim .cmd [[ startinsert]]
503- vim . api .nvim_put ({ symbol }, " " , true , true )
503+ a .nvim_put ({ symbol }, " " , true , true )
504504 end )
505505end
506506
@@ -928,15 +928,15 @@ local send_selected_to_qf = function(prompt_bufnr, mode, target)
928928 local prompt = picker :_get_prompt ()
929929 actions .close (prompt_bufnr )
930930
931- vim . api .nvim_exec_autocmds (" QuickFixCmdPre" , {})
931+ a .nvim_exec_autocmds (" QuickFixCmdPre" , {})
932932 if target == " loclist" then
933933 vim .fn .setloclist (picker .original_win_id , qf_entries , mode )
934934 else
935935 local qf_title = string.format ([[ %s (%s)]] , picker .prompt_title , prompt )
936936 vim .fn .setqflist (qf_entries , mode )
937937 vim .fn .setqflist ({}, " a" , { title = qf_title })
938938 end
939- vim . api .nvim_exec_autocmds (" QuickFixCmdPost" , {})
939+ a .nvim_exec_autocmds (" QuickFixCmdPost" , {})
940940end
941941
942942local send_all_to_qf = function (prompt_bufnr , mode , target )
@@ -951,7 +951,7 @@ local send_all_to_qf = function(prompt_bufnr, mode, target)
951951 local prompt = picker :_get_prompt ()
952952 actions .close (prompt_bufnr )
953953
954- vim . api .nvim_exec_autocmds (" QuickFixCmdPre" , {})
954+ a .nvim_exec_autocmds (" QuickFixCmdPre" , {})
955955 local qf_title = string.format ([[ %s (%s)]] , picker .prompt_title , prompt )
956956 if target == " loclist" then
957957 vim .fn .setloclist (picker .original_win_id , qf_entries , mode )
@@ -960,7 +960,7 @@ local send_all_to_qf = function(prompt_bufnr, mode, target)
960960 vim .fn .setqflist (qf_entries , mode )
961961 vim .fn .setqflist ({}, " a" , { title = qf_title })
962962 end
963- vim . api .nvim_exec_autocmds (" QuickFixCmdPost" , {})
963+ a .nvim_exec_autocmds (" QuickFixCmdPost" , {})
964964end
965965
966966--- Sends the selected entries to the quickfix list, replacing the previous entries.
@@ -1120,7 +1120,7 @@ actions.complete_tag = function(prompt_bufnr)
11201120 end
11211121
11221122 -- incremental completion by substituting string starting from col - #line byte offset
1123- local col = vim . api .nvim_win_get_cursor (0 )[2 ] + 1
1123+ local col = a .nvim_win_get_cursor (0 )[2 ] + 1
11241124 vim .fn .complete (col - # line , filtered_tags )
11251125end
11261126
@@ -1180,33 +1180,33 @@ actions.delete_buffer = function(prompt_bufnr)
11801180
11811181 current_picker :delete_selection (function (selection )
11821182 local force = vim .bo [selection .bufnr ].buftype == " terminal"
1183- local ok = pcall (vim . api .nvim_buf_delete , selection .bufnr , { force = force })
1183+ local ok = pcall (a .nvim_buf_delete , selection .bufnr , { force = force })
11841184
11851185 -- If the current buffer is deleted, switch to the previous buffer
11861186 -- according to bdelete behavior
11871187 if ok and selection .bufnr == current_picker .original_bufnr then
1188- if vim . api .nvim_win_is_valid (current_picker .original_win_id ) then
1188+ if a .nvim_win_is_valid (current_picker .original_win_id ) then
11891189 local jumplist = vim .fn .getjumplist (current_picker .original_win_id )[1 ]
11901190 for i = # jumplist , 1 , - 1 do
11911191 if jumplist [i ].bufnr ~= selection .bufnr and vim .fn .bufloaded (jumplist [i ].bufnr ) == 1 then
1192- vim . api .nvim_win_set_buf (current_picker .original_win_id , jumplist [i ].bufnr )
1192+ a .nvim_win_set_buf (current_picker .original_win_id , jumplist [i ].bufnr )
11931193 current_picker .original_bufnr = jumplist [i ].bufnr
11941194 return ok
11951195 end
11961196 end
11971197
11981198 -- no more valid buffers in jumplist, create an empty buffer
1199- local empty_buf = vim . api .nvim_create_buf (true , true )
1200- vim . api .nvim_win_set_buf (current_picker .original_win_id , empty_buf )
1199+ local empty_buf = a .nvim_create_buf (true , true )
1200+ a .nvim_win_set_buf (current_picker .original_win_id , empty_buf )
12011201 current_picker .original_bufnr = empty_buf
1202- vim . api .nvim_buf_delete (selection .bufnr , { force = true })
1202+ a .nvim_buf_delete (selection .bufnr , { force = true })
12031203 return ok
12041204 end
12051205
12061206 -- window of the selected buffer got wiped, switch to first valid window
12071207 local win_id = vim .fn .win_getid (1 , current_picker .original_tabpage )
12081208 current_picker .original_win_id = win_id
1209- current_picker .original_bufnr = vim . api .nvim_win_get_buf (win_id )
1209+ current_picker .original_bufnr = a .nvim_win_get_buf (win_id )
12101210 end
12111211 return ok
12121212 end )
@@ -1404,12 +1404,12 @@ actions.which_key = function(prompt_bufnr, opts)
14041404 vim .wo [km_win_id ].winblend = opts .winblend
14051405 vim .wo [km_win_id ].foldenable = false
14061406
1407- vim . api .nvim_create_autocmd (" BufLeave" , {
1407+ a .nvim_create_autocmd (" BufLeave" , {
14081408 buffer = km_buf ,
14091409 once = true ,
14101410 callback = function ()
1411- pcall (vim . api .nvim_win_close , km_win_id , true )
1412- pcall (vim . api .nvim_win_close , km_opts .border .win_id , true )
1411+ pcall (a .nvim_win_close , km_win_id , true )
1412+ pcall (a .nvim_win_close , km_opts .border .win_id , true )
14131413 require (" telescope.utils" ).buf_delete (km_buf )
14141414 end ,
14151415 })
@@ -1432,7 +1432,7 @@ actions.which_key = function(prompt_bufnr, opts)
14321432 table.insert (highlights , { hl = display_hl , row = row , col = # prev_line })
14331433 end
14341434
1435- -- highlighting only after line setting as vim.api .nvim_buf_set_lines removes hl otherwise
1435+ -- highlighting only after line setting as a .nvim_buf_set_lines removes hl otherwise
14361436 for _ , highlight_tbl in pairs (highlights ) do
14371437 local highlight = highlight_tbl .hl
14381438 local row_ = highlight_tbl .row
@@ -1458,14 +1458,14 @@ actions.which_key = function(prompt_bufnr, opts)
14581458 end
14591459 -- only set up autocommand after showing preview completed
14601460 vim .schedule (function ()
1461- vim . api .nvim_create_autocmd (close_event , {
1461+ a .nvim_create_autocmd (close_event , {
14621462 pattern = close_pattern ,
14631463 buffer = close_buffer ,
14641464 once = true ,
14651465 callback = function ()
14661466 vim .schedule (function ()
1467- pcall (vim . api .nvim_win_close , km_win_id , true )
1468- pcall (vim . api .nvim_win_close , km_opts .border .win_id , true )
1467+ pcall (a .nvim_win_close , km_win_id , true )
1468+ pcall (a .nvim_win_close , km_opts .border .win_id , true )
14691469 utils .buf_delete (km_buf )
14701470 end )
14711471 end ,
@@ -1516,9 +1516,9 @@ actions.delete_mark = function(prompt_bufnr)
15161516
15171517 local success
15181518 if mark :match " %u" then
1519- success = pcall (vim . api .nvim_del_mark , mark )
1519+ success = pcall (a .nvim_del_mark , mark )
15201520 else
1521- success = pcall (vim . api .nvim_buf_del_mark , bufnr , mark )
1521+ success = pcall (a .nvim_buf_del_mark , bufnr , mark )
15221522 end
15231523 return success
15241524 end )
0 commit comments