* @brief Save an editor text buffer to a file for prediffing (make UCS-2LE if appropriate) * * @note * original file is Ansi : * buffer -> save as Ansi -> Ansi plugins -> diffutils * original file is Unicode (UCS2-LE, UCS2-BE, UTF-8) : * buffer -> save as UTF-8 -> Unicode plugins -> convert to UTF-8 -> diffutils * (the plugins are optional, not the conversion) * @todo Show SaveToFi
| 294 | * @todo Show SaveToFile() errors? |
| 295 | */ |
| 296 | static int SaveBuffForDiff(CDiffTextBuffer & buf, const String& filepath, int nStartLine, int nLines) |
| 297 | { |
| 298 | // and we don't repack the file |
| 299 | PackingInfo tempPacker(false); |
| 300 | |
| 301 | // write buffer out to temporary file |
| 302 | String sError; |
| 303 | return buf.SaveToFile(filepath, true, sError, tempPacker, |
| 304 | CRLFSTYLE::AUTOMATIC, false, nStartLine, nLines); |
| 305 | } |
| 306 | |
| 307 | /** |
| 308 | * @brief Save files to temp files & compare again. |