8

Is there any way to disable enter as auto-complete key? I like autocomplete to be switched on for words, but there are times, when I need to new line while auto-complete is showing.

I'd like auto-complete to just trigger on tab for that reason. It's kinda more than average annoyance for me.

There is a similarly-looking question, but it is not similar.

4 Answers4

7

In the current Notepad++ version (8.2.1) it is possible to set autocompletion keys easily in Settings -> Preferences dialog.

enter image description here

6

In Settings -> Shortcut mapper -> Scintilla commands

Double click SCI_NEWLINE (should be item 9 in the list), select Enter and remove it.

------ EDIT -------

Note that you can't add Enter back after removing it in Notepad++. One way to add it back is open %appdata%\Notepad++\shortcuts.xml file, and change following lines:

<ScintillaKeys>
    <ScintKey ScintID="2329" menuCmdID="0" Ctrl="no" Alt="no" Shift="yes" Key="13" />
</ScintillaKeys>

to following:

<ScintillaKeys/>

save file and restarte NotePad++, and the setting should be restored.

Deqing
  • 4,597
1

I don't know how to disable it, but a workaround would be to hit Esc before Enter to close the suggestion pop-up in that special situation where you want to insert a new line instead of auto-completing.

Lernkurve
  • 2,052
0

According to the related Github issue, there is nothing you can do in Notepad++ to prevent this. It would have to be changed in Scintilla itself.

I've resorted to an AutoHotkey script to replace Enter with Esc + Enter while in Notepad++:

#IfWinActive, ahk_class Notepad++
Enter::SendInput {Esc}{Enter}

This appears to work perfectly so far. Any menus/dialogs opened by Notepad++ have a different ahk_class, so this script won't send Esc+Enter when you just want to e.g. confirm a dialog with Enter.