notepad2-mod icon indicating copy to clipboard operation
notepad2-mod copied to clipboard

Time and date appended when file starts with ".log" (WTF?)

Open aspectis opened this issue 8 years ago • 2 comments

When working on Windows, I like to use notepad2-mod for quick edits. This is where I just encountered a very weird behavior:

When opening one particular file, notepad2 (current portable x64 release 4.2.25.995) always inserts the current localized time and date, like 19:30 14.07.2017, with line breaks before and after, and moves the caret to the last line. I narrowed it down to the file content starting with .log, and it happens regardless of filename and encoding. I can only assume this is not intended.

aspectis avatar Jul 14 '17 17:07 aspectis

Well, I must correct you. This behaviour IS intended ;-) You can find it mentioned in the notepad2.txt:

New in Version 2.1.19 (released April 10, 2008)
...
  - Original Notepad .LOG feature
...

As you may have guess by now, the MS Notepad had this hidden "feature" since at least WinXP. Just google for "notepad timestamp" and you may find a bunch of how-tos...

oezgueremir avatar Jul 14 '17 21:07 oezgueremir

I see. Yet, in Windows Notepad, this only works if the file starts with .LOG (all uppercase). It was quite a surprise to stumble upon this "feature" when opening an SCSS file that contains styles for the .logo 😉 Maybe the casing should be taken into consideration. Anyway, many thanks for the explanation!

aspectis avatar Jul 14 '17 21:07 aspectis