0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

Use string interpolation (#12823)

This commit is contained in:
Yegappan Lakshmanan
2023-08-17 13:28:33 -07:00
committed by GitHub
parent ad0c442f1f
commit bfc461f756

View File

@@ -1,7 +1,7 @@
vim9script vim9script
# cfilter.vim: Plugin to filter entries from a quickfix/location list # cfilter.vim: Plugin to filter entries from a quickfix/location list
# Last Change: Jun 30, 2022 # Last Change: August 16, 2023
# Maintainer: Yegappan Lakshmanan (yegappan AT yahoo DOT com) # Maintainer: Yegappan Lakshmanan (yegappan AT yahoo DOT com)
# Version: 2.0 # Version: 2.0
# #
@@ -31,11 +31,11 @@ def Qf_filter(qf: bool, searchpat: string, bang: string)
if qf if qf
Xgetlist = function('getqflist') Xgetlist = function('getqflist')
Xsetlist = function('setqflist') Xsetlist = function('setqflist')
cmd = ':Cfilter' .. bang cmd = $':Cfilter{bang}'
else else
Xgetlist = function('getloclist', [0]) Xgetlist = function('getloclist', [0])
Xsetlist = function('setloclist', [0]) Xsetlist = function('setloclist', [0])
cmd = ':Lfilter' .. bang cmd = $':Lfilter{bang}'
endif endif
firstchar = searchpat[0] firstchar = searchpat[0]
@@ -62,7 +62,7 @@ def Qf_filter(qf: bool, searchpat: string, bang: string)
endif endif
items = filter(Xgetlist(), Cond) items = filter(Xgetlist(), Cond)
title = cmd .. ' /' .. pat .. '/' title = $'{cmd} /{pat}/'
Xsetlist([], ' ', {title: title, items: items}) Xsetlist([], ' ', {title: title, items: items})
enddef enddef