I see quite some code in there to handle all the insertion of date string, including handling the selection of text in the inline rename.
You as Evaluator evangelist, do you know how I can prevent the selection of the date string, whenever I pressed CTRL-D in the inline rename? I don't need to be selected, what I inserted with a hotkey as it needs another keypress like CURSOR-Right or something to not lose it on the next character I am going to type.
I had some quick tests by removing the lines like, but it still keeps selecting the date.
selstart = 0;
selend = len(datestr);
It's not a major issue of course.
I can finally use CTRL-D now in the inline rename, which is a great win already! o)
EDIT: Puh.. complicated code, there is another section which handles the selected text, I'm tinkering, thank you, I think I can make it work! o))
EDIT: Ok, just in case anybody cares, this is my adapted Evaluator code for "Insert Date".
datestr = now() as "d#yyyy_MM_dd";
// If the whole name stem is selected, add the date to the start and select it.
//if (selstart == 0 && selend >= len(valstem)) {
// datestr = datestr + " ";
// selstart = 0;
// selend = len(datestr);
// return datestr + value;
//}
// Otherwise, replace the selection with the date, adding spaces if needed.
leftchar = right(valleft,1);
rightchar = left(valright,1);
if (leftchar != "" && leftchar != " " && leftchar != "." && leftchar != "_") {
//datestr = " " + datestr;
}
if (rightchar != "" && rightchar != " " && rightchar != "." && rightchar != "_") {
//datestr = datestr + " ";
}
selstart = len(valleft + datestr); //len(valleft);
selend = selstart; //selstart + len(datestr);
return valleft + datestr + valright;
It disables the date being selected after insertion and also disables the top part, which adds different handling for the selection being replaced or not, depending on what part of the file was selected before. I don't think handling an existing selection differently makes much sense (for me), maybe there is and I did not get the point! o) I also did not like that a blank was added if some specific characters exist left or right, so I disabled that as well.
All in all, very customizable, actually, that's ridiculously high customizable, which I like! o))
And I learned something new, have a nice day everyone! o)