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

[BUG] Crashes when pressing the arrow keys #45

Closed
2 tasks done
Builditluc opened this issue Jun 15, 2022 · 5 comments · Fixed by #46
Closed
2 tasks done

[BUG] Crashes when pressing the arrow keys #45

Builditluc opened this issue Jun 15, 2022 · 5 comments · Fixed by #46
Labels
state: approved This issue or pull request was approved and can be worked on type: bug This fixes a bug. Increment the minor version

Comments

@Builditluc
Copy link
Owner

General Information
Version: main
Installation Method: local build
Operating System: macOS

Describe the bug
Program crashes with an stack overflow error when pressing the arrow keys inside of a view.

To Reproduce
Steps to reproduce the behavior:

  1. Build wiki-tui locally
  2. Remove any keybindings configuration in the config file
  3. Start wiki-tui
  4. Search for anything
  5. Press the down key inside of the search preview view
  6. wiki-tui crashes

Expected behavior
Program works fine and does not crash when pressing keys

Additional context
This bug was found in another issue (#39)

Checklist

  • checked other issues for the same bug
  • read CONTRIBUTING.md
@Builditluc Builditluc added the bug label Jun 15, 2022
@Builditluc
Copy link
Owner Author

@ThomasFrans I've uploaded a patch onto the development branch (45-bug-crashes-when-pressing-the-arrow-keys). This fixes the issue for me. Could you please check if that also fixed the issue for you?

@ThomasFrans
Copy link
Contributor

Yes, fixed it.

@Builditluc
Copy link
Owner Author

Nice, I'll put up a PR and merge it

@ThomasFrans
Copy link
Contributor

It would be nice tho if the vim keybindings worked by default, alongside the arrow keys, because now they don't work anymore. Maybe they can be added to the config by default, and the user can then change them if they want. Or add them directly in the code, if hjkl isn't overridden in the config.

@Builditluc Builditluc linked a pull request Jun 15, 2022 that will close this issue
@Builditluc
Copy link
Owner Author

Builditluc commented Jun 15, 2022

You can set the vim keybindings by adding them to the config.
It would look like this:

[keybindings]
down.key = "j"
up.key = "k"
left.key = "h"
right.key = "l"

Or add them directly in the code

Yes, I could add an option called vim_mode into the config that is true by default. Need to figure out how to check if they are overridden but this shouldn't be a big problem.

@Builditluc Builditluc added state: approved This issue or pull request was approved and can be worked on type: bug This fixes a bug. Increment the minor version labels Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: approved This issue or pull request was approved and can be worked on type: bug This fixes a bug. Increment the minor version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants