[ENHANCEMENT] New auto-add extension behaviour :

1. The filter *.* don't change the extension at all, whatever users type. 
2. The file save dialog will be launched with the filter *.* set as default. So user can add any customized extension. 
3. Choose other filters will change extension of file automatically.  
For example, a file name "toto.php" will be changed to "toto.txt" if the filter Normal Text "*.txt" is choosen. 

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@55 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
donho 2007-10-19 18:57:18 +00:00
parent ead33bc5d4
commit 798ffa148e
2 changed files with 6 additions and 2 deletions

View File

@ -38,9 +38,13 @@ typedef vector<string> stringVector;
static string changeExt(string fn, string ext)
{
if (ext == "")
return fn;
string fnExt = fn;
int index = fnExt.find_last_of(".");
string extension = ext == ""?"":".";
string extension = ".";
extension += ext;
if (index == string::npos)
{

View File

@ -11,7 +11,7 @@
<Language name="cpp" ext="h hpp hxx cpp cxx cc" commentLine="//" commentStart="/*" commentEnd="*/">
<Keywords name="instre1">if else switch case default break goto return for while do continue typedef sizeof NULL new delete throw try catch namespace operator this const_cast static_cast dynamic_cast reinterpret_cast true false using typeid and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq </Keywords>
<Keywords name="type1">void struct union enum char short int long double float signed unsigned const static extern auto register volatile bool class private protected public friend inline template virtual asm explicit typename</Keywords>
<Keywords name="type1">void struct union enum char short int long double float signed unsigned const static extern auto register volatile bool class private protected public friend inline template virtual asm explicit typename mutable</Keywords>
<Keywords name="type2">a addindex addtogroup anchor arg attention author b brief bug c class code date def defgroup deprecated dontinclude e em endcode endhtmlonly endif endlatexonly endlink endverbatim enum example exception f$ f[ f] file fn hideinitializer htmlinclude htmlonly if image include ingroup internal invariant interface latexonly li line link mainpage name namespace nosubgrouping note overload p page par param post preref relates remarks return retval sa section see showinitializer since skip skipline struct subsection test throw throws todo typedef union until var verbatim verbinclude version warning weakgroup $ @ \ &amp; &lt; &gt; # { }</Keywords>
</Language>