magiblot / turbo

An experimental text editor based on Scintilla and Turbo Vision.
Other
466 stars 36 forks source link

Insert timestamp #36

Open amay5267 opened 1 year ago

amay5267 commented 1 year ago

Hi @magiblot

Any API to insert current timestamp like this?: Wed Oct 12 15:15:00 2022

magiblot commented 1 year ago

Hi @amay5267,

I'm sorry, I do not intend to add a feature like this. I have seen you were able to achieve this in Textadept, but it makes sense there since you can write your own lua scripts. Turbo does not support scripting and I don't think there should be a specific feature for this.

amay5267 commented 1 year ago

Hi @magiblot I am very sorry to hear that. It is such a basic feature for text editor. For example Notepad in Windows is doing it.

https://support.microsoft.com/en-us/topic/how-to-use-notepad-to-create-a-log-file-dd228763-76de-a7a7-952b-d5ae203c4e12

I am willing to implement it. Is it ok for turbo using cpp chrono library?

amay5267 commented 1 year ago

Would Ctrl+D or Ctrl+T be right shortcut?

magiblot commented 1 year ago

Hi @amay5267! I didn't know Notepad had such a feature. I have nothing against implementing this in the same way as Notepad does it. If you are willing to give a try at implementing it, using functions from the standard library is perfectly fine.

Would Ctrl+D or Ctrl+T be right shortcut?

No, these shortcuts are assigned to more important commands. It should be enough to add a menu entry (Edit > Insert Time/Date, like in Notepad).

amay5267 commented 1 year ago

As a workaround I use this Unix command output: date -R