Skip to content

Auto-Completion for Normal Text doesn't work immediately #12325

@pryrt

Description

@pryrt

Description of the Issue

When I have autoCompletion\normal.xml defined with function and word, Notepad++ doesn't auto-complete those in Normal Text files (*.txt or *.log) right away. However, if I change the language to something else (like XML and then back to None (Normal Text)), then the auto-completions for Normal Text start working, and any new files opened or created after that

Steps to Reproduce the Issue

  1. Fresh unzip of portable v8.4.6 and run
  2. Settings > Preferences > Auto-Completion: confirm
    • > From _N_th character = 1
    • Enable auto-completion on each input = Function and word completion
  3. Create new file:
    <?xml version="1.0" encoding="UTF-8" ?>
    <NotepadPlus>
        <AutoComplete language="Normal">
            <Environment ignoreCase="no" />
            <KeyWord name="function" func="yes" />
            <KeyWord name="word" />
        </AutoComplete>
    </NotepadPlus>
    
  4. SaveAs <portableDirectory>\autoCompletion\normal.xml
  5. File > New
  6. Type f or w and it doesn't suggest anything
  7. Language > XML then Language > None (Normal Text)
  8. type f and it suggests function, or type w and it suggests word
    • at first I thought the difference between step 5 and step 7 was because normal.xml was new, and the toggle caused it to reload the normal.xml
  9. from now on, any File > New followed by typing will suggest the words/functions from normal.xml
  10. File > Close All
  11. Exit Notepad++ and restart
  12. type f or w and it doesn't suggest anything
    • here, it proves that even if normal.xml already exists, Notepad++ doesn't immediately start autocompleting on normal text files
  13. Language > XML then Language > None (Normal Text)
  14. type f and it suggests function, or type w and it suggests word
    • but triggering a different language will allow Notepad++ to autocomplete on plain text files
  15. from now on, any File > New followed by typing will suggest the words/functions from normal.xml
  16. File > Close All
  17. Exit Notepad++ and restart
  18. Language > Perl (so new 1 now shows up as Perl): don't need to type anything
  19. File > New (so now you are editing new 2 which is still a normal text file)
  20. type f and it suggests function, or type w and it suggests word
    • thus, it appears that even triggering a different language through another file will trigger autocompletion on plain text
  21. File > Close All
  22. Exit Notepad++ and restart
  23. File > Open change.log or LICENSE.txt
  24. Go to the end of and start typing f or w, and it doesn't suggest anything
    • just loading a normal text file isn't sufficient to trigger autocompletion
  25. Language > XML then Language > None (Normal Text)
  26. type f and it suggests function, or type w and it suggests word
  27. from now on, any File > New followed by typing will suggest the words/functions from normal.xml

Expected Behavior

At step 5 or step 11 or step 23, it should suggest function or word as appropriate. It shouldn't matter whether it's the first file loaded in Notepad++ or not, or whether you have changed the language or not: the autocompletions in normal.txt should always apply to normal text files.

Actual Behavior

At step 5 or step 11 or step 23, it suggests nothing, and I have to do a workaround of changing the language away from None (Normal Text) and back, or at least loading or creating a file that uses a different language, in order to get Notepad++ to do autocompletion on normal .txt files.

Debug Information

Notepad++ v8.4.6   (64-bit)
Build time : Sep 25 2022 - 19:51:39
Path : C:\usr\local\apps\npp\npp.8.4.6.portable.x64\notepad++.exe
Command Line : 
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
OS Name : Windows 10 Enterprise (64-bit) 
OS Version : 20H2
OS Build : 19042.2006
Current ANSI codepage : 1252
Plugins : 
    mimeTools (2.8)
    NppConverter (4.4)
    NppExport (0.4)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions