When a local variable name is a substring of a top-level variable, the completion menu pops up and tries to complete the local variable (which I wanted to type) into the global variable (which I didn't).
Example:
I'm defining a very small function, so the argument name is one letter:
I want to type x <Enter> to insert the local variable and go to a new line. Instead, when I type x the completion menu pops up:
and then pressing <Enter> accepts the completion:
Usually when this happens it's because the local variable is one letter, but it can also happen with multi-letter variable names:
It's possible to work around this by hitting <Esc> before <Enter>, but it's still frustrating because my muscle memory is expecting behavior closer to ghci or a plain text editor.
Some ideas for a solution:
Don't allow pressing <Enter> to accept a completion, since you can still use <Tab>.
Don't automatically pop up the menu, since you can still use <Ctrl-Space>.
Make idea 1 or idea 2 (or both) available as a configuration option.
When a local variable name is a substring of a top-level variable, the completion menu pops up and tries to complete the local variable (which I wanted to type) into the global variable (which I didn't).
Example: I'm defining a very small function, so the argument name is one letter:
I want to type
x <Enter>
to insert the local variable and go to a new line. Instead, when I typex
the completion menu pops up:and then pressing
<Enter>
accepts the completion:Usually when this happens it's because the local variable is one letter, but it can also happen with multi-letter variable names:
It's possible to work around this by hitting
<Esc>
before<Enter>
, but it's still frustrating because my muscle memory is expecting behavior closer to ghci or a plain text editor.Some ideas for a solution:
<Enter>
to accept a completion, since you can still use<Tab>
.<Ctrl-Space>
.