How can I open timestamps?
-
What do you mean by “opening” a timestamp?
-
Does Scintilla even track when edits were made, beyond more coarse-grained questions like “was this edit made before or after the last save”?
I just glanced through the Scintilla documentation, and I see no reference to such a capability, and I certainly don’t think it’s a feature of Notepad++.
You could use a scripting plugin like PythonScript to log the current time each time an edit is made, but I don’t see any other way to do that.
-
I started working on this because I thought it was an interesting idea, and then I realized that dealing with users deleting lines or inserting lines in the middle of the document would just be a huge headache, and the end result would probably be really unsatisfactory.
Consider:
If I delete the second and third lines fromfoo bar baz quz
and get
foo quz
in my mind, the fourth line is now the second line, and I want every line number after the third line to be changed to reflect this.
The problem is that now the time complexity of updating a file’s timestamps is potentially linear in the number of lines of the document, which means that this sort of operation would be really expensive and probably kill the editor’s responsiveness if there were more than a couple hundred lines.
-
started working on this because I thought it was an interesting idea, and then I realized that dealing with users deleting lines or inserting lines in the middle of the document would just be a huge headache
Agree. I would think something like
git blame
would be the way to go. Not necessarily time stamps but a way to attribute line changes to some type of “commit”.Cheers.
-
@Tural-Nevruzov I’m also not sure what you mean. But if your question is: how to enter the current date and time at a certain point in a file? then the answer is easy. Go to Settings>Preferences>Multi-instance & Date and define a custom time and date string. Then go to Settings>Shortcut mapper>“Date Time (customized)” and define a shortcut key (I use the Excel key
ctrl+;
). Place the caret at the point where you want time and date, hit your predefined key and voilà. -
@PeterJones said in How can I open timestamps?:
What do you mean by “opening” a timestamp?
I’m pretty sure what the OP wants here is that whenever he makes an edit on a line in his file, the date/time automatically gets filled in for the first columns on the given line.
-
@Alan-Kilborn You are probably right, but if he is editing manually, then hitting
ctrl+;
before making the edit is a small effort. -
@Paul-Wormer said in How can I open timestamps?:
then hitting ctrl+; before making the edit is a small effort
Shrug. People want what they want. :-)
-
@Michael-Vincent
Agreed, this problem from the scant and non-returning author, suggests it’s a Version Control documenting issue, and not an NPP solvable issue other than opening the VC program to save and open the files. -
@PeterJones I mean is there a plugin that shows which line was changed and when? A separate time display for each line
-
@Tural-Nevruzov
As we discussed above, it is not feasible to get a timestamp for when each line was changed. It might be feasible to get a timestamp for the last time a line was saved.If you are working with a log file, and most of the lines are added by some external process, Notepad++ cannot help you because even a hypothetical plugin that checked when lines were added could only tell you when lines were added while the file was open in the editor. Rather, you should find out how the log file is being generated and see if there is a way to make the logger show the time when a line was logged.
-
@Tural-Nevruzov
NO. -
@Mark-Olson ,
He still doesn’t get it. He doesn’t get that this is not a wordprocessor which MIGHT record those kind of changes within the meta data of the document. Let’s move on.