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

Cheatsheet binding doc isn't updated #1811

Open
Meakk opened this issue Dec 20, 2024 · 0 comments
Open

Cheatsheet binding doc isn't updated #1811

Meakk opened this issue Dec 20, 2024 · 0 comments
Labels
source:libf3d type:enhancement New feature or request
Milestone

Comments

@Meakk
Copy link
Member

Meakk commented Dec 20, 2024

Describe the bug
On the cheatsheet, the binding has a documentation string that can change at runtime.
A user may want to update this documentation manually, but the cheatsheet is updated internally by libf3d when an option is modified.

To Reproduce
Not tested but I put it here to have an idea:

std::string ip = "127.0.0.1";
auto docServer = [](const std::string& ip) { return std::make_pair("Load from server", ip); };
interactor.addCommand("select_server", [&](const std::vector<std::string>& args) { ip = args[1]; });
interactor.addCommand("load_from_selected_server", [&](const std::vector<std::string>&) { this->LoadFromServer(ip); });
interactor.addBinding({ mod_t::NONE, "W" }, "load_from_selected_server", "Others", std::bind(docServer, std::cref(ip)));
interactor.start();
  • Open the cheatsheet
  • Run select_server 192.168.0.1 in the console
  • The binding documentation in the cheatsheet is not updated

Expected behavior
The documentation should be updated.
A solution could be to update the cheatsheet after each command is triggered?

@mwestphal mwestphal added this to the 3.0.0 milestone Dec 20, 2024
@mwestphal mwestphal added this to F3D Dec 20, 2024
@Meakk Meakk moved this to Done in F3D Dec 20, 2024
@Meakk Meakk moved this from Done to To do in F3D Dec 20, 2024
@Meakk Meakk modified the milestones: 3.0.0, 3.1.0 Dec 20, 2024
@mwestphal mwestphal added type:enhancement New feature or request source:libf3d labels Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
source:libf3d type:enhancement New feature or request
Projects
Status: To do
Development

No branches or pull requests

2 participants