Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug?] Auto-Completion Keywords get registered by spaces in the name attribute #12145

Open
Gamingtoday093 opened this issue Sep 11, 2022 · 1 comment

Comments

@Gamingtoday093
Copy link

Description of the Issue

I've been trying to implement code snippets/templates using the Auto-Complete functionality in regular Notepad++ without any Plugins. And I've actually been somewhat successful in my endeavours. But I have ran into a limitation or something I'd classify as a Bug within Notepad++'s Auto-Completion. For some reason Spaces inside of the name attribute for Keyword gets treated as a seperate Keyword? As an example <Keyword name="for ()" /> will add two Keywords for and (). I genuinely have no idea why this would be intentional as you can easily just define another Keyword. Plus it completely ruins seamless code snippets/templates. Which is something that has been suggested #9540 and feels absolutely essential for any code editor. Fixing this issue would allow for code snippets/templates natively in Notepad++ which would simply be Awesome! Next step abbreviations!

As for what I've already been able to achieve with this limitations here is an example;
image
Yes it spans two screens and is ridiculously long, this is why abbreviations (my beloved) would be great
But it comes out looking like this!
image
and with just a little clean up, it's Perfect!
image
Even with these limitations, this is a huge time saver for me as I use Notepad++ to write custom Asset files for modding Unturned. Which, without these templates, would require me to search and copy the exact layout each time I'd like to add additional functionality. Why wouldn't I use a plugin? Simply because I want this to be accessible for my fellow modders and a plugin would make it harder to install.

Steps to Reproduce the Issue

  1. Add a new Keyword to any Auto-Completion for a language
  2. Set the name attribute to anything with a space (Such as for (var i = 0; i < Things.length; i++))
  3. Turn on Auto-Completion for Notepad++ and use the language you selected
  4. Start typing the first letters of your Keyword

Expected Behavior

image
(With Spaces)

Actual Behavior

image

Debug Information

Notepad++ v8.4.4 (64-bit)
Build time : Jul 15 2022 - 17:54:42
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : "E:\SteamLibrary\steamapps\common\Unturned\Bundles\Assets\Levels\Yukon.asset"
Admin mode : ON
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Home (64-bit)
OS Version : 21H2
OS Build : 19044.1889
Current ANSI codepage : 1252
Plugins :
mimeTools (2.8)
NppConverter (4.4)
NppExport (0.4)

@Gamingtoday093 Gamingtoday093 changed the title [Bug?] [Bug?] Auto-Completion Keywords get registered by spaces in the name attribute Sep 11, 2022
@vinsworldcom
Copy link

I think there are ways to hack around this by setting the appropriate spacers in SCI_AUTOCSETSEPARATOR and SCI_SETWORDCHARS. But of course, you'd need a plugin to do that so in that case, why not just do this the appropriate way with a plugin, like:

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants