mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-24 08:48:51 -05:00
* keep 8 recently used expressions around
* added acronym() function
This commit is contained in:
parent
b4706ac468
commit
a5f75ca7ae
@ -64,6 +64,13 @@ String.metaClass.space = { replacement -> replaceAll(/[:?._]/, " ").trim().repla
|
||||
String.metaClass.upperInitial = { replaceAll(/(?<=[&()+.,-;<=>?\[\]_{|}~ ]|^)[a-z]/, { it.toUpperCase() }) }
|
||||
|
||||
|
||||
/**
|
||||
* Get acronym, i.e. first letter of each word.
|
||||
*
|
||||
* e.g. "Deep Space 9" -> "DS9"
|
||||
*/
|
||||
String.metaClass.acronym = { findAll(/(?<=[&()+.,-;<=>?\[\]_{|}~ ]|^)[\p{Alnum}]/).join().toUpperCase() }
|
||||
|
||||
/**
|
||||
* Lower-case all letters that are not initials.
|
||||
*
|
||||
|
@ -627,11 +627,11 @@ class FormatDialog extends JDialog {
|
||||
// add new format first
|
||||
recent.add(format.getExpression());
|
||||
|
||||
// add next 4 most recent formats
|
||||
// save the 8 most recent formats
|
||||
for (String expression : mode.persistentFormatHistory()) {
|
||||
recent.add(expression);
|
||||
|
||||
if (recent.size() >= 5) {
|
||||
if (recent.size() >= 8) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user