Crypto Notepad Plus is a free text editor with advanced encryption features. Also you can generate code snippets in various programming languages. Its use is governed by the GPL (GNU General Public License). Tested on Windows operating systems, from version 7 to 11.
UPDATE 2024: Get a new version here: https://github.com/ivoras/EncryptedNotepad2
"Encrypted Notepad" does only one thing, but aims to do it perfectly - a Notepad-like simple text editor where files are saved (and later loaded) encrypted with industrial strength algorithms. Available both for the desktop (as a Java application) and on Android.
Unencrypted data is never stored on-disk. Source is released (on SourceForge) under the BSD license.