Insert autocomplete suggestions with enter?

Working on new editor enhancements?
Quin
Enthusiast
Enthusiast
Posts: 256
Joined: Thu Mar 31, 2022 7:03 pm
Location: United States
Contact:

Insert autocomplete suggestions with enter?

Post by Quin »

Hi,
Coming from VSCode, its been a pretty big adjustment having to press tab to add an autocomplete suggestion, as opposed to enter. Notepad++ and VSCode support both. Is it possible to get this functionality in the PureBasic IDE?
Thanks.
PB v5.40/6.10, Windows 10 64-bit.
16-core AMD Ryzen 9 5950X, 128 GB DDR5.
User avatar
spikey
Enthusiast
Enthusiast
Posts: 579
Joined: Wed Sep 22, 2010 1:17 pm
Location: United Kingdom

Re: Insert autocomplete suggestions with enter?

Post by spikey »

You can change the key used in Preferences -> General -> Shortcuts -> Insert the selected autocomplete word.
You can only have one key active at a time, though.
Quin
Enthusiast
Enthusiast
Posts: 256
Joined: Thu Mar 31, 2022 7:03 pm
Location: United States
Contact:

Re: Insert autocomplete suggestions with enter?

Post by Quin »

Oh, that's really cool. Thanks a lot!

This unfortunately isn't screen reader accessible, so I can't do it. That's a bug for another topic, though.
PB v5.40/6.10, Windows 10 64-bit.
16-core AMD Ryzen 9 5950X, 128 GB DDR5.
User avatar
spikey
Enthusiast
Enthusiast
Posts: 579
Joined: Wed Sep 22, 2010 1:17 pm
Location: United Kingdom

Re: Insert autocomplete suggestions with enter?

Post by spikey »

Sorry, I failed to pick up on that fact. The setting is stored in the file 'PureBasic.prefs'. You can find it in 'C:\Users\UserName\AppData\Roaming\PureBasic' on Windows or '/home/username/.purebasic' on Linux.
Close the IDE, if open. In the section '[Shortcuts]', change the value for 'AutoCompleteConfirm' (9 to 13 on Windows). Then restart the IDE.
I can't check for Mac but I'm sure someone with a Mac will chip in with the right value to set.
Quin
Enthusiast
Enthusiast
Posts: 256
Joined: Thu Mar 31, 2022 7:03 pm
Location: United States
Contact:

Re: Insert autocomplete suggestions with enter?

Post by Quin »

Got it, thanks a ton!

Sadly, the Keyboard Shortcut thing being inaccessible is basically unavoidable. There are ways around it, but they're difficult, especially because the main way we get around is the tab key, which it hooks.
PB v5.40/6.10, Windows 10 64-bit.
16-core AMD Ryzen 9 5950X, 128 GB DDR5.
Post Reply