summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-01-03 12:40:24 -0500
committerpommicket <pommicket@gmail.com>2023-01-03 12:40:24 -0500
commitc37d493327ded5952f46cbf39aef920e47c1d7d9 (patch)
treee9e4ac7eec0d500f0b4678bd97cf3d4edd9b18c8
parent1c74c64c6429ebc3720e519cfb155b0a914e1c24 (diff)
use different keys for hover+highlights to be less distracting
-rw-r--r--README.md6
-rw-r--r--ide-highlights.c5
-rw-r--r--ide-hover.c5
-rw-r--r--ted.cfg4
4 files changed, 9 insertions, 11 deletions
diff --git a/README.md b/README.md
index fac0dba..4cbddae 100644
--- a/README.md
+++ b/README.md
@@ -136,11 +136,11 @@ Press Ctrl+space to autocomplete. If there is only one possible completion from
Otherwise, you'll get a popup showing all possible completions. You can press tab to select a completion (or click on it), and press
Ctrl+space/Ctrl+shift+space to cycle between suggestions.
-Hover over an identifier and press Shift to see its type and documentation ("hover information").
+Hover over an identifier and press F1 to see its type and documentation ("hover information").
-While your cursor is over an identifier, you can press Ctrl to highlight where it is used
+While your cursor is over an identifier, you can press F2 to highlight where it is used
("document highlights"). If you turn on `highlight-auto` in the settings, the highlights
-will appear even if you don't press Ctrl.
+will appear even if you don't press F2.
Press Ctrl+U to see usages of the identifier under the cursor. You can use Ctrl+\[ and Ctrl+\]
to navigate between them, just like build errors.
diff --git a/ide-highlights.c b/ide-highlights.c
index 511a2fe..e568820 100644
--- a/ide-highlights.c
+++ b/ide-highlights.c
@@ -52,10 +52,9 @@ void highlights_frame(Ted *ted) {
return;
}
const Settings *settings = buffer_settings(buffer);
- bool ctrl_down = SDL_GetKeyboardState(NULL)[SDL_SCANCODE_LCTRL]
- || SDL_GetKeyboardState(NULL)[SDL_SCANCODE_RCTRL];
+ bool f2_down = SDL_GetKeyboardState(NULL)[SDL_SCANCODE_F2];
if (!settings->highlight_enabled
- || (!settings->highlight_auto && !ctrl_down)) {
+ || (!settings->highlight_auto && !f2_down)) {
highlights_close(ted);
return;
}
diff --git a/ide-hover.c b/ide-hover.c
index aed5dbd..f99c2e7 100644
--- a/ide-hover.c
+++ b/ide-hover.c
@@ -78,10 +78,9 @@ void hover_frame(Ted *ted, double dt) {
return;
Hover *hover = &ted->hover;
- bool shift_down = SDL_GetKeyboardState(NULL)[SDL_SCANCODE_LSHIFT]
- || SDL_GetKeyboardState(NULL)[SDL_SCANCODE_RSHIFT];
+ bool f1_down = SDL_GetKeyboardState(NULL)[SDL_SCANCODE_F1];
- bool open_hover = shift_down || hover->time >= settings->hover_time;
+ bool open_hover = f1_down || hover->time >= settings->hover_time;
hover->time += dt;
diff --git a/ted.cfg b/ted.cfg
index 1871987..fa36df3 100644
--- a/ted.cfg
+++ b/ted.cfg
@@ -39,11 +39,11 @@ lsp-enabled = yes
# display function signature help? (only with LSP running)
# this is the thing at the bottom of ted which shows the parameters to the function you're calling
signature-help-enabled = yes
-# display hover info when shift key is pressed? (only with LSP running)
+# display hover info when F1 key is pressed? (only with LSP running)
hover-enabled = yes
# if this is set to x, then hover info will be displayed without shift key after x seconds (with LSP running)
hover-time = 1e10
-# highlight instances of the variable under the cursor when the ctrl key is pressed? (only with LSP running)
+# highlight instances of the variable under the cursor when the F2 key is pressed? (only with LSP running)
highlight-enabled = yes
# don't require ctrl key for highlighting
highlight-auto = no