Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

display them all -> allow number #111

Open
kberry opened this issue Oct 10, 2023 · 2 comments
Open

display them all -> allow number #111

kberry opened this issue Oct 10, 2023 · 2 comments
Labels
cli Command-line interface enhancement New feature or request

Comments

@kberry
Copy link
Contributor

kberry commented Oct 10, 2023

texdoc -l bibtex says 142 results. Display them all? (y/N). That's fine, but when I previously saw the whole list, I often already know which number I want. Thus it would be nice to allow typing a number to that question, not just y/n. Just a suggestion.

@muzimuzhi
Copy link
Contributor

Seems it's controlled by goodness of each item in the list and config max_lines (default 20).

-- print a list of docfile objects (see texdoclib-search.tlu) as a menu
-- if showall is false, stop as soon as a bad result is encountered
local function print_menu(name, doclist, showall)
local max_lines = tonumber(texdoc.config.get_value('max_lines'))
if texdoc.config.get_value('interact_switch') and doclist[max_lines + 1] then
-- there may be too many lines, count them
local n = 0
for _, doc in pairs(doclist) do
if doc:get_quality() == 'good' or
(showall and doc:get_quality() ~= 'killed') then
n = n + 1
end
end
if n > max_lines then
io.write(n, ' results. Display them all? (y/N) ')

Similarly, once I wanted sth like texdoc --number 2 bibtex which will directly open the second result of texdoc -l bibtex.

@wtsnjp
Copy link
Member

wtsnjp commented Oct 11, 2023

For your information, we have another related plan #97.

@wtsnjp wtsnjp added enhancement New feature or request cli Command-line interface labels Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Command-line interface enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants