# HG changeset patch
# User Jerome LAFORGE <jerome.laforge@gmail.com>
# Date 1345635412 -7200
# Node ID 75473ea44687b9bd88d492644502dfdb2a6b7ef4
# Parent c0540f310854a758c3fb57e8aa4a76c586e00f15
Override global strip.trailing.spaces with strip.trailing.spaces by pattern files.
Feature #3556320.
diff -r c0540f310854 -r 75473ea44687 doc/SciTEDoc.html
--- a/doc/SciTEDoc.html mer. août 08 23:38:24 2012 +1000
+++ b/doc/SciTEDoc.html mer. août 22 13:36:52 2012 +0200
@@ -1675,10 +1675,18 @@
</tr>
<tr id='property-strip.trailing.spaces'>
<td>
- strip.trailing.spaces
- </td>
- <td>
- Strips trailing white spaces from the file while saving.
+ strip.trailing.spaces<br />
+ strip.trailing.spaces.<i>filepattern</i>
+ </td>
+ <td>
+ Strips trailing white spaces from the file while saving.<br />
+ The global strip.trailing.spaces property can be overridden for
+ files that match a pattern by using the file pattern forms: <br />
+ <div class="example">
+ strip.trailing.spaces.*.yaml=0<br />
+ or <br />
+ strip.trailing.spaces.$(file.patterns.yaml)=0<br />
+ </div>
</td>
</tr>
<tr id='property-ensure.final.line.end'>
diff -r c0540f310854 -r 75473ea44687 src/SciTEIO.cxx
--- a/src/SciTEIO.cxx mer. août 08 23:38:24 2012 +1000
+++ b/src/SciTEIO.cxx mer. août 22 13:36:52 2012 +0200
@@ -921,7 +921,11 @@
bool retVal = false;
// Perform clean ups on text before saving
wEditor.Call(SCI_BEGINUNDOACTION);
- if (props.GetInt("strip.trailing.spaces"))
+ SString useStripTrailingSpaces = props.GetNewExpand("strip.trailing.spaces.", ExtensionFileName().c_str());
+ if (useStripTrailingSpaces.length() > 0) {
+ if (useStripTrailingSpaces.value())
+ StripTrailingSpaces();
+ } else if (props.GetInt("strip.trailing.spaces"))
StripTrailingSpaces();
if (props.GetInt("ensure.final.line.end"))
EnsureFinalNewLine();