Conversation
db148d5 to
5d366b2
Compare
hschne
left a comment
There was a problem hiding this comment.
So I did give this a try. Maybe I did something wrong, but testing this with go run . on gives me an error .
Error: non-empty values required to open a session with a database
exit status 1
Tried on master, works there. Tried to narrow it down, seems the issue is the backwards-compatibility code in root.go. Why those couple of lines cause problems is a mystery to me. Maybe some cobra-specific stuff I don't understand.
pkg/command/command.go
Outdated
| Navigation TUINavgationBindgins | ||
| } | ||
|
|
||
| type TUINavgationBindgins struct { |
There was a problem hiding this comment.
Typo, probably should be TUINavigationBindings.
cmd/root.go
Outdated
| Up: tcell.KeyCtrlK, | ||
| Down: tcell.KeyCtrlJ, | ||
| Left: tcell.KeyCtrlH, | ||
| Right: tcell.KeyCtrlL, | ||
| Structure: tcell.KeyCtrlS, | ||
| Indexes: tcell.KeyCtrlI, | ||
| Constraints: tcell.KeyCtrlT, |
There was a problem hiding this comment.
Removing these lines enables running go run again. Absolutely beats my why those would be an issue 🤔
There was a problem hiding this comment.
That's on me. Haven't tried the form. It's broken, forgot to ignore the new fields on the Options struct so the application can enter in the form mode.
There was a problem hiding this comment.
I pushed a new commit that ignores the TUIKeyBindings struct at the emptiness validation.
There was a problem hiding this comment.
Btw, I never run the go command on the project directly. There's a Makefile file for development. It covers the most of the commands available. Feel free to edit it so it fits your local setup requirements.
|
Works with Tried various keybinds. What I didn't get to work were keybinds using composite keys, such as |
Yeah, KeyNames is the reference for the available keybindings plus a couple of more that work but haven't been included in the map. Might submit a PR fixing that later on the What do you think about the current implementation? |
|
I think it's great, good to go as is 👍 |
…g the navigation key bindings
…tion keybindings from the config file
…he constant values from tcell
3dbe861 to
d87f42f
Compare
d87f42f to
41d7b66
Compare
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [danvergara/dblab](https://github.com/danvergara/dblab) | minor | `v0.30.1` -> `v0.32.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>danvergara/dblab (danvergara/dblab)</summary> ### [`v0.32.0`](https://github.com/danvergara/dblab/releases/tag/v0.32.0) [Compare Source](danvergara/dblab@v0.31.0...v0.32.0) #### Changelog - [`db0e6b4`](danvergara/dblab@db0e6b4) feat: configurable key bindings ([#​255](danvergara/dblab#255)) ### [`v0.31.0`](https://github.com/danvergara/dblab/releases/tag/v0.31.0) [Compare Source](danvergara/dblab@v0.30.1...v0.31.0) #### Changelog - [`2fd4b96`](danvergara/dblab@2fd4b96) build: bump go version 1.24 ([#​254](danvergara/dblab#254)) - [`afb91a3`](danvergara/dblab@afb91a3) chore: housekeeping changes ([#​256](danvergara/dblab#256)) - [`919d753`](danvergara/dblab@919d753) docs(mkdocs): update usage markdown file ([#​259](danvergara/dblab#259)) - [`e8b7a93`](danvergara/dblab@e8b7a93) feat: add a key binding to clear the query editor ([#​258](danvergara/dblab#258)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yNTkuMCIsInVwZGF0ZWRJblZlciI6IjM5LjI1OS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Make configuration configurable
Description
Some users have asked a very specific feature which is making the key bindings configurable through the
.dblab.yamlfile. Some told me that they use dblab on Tmux and key bindings don't work because navigation bindings overlap with thevim-tmux-navigatorkey bindings. I have run into this issue as well and ended up using dblab on a naked terminal which is not ideal.The new config file supports new fields like the ones shown below:
The values show above are the default ones if the fields are not present. The only way to change them is the config file, I've avoided adding new CLI flags because more flags are a burden I don't have the capacity to maintain and the config files is backward compatible, because if the values are not present, the default key bindings are picked.
The list of available key bindings come from the tcell library.
Fixes #225 #250 #233
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
QA'd the new change with new key bindings and added more assertions to the
TestInitfunction.Checklist: