Giter Site home page Giter Site logo

Comments (2)

Screwtapello avatar Screwtapello commented on June 20, 2024

In your examples, open_buffer_picker is a command which accepts no arguments, but Kakoune is told to use buffer-completion anyway. Because of the -menu option, Kakoune will force you to choose a buffer name to add to the command-line, guaranteeing a "wrong argument count" error.

When the command is invoked without an argument (such as from a user-mode mapping), it runs the prompt command, which uses a similar user-interface, but which asks the user for a string which will be handled by a user script, rather than being executed by Kakoune as a command. As a result, it has its own, independent settings.

declare-command options like -buffer-completion have been deprecated in favour of the separate complete-command command, which modifies the completion settings for a specific user-declared command. However, prompt is a built-in command, not a user-declared command. It still requires options like -buffer-completion to control what kind of completion it provides, they have not been deprecated, and complete-command does not affect it.

Long story short, the "old" code you present under "Expectations" is still correct, and still the way to achieve the result you want with modern versions of Kakoune.

Incidentally, I assume this is a simplified test-case meant to demonstrate the problem, and not something you actually use in your kakrc. If you want a buffer picker, you could just use map global user b :b<space> since the buffer command already uses buffer-completion and already switches to the selected buffer when you hit <ret>.

from kakoune.

VKondakoff avatar VKondakoff commented on June 20, 2024

declare-command options like -buffer-completion have been deprecated in favour of the separate complete-command command, which modifies the completion settings for a specific user-declared command. However, prompt is a built-in command, not a user-declared command. It still requires options like -buffer-completion to control what kind of completion it provides, they have not been deprecated, and complete-command does not affect it.

Got it, thank you! Closing the issue.

If you want a buffer picker, you could just use map global user b :b since the buffer command already uses buffer-completion and already switches to the selected buffer when you hit .

This! Exactly, thank you once again.

from kakoune.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.