• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision12675 (tree)
Zeit2008-04-17 01:12:59
Autorstefankueng

Log Message

Update to Scintilla 1.76

Ändern Zusammenfassung

Diff

--- trunk/src/Utils/scintilla/backgroundcolors.patch (revision 12674)
+++ trunk/src/Utils/scintilla/backgroundcolors.patch (revision 12675)
@@ -1,6 +1,6 @@
11 Index: include/Scintilla.h
22 ===================================================================
3---- include/Scintilla.h (revision 398)
3+--- include/Scintilla.h (revision 12674)
44 +++ include/Scintilla.h (working copy)
55 @@ -748,6 +748,7 @@
66 #define SCN_AUTOCSELECTION 2022
@@ -12,7 +12,7 @@
1212 // These structures are defined to be exactly the same shape as the Win32
1313 Index: src/Editor.cxx
1414 ===================================================================
15---- src/Editor.cxx (revision 398)
15+--- src/Editor.cxx (revision 12674)
1616 +++ src/Editor.cxx (working copy)
1717 @@ -2270,6 +2270,16 @@
1818 }
@@ -33,7 +33,7 @@
3333
3434 Index: src/Editor.h
3535 ===================================================================
36---- src/Editor.h (revision 398)
36+--- src/Editor.h (revision 12674)
3737 +++ src/Editor.h (working copy)
3838 @@ -356,6 +356,7 @@
3939 virtual void NotifyFocus(bool focus);
@@ -45,7 +45,7 @@
4545 void NotifyMove(int position);
4646 Index: win32/ScintillaWin.cxx
4747 ===================================================================
48---- win32/ScintillaWin.cxx (revision 398)
48+--- win32/ScintillaWin.cxx (revision 12674)
4949 +++ win32/ScintillaWin.cxx (working copy)
5050 @@ -203,6 +203,7 @@
5151 virtual void NotifyFocus(bool focus);
--- trunk/src/Utils/scintilla/doc/ScintillaDoc.html (revision 12674)
+++ trunk/src/Utils/scintilla/doc/ScintillaDoc.html (revision 12675)
@@ -822,6 +822,7 @@
822822 <a class="message" href="#SCI_COPYRANGE">SCI_COPYRANGE(int start, int end)</a><br />
823823 <a class="message" href="#SCI_COPYTEXT">SCI_COPYTEXT(int length,
824824 const char *text)</a><br />
825+ <a class="message" href="#SCI_COPYALLOWLINE">SCI_COPYALLOWLINE</a><br />
825826 <a class="message" href="#SCI_SETPASTECONVERTENDINGS">SCI_SETPASTECONVERTENDINGS(bool convert)</a><br />
826827 <a class="message" href="#SCI_GETPASTECONVERTENDINGS">SCI_GETPASTECONVERTENDINGS</a><br />
827828 </code>
@@ -831,6 +832,7 @@
831832 <b id="SCI_PASTE">SCI_PASTE</b><br />
832833 <b id="SCI_CLEAR">SCI_CLEAR</b><br />
833834 <b id="SCI_CANPASTE">SCI_CANPASTE</b><br />
835+ <b id="SCI_COPYALLOWLINE">SCI_COPYALLOWLINE</b><br />
834836 These commands perform the standard tasks of cutting and copying data to the clipboard,
835837 pasting from the clipboard into the document, and clearing the document.
836838 <code>SCI_CANPASTE</code> returns non-zero if the document isn't read-only and if the selection
@@ -845,6 +847,11 @@
845847 the destination and source applications. Data from SCI_PASTE will not arrive in the
846848 document immediately.</p>
847849
850+ <p><code>SCI_COPYALLOWLINE</code> works the same as SCI_COPY except that if the
851+ selection is empty then the current line is copied. On Windows, an extra "MSDEVLineSelect" marker
852+ is added to the clipboard which is then used in <code>SCI_PASTE</code> to paste
853+ the whole line before the current line.</p>
854+
848855 <b id="SCI_COPYRANGE">SCI_COPYRANGE(int start, int end)</b><br />
849856 <b id="SCI_COPYTEXT">SCI_COPYTEXT(int length, const char *text)</b><br />
850857 <p><code>SCI_COPYRANGE</code> copies a range of text from the document to
@@ -2763,7 +2770,8 @@
27632770 <code>SC_MARK_SMALLRECT</code>, <code>SC_MARK_SHORTARROW</code>, <code>SC_MARK_EMPTY</code>,
27642771 <code>SC_MARK_ARROWDOWN</code>, <code>SC_MARK_MINUS</code>, <code>SC_MARK_PLUS</code>,
27652772 <code>SC_MARK_ARROWS</code>, <code>SC_MARK_DOTDOTDOT</code>, <code>SC_MARK_EMPTY</code>,
2766- <code>SC_MARK_BACKGROUND</code> and <code>SC_MARK_FULLRECT</code>.</p>
2773+ <code>SC_MARK_BACKGROUND</code>, <code>SC_MARK_LEFTRECT</code>
2774+ and <code>SC_MARK_FULLRECT</code>.</p>
27672775
27682776 <p>The <code>SC_MARK_BACKGROUND</code> marker changes the background colour of the line only.
27692777 The <code>SC_MARK_FULLRECT</code> symbol mirrors this, changing only the margin background colour.
--- trunk/src/Utils/scintilla/doc/ScintillaDownload.html (revision 12674)
+++ trunk/src/Utils/scintilla/doc/ScintillaDownload.html (revision 12675)
@@ -25,9 +25,9 @@
2525 <table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
2626 <tr>
2727 <td>
28- <font size="4"> <a href="http://prdownloads.sourceforge.net/scintilla/scintilla175.zip?download">
28+ <font size="4"> <a href="http://prdownloads.sourceforge.net/scintilla/scintilla176.zip?download">
2929 Windows</a>&nbsp;&nbsp;
30- <a href="http://prdownloads.sourceforge.net/scintilla/scintilla175.tgz?download">
30+ <a href="http://prdownloads.sourceforge.net/scintilla/scintilla176.tgz?download">
3131 GTK+/Linux</a>&nbsp;&nbsp;
3232 </font>
3333 </td>
@@ -41,7 +41,7 @@
4141 containing very few restrictions.
4242 </p>
4343 <h3>
44- Release 1.75
44+ Release 1.76
4545 </h3>
4646 <h4>
4747 Source Code
@@ -49,8 +49,8 @@
4949 The source code package contains all of the source code for Scintilla but no binary
5050 executable code and is available in
5151 <ul>
52- <li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla175.zip?download">zip format</a> (890K) commonly used on Windows</li>
53- <li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla175.tgz?download">tgz format</a> (770K) commonly used on Linux and compatible operating systems</li>
52+ <li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla176.zip?download">zip format</a> (890K) commonly used on Windows</li>
53+ <li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla176.tgz?download">tgz format</a> (770K) commonly used on Linux and compatible operating systems</li>
5454 </ul>
5555 Instructions for building on both Windows and Linux are included in the readme file.
5656 <h4>
--- trunk/src/Utils/scintilla/doc/ScintillaHistory.html (revision 12674)
+++ trunk/src/Utils/scintilla/doc/ScintillaHistory.html (revision 12675)
@@ -305,11 +305,14 @@
305305 <td>Dmitry Maslov</td>
306306 <td>chupakabra</td>
307307 <td>Juan Carlos Arevalo Baeza</td>
308- </tr>
309308 </tr><tr>
310309 <td>Nick Treleaven</td>
311310 <td>Stephen Stagg</td>
312311 <td>Jean-Paul Iribarren</td>
312+ <td>Tim Gerundt</td>
313+ </tr><tr>
314+ <td>Sam Harwell</td>
315+ <td>Boris</td>
313316 </tr>
314317 </table>
315318 <p>
@@ -322,6 +325,71 @@
322325 </li>
323326 </ul>
324327 <h3>
328+ <a href="http://prdownloads.sourceforge.net/scintilla/scite175.zip?download">Release 1.76</a>
329+ </h3>
330+ <ul>
331+ <li>
332+ Released on 16 March 2008.
333+ </li>
334+ <li>
335+ Support for PowerShell.
336+ </li>
337+ <li>
338+ Lexer added for Magik.
339+ </li>
340+ <li>
341+ Director extension working on GTK+.
342+ </li>
343+ <li>
344+ Director extension may set focus to SciTE through "focus:" message on GTK+.
345+ </li>
346+ <li>
347+ C++ folder handles final line better in some cases.
348+ </li>
349+ <li>
350+ SCI_COPYALLOWLINE added which is similar to SCI_COPY except that if the selection is empty then
351+ the line holding the caret is copied. On Windows an extra clipboard format allows pasting this as a whole
352+ line before the current selection. This behaviour is compatible with Visual Studio.
353+ </li>
354+ <li>
355+ On Windows, the horizontal scroll bar can handle wider files.
356+ </li>
357+ <li>
358+ On Windows, a system palette leak was fixed. Should not affect many as palette mode is rarely used.
359+ </li>
360+ <li>
361+ Install command on GTK+ no longer tries to set explicit owner.
362+ </li>
363+ <li>
364+ Perl lexer handles defined-or operator "//".
365+ </li>
366+ <li>
367+ Octave lexer fixes "!=" operator.
368+ </li>
369+ <li>
370+ Optimized selection change drawing to not redraw as much when not needed.
371+ </li>
372+ <li>
373+ SciTE on GTK+ no longer echoes Lua commands so is same as on Windows.
374+ </li>
375+ <li>
376+ Automatic vertical scrolling limited to one line at a time so is not too fast.
377+ </li>
378+ <li>
379+ Crash fixed when line states set beyond end of line states. This occurred when lexers did not
380+ set a line state for each line.
381+ </li>
382+ <li>
383+ Crash in SciTE on Windows fixed when search for 513 character string fails.
384+ </li>
385+ <li>
386+ SciTE disables translucent features on Windows 9x due to crashes reported when using translucency.
387+ </li>
388+ <li>
389+ Bug fixed where whitespace background was not seen on wrapped lines.
390+ </li>
391+ </ul>
392+ <h3>
325393 <a href="http://prdownloads.sourceforge.net/scintilla/scite175.zip?download">Release 1.75</a>
326394 </h3>
327395 <ul>
--- trunk/src/Utils/scintilla/doc/ScintillaRelated.html (revision 12674)
+++ trunk/src/Utils/scintilla/doc/ScintillaRelated.html (revision 12675)
@@ -43,7 +43,7 @@
4343 Scintilla source code editing control from within Delphi and C++ Builder.
4444 </p>
4545 <p>
46- <a href="http://www.lehigh.edu/~jrl1/">wxStEdit</a>
46+ <a href="http://wxcode.sourceforge.net/showcomp.php?name=wxStEdit">wxStEdit</a>
4747 is a library and sample program that provides extra features over wxStyledTextControl.
4848 </p>
4949 <p>
@@ -123,11 +123,20 @@
123123 Projects using Scintilla
124124 </h3>
125125 <p>
126+ <a href="http://top.gresham-computing.com">TOP</a>
127+ is an interface to HP's NonStop servers which run a proprietary OS.
128+ </p>
129+ <p>
130+ <a href="http://universalindent.sourceforge.net/">UniversalIndentGUI</a>
131+ is a cross platform GUI for several code formatters, beautifiers and indenters
132+ like GreatCode, AStyle (Artistic Styler), GNU Indent, BCPP and so on.
133+ </p>
134+ <p>
126135 <a href="http://scitools.com/products/trackback/product.php">TrackBack</a>
127136 watches and backs up every change made in your source code.
128137 </p>
129138 <p>
130- <a href="http://www.applepanic.com/front/reportbuilder">ReportBuilder Primary</a>
139+ <a href="http://www.applepanic.com/">ReportBuilder Primary</a>
131140 is designed to reduce the time to compose detailed and professional primary school reports.
132141 </p>
133142 <p>
@@ -220,7 +229,7 @@
220229 PyCrash Viewer</a> can examine crash dumps of Python programs.
221230 </p>
222231 <p>
223- <a href="http://www.cabletest.com/mpt-discovery.shtml">
232+ <a href="http://www.cabletest.com/mpt-wa-software-discovery.shtml">
224233 MPT series Wire Analyzers</a> use Scintilla and SciTE.
225234 </p>
226235 <p>
@@ -256,7 +265,7 @@
256265 is a simple C/C++ IDE for the MinGW compiler on Windows.
257266 </p>
258267 <p>
259- <a href="http://www.die-offenbachs.de/detlev/eric3.html">Eric3</a>
268+ <a href="http://www.die-offenbachs.de/detlev/eric.html">Eric3</a>
260269 is a Python IDE written using PyQt and QScintilla.
261270 </p>
262271 <p>
@@ -319,11 +328,6 @@
319328 and markup languages.
320329 </p>
321330 <p>
322- <a href="http://www.akbkhome.com/Projects/phpmole-IDE/">Php mole</a>
323- is an integrated development enviroment for developing (primarily)
324- web based and phpgtk based applications.
325- </p>
326- <p>
327331 <a href="http://hapdebugger.sourceforge.net/">HAP Python Remote Debugger</a>
328332 is a Python debugger that can run on one Windows machine debugging a Python program running
329333 on either the same or another machine.
@@ -335,15 +339,6 @@
335339 wxStyledTextControl.
336340 </p>
337341 <p>
338- <a href="http://www.pragmaticprogrammer.com/ruby/downloads/ruby-install.html">Ruby installation</a>
339- that includes SciTE set up for Ruby using an included copy of the "Programming Ruby" book for help.
340- </p>
341- <p>
342- <a href="http://www.lcc.ufrn.br/~milano/ild/index.html">Interactive LuaSpace Development</a>
343- is a graphical environment for LuaSpace which combines the CORBA platform
344- with the language Lua.
345- </p>
346- <p>
347342 <a href="http://sourceforge.net/projects/pycrust/">PyCrust</a> is an interactive
348343 Python shell based on wxPython.
349344 </p>
@@ -362,7 +357,7 @@
362357 and an application.
363358 </p>
364359 <p>
365- <a href="http://llt.chez.tiscali.fr/">Filerx</a>
360+ <a href="http://llt.chez-alice.fr/">Filerx</a>
366361 is a project manager for SciTE on Windows.
367362 Open source and includes an implementation of SciTE's Director interface so
368363 will be of interest to others wanting to control SciTE.
@@ -397,7 +392,7 @@
397392 wxStyledTextCtrl used as its editor.
398393 </p>
399394 <p>
400- <a href="http://www.python.org/windows/">PythonWin</a>, a Win32 IDE for Python, uses
395+ <a href="http://www.python.org/download/windows/">PythonWin</a>, a Win32 IDE for Python, uses
401396 Scintilla for both its editing and interactive windows.
402397 </p>
403398 <h3>
@@ -449,15 +444,10 @@
449444 Documents
450445 </h3>
451446 <p>
452- <a href="http://www.finseth.com/~fin/craft/">The Craft of Text Editing</a>
447+ <a href="http://www.finseth.com/craft/">The Craft of Text Editing</a>
453448 describes how EMACS works, <i>Craig A. Finseth</i>
454449 </p>
455450 <p>
456- <a href="http://freespace.virgin.net/james.brown7/tuts/bigmem02.htm">Span Tables</a>
457- are another data structure that can be used to represent documents in memory in a way
458- that performs well when data is inserted and deleted, <i>James Brown</i>
459- </p>
460- <p>
461451 <a href="http://www.cs.cmu.edu/~wjh/papers/byte.html">Data Structures in a Bit-Mapped Text
462452 Editor</a>, <i>Wilfred J. Hanson</i>, Byte January 1987
463453 </p>
@@ -480,7 +470,7 @@
480470 Java code. SciTE has an Indent command defined for .cxx files that uses AStyle.
481471 </p>
482472 <p>
483- <a href="http://winmerge.sourceforge.net/">WinMerge</a> is an interactive diff / merge
473+ <a href="http://winmerge.org/">WinMerge</a> is an interactive diff / merge
484474 for Windows. I prefer code submissions in the form of source files rather than diffs and then run
485475 WinMerge over the files to work out how to merge.
486476 </p>
@@ -487,11 +477,11 @@
487477 <p>
488478 <a href="http://www.python.org">Python</a> is my favourite programming language. Scintilla
489479 was started after I tried to improve the editor built into <a
490- href="http://www.python.org/windows/">PythonWin</a>, but was frustrated by the limitations of
480+ href="http://www.python.org/download/windows/">PythonWin</a>, but was frustrated by the limitations of
491481 the Windows Richedit control which PythonWin used.
492482 </p>
493483 <p>
494- <a href="http://www.cs.yorku.ca/~oz/">regex</a> is a public domain
484+ <a href="http://www.cse.yorku.ca/~oz/">regex</a> is a public domain
495485 implementation of regular expression pattern matching used in Scintilla.
496486 </p>
497487 <!--
--- trunk/src/Utils/scintilla/doc/index.html (revision 12674)
+++ trunk/src/Utils/scintilla/doc/index.html (revision 12675)
@@ -9,7 +9,7 @@
99 <meta name="keywords" content="Scintilla, SciTE, Editing Component, Text Editor" />
1010 <meta name="Description"
1111 content="www.scintilla.org is the home of the Scintilla editing component and SciTE text editor application." />
12- <meta name="Date.Modified" content="20071122" />
12+ <meta name="Date.Modified" content="20080316" />
1313 <style type="text/css">
1414 .versionlist {
1515 color: #FFCC99;
@@ -36,8 +36,8 @@
3636 GTK+</font>
3737 </td>
3838 <td width="40%" align="right">
39- <font color="#FFCC99" size="3"> Release version 1.75<br />
40- Site last modified November 22 2007</font>
39+ <font color="#FFCC99" size="3"> Release version 1.76<br />
40+ Site last modified March 16 2008</font>
4141 </td>
4242 <td width="20%">
4343 &nbsp;
@@ -54,6 +54,11 @@
5454 <table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="6" border="0">
5555 <tr>
5656 <td width="100%">
57+ <span class="versionlist">Version 1.76 fixes some minor bugs.</span>
58+ </td>
59+ </tr>
60+ <tr>
61+ <td width="100%">
5762 <span class="versionlist">Version 1.75 displays invalid UTF-8 bytes as hexadecimal and
5863 can show indentation guides on completely empty lines.</span>
5964 </td>
@@ -144,8 +149,8 @@
144149 </p>
145150 <p>
146151 Scintilla and SciTE are currently available for Intel Win32 and Linux compatible operating
147- systems with GTK+. They have been run on Windows 95, NT 4.0, Windows 2000, and on Red Hat
148- Linux 8 and 9 with GTK+ 1.2 and 2.0. <a href="http://scintilla.sourceforge.net/SciTEImage.html">Here is a screenshot of
152+ systems with GTK+. They have been run on Windows 95, NT 4.0, Windows 2000, and on Fedora 8
153+ with GTK+ 2.12. <a href="http://scintilla.sourceforge.net/SciTEImage.html">Here is a screenshot of
149154 SciTE.</a><br />
150155 </p>
151156 <p>
--- trunk/src/Utils/scintilla/gtk/PlatGTK.cxx (revision 12674)
+++ trunk/src/Utils/scintilla/gtk/PlatGTK.cxx (revision 12675)
@@ -31,10 +31,6 @@
3131 with gdk_string_extents. */
3232 #define FAST_WAY
3333
34-#ifdef G_OS_WIN32
35-#define snprintf _snprintf
36-#endif
37-
3834 #if GTK_MAJOR_VERSION >= 2
3935 #define USE_PANGO 1
4036 #include "Converter.h"
@@ -572,7 +568,7 @@
572568 faceName, sizeof(faceName),
573569 charset, sizeof(charset));
574570
575- snprintf(fontspec,
571+ g_snprintf(fontspec,
576572 sizeof(fontspec) - 1,
577573 spec,
578574 foundary, faceName,
@@ -588,7 +584,7 @@
588584 strncat(fontset, fontspec, remaining - 1);
589585 remaining -= strlen(fontset);
590586
591- snprintf(fontspec,
587+ g_snprintf(fontspec,
592588 sizeof(fontspec) - 1,
593589 ",%s%s%s-o-*-*-*-%0d-*-*-*-*-%s",
594590 foundary, faceName,
@@ -623,7 +619,7 @@
623619 faceName, sizeof(faceName),
624620 charset, sizeof(charset));
625621
626- snprintf(fontspec,
622+ g_snprintf(fontspec,
627623 sizeof(fontspec) - 1,
628624 "%s%s%s%s-*-*-*-%0d-*-*-*-*-%s",
629625 foundary, faceName,
@@ -634,7 +630,7 @@
634630 newid = LoadFontOrSet(fontspec, characterSet);
635631 if (!newid) {
636632 // some fonts have oblique, not italic
637- snprintf(fontspec,
633+ g_snprintf(fontspec,
638634 sizeof(fontspec) - 1,
639635 "%s%s%s%s-*-*-*-%0d-*-*-*-*-%s",
640636 foundary, faceName,
@@ -645,7 +641,7 @@
645641 newid = LoadFontOrSet(fontspec, characterSet);
646642 }
647643 if (!newid) {
648- snprintf(fontspec,
644+ g_snprintf(fontspec,
649645 sizeof(fontspec) - 1,
650646 "-*-*-*-*-*-*-*-%0d-*-*-*-*-%s",
651647 size * 10,
--- trunk/src/Utils/scintilla/gtk/ScintillaGTK.cxx (revision 12674)
+++ trunk/src/Utils/scintilla/gtk/ScintillaGTK.cxx (revision 12675)
@@ -15,7 +15,7 @@
1515 #include "Platform.h"
1616
1717 #if PLAT_GTK_WIN32
18-#include "Windows.h"
18+#include "windows.h"
1919 #endif
2020
2121 #include "Scintilla.h"
@@ -78,7 +78,7 @@
7878 #pragma warning(disable: 4505)
7979 #endif
8080
81-#if GTK_CHECK_VERSION(2,2,0)
81+#if GTK_CHECK_VERSION(2,6,0)
8282 #define USE_GTK_CLIPBOARD
8383 #endif
8484
@@ -1412,7 +1412,7 @@
14121412 if ((selectionType != GDK_TARGET_STRING) && (selectionType != atomUTF8)) {
14131413 char *empty = new char[1];
14141414 empty[0] = '\0';
1415- selText.Set(empty, 0, SC_CP_UTF8, 0, false);
1415+ selText.Set(empty, 0, SC_CP_UTF8, 0, false, false);
14161416 return;
14171417 }
14181418
@@ -1431,16 +1431,16 @@
14311431 // Unknown encoding so assume in Latin1
14321432 char *destPrevious = dest;
14331433 dest = UTF8FromLatin1(dest, len);
1434- selText.Set(dest, len, SC_CP_UTF8, 0, selText.rectangular);
1434+ selText.Set(dest, len, SC_CP_UTF8, 0, selText.rectangular, false);
14351435 delete []destPrevious;
14361436 } else {
14371437 // Assume buffer is in same encoding as selection
14381438 selText.Set(dest, len, pdoc->dbcsCodePage,
1439- vs.styles[STYLE_DEFAULT].characterSet, isRectangular);
1439+ vs.styles[STYLE_DEFAULT].characterSet, isRectangular, false);
14401440 }
14411441 } else { // UTF-8
14421442 dest = Document::TransformLineEnds(&len, data, len, pdoc->eolMode);
1443- selText.Set(dest, len, SC_CP_UTF8, 0, isRectangular);
1443+ selText.Set(dest, len, SC_CP_UTF8, 0, isRectangular, false);
14441444 #ifdef USE_CONVERTER
14451445 const char *charSetBuffer = CharacterSetID();
14461446 if (!IsUnicodeMode() && *charSetBuffer) {
@@ -1448,7 +1448,7 @@
14481448 // Convert to locale
14491449 dest = ConvertText(&len, selText.s, selText.len, charSetBuffer, "UTF-8", true);
14501450 selText.Set(dest, len, pdoc->dbcsCodePage,
1451- vs.styles[STYLE_DEFAULT].characterSet, selText.rectangular);
1451+ vs.styles[STYLE_DEFAULT].characterSet, selText.rectangular, false);
14521452 }
14531453 #endif
14541454 }
@@ -1511,8 +1511,8 @@
15111511
15121512 void ScintillaGTK::GetSelection(GtkSelectionData *selection_data, guint info, SelectionText *text) {
15131513 #if PLAT_GTK_WIN32
1514- // Many native win32 programs require \n line endings, so make a copy of
1515- // the clip text now with newlines converted. Use { } to hide symbols
1514+ // GDK on Win32 expands any \n into \r\n, so make a copy of
1515+ // the clip text now with newlines converted to \n. Use { } to hide symbols
15161516 // from code below
15171517 SelectionText *newline_normalized = NULL;
15181518 {
@@ -1519,7 +1519,7 @@
15191519 int tmpstr_len;
15201520 char *tmpstr = Document::TransformLineEnds(&tmpstr_len, text->s, text->len, SC_EOL_LF);
15211521 newline_normalized = new SelectionText();
1522- newline_normalized->Set(tmpstr, tmpstr_len, SC_CP_UTF8, 0, text->rectangular);
1522+ newline_normalized->Set(tmpstr, tmpstr_len, SC_CP_UTF8, 0, text->rectangular, false);
15231523 text = newline_normalized;
15241524 }
15251525 #endif
@@ -1533,7 +1533,7 @@
15331533 int new_len;
15341534 char* tmputf = ConvertText(&new_len, text->s, text->len, "UTF-8", charSet, false);
15351535 converted = new SelectionText();
1536- converted->Set(tmputf, new_len, SC_CP_UTF8, 0, text->rectangular);
1536+ converted->Set(tmputf, new_len, SC_CP_UTF8, 0, text->rectangular, false);
15371537 text = converted;
15381538 }
15391539 }
--- trunk/src/Utils/scintilla/include/Platform.h (revision 12674)
+++ trunk/src/Utils/scintilla/include/Platform.h (revision 12675)
@@ -33,7 +33,7 @@
3333 #undef PLAT_GTK
3434 #define PLAT_GTK 1
3535
36-#ifdef _MSC_VER
36+#if defined(__WIN32__) || defined(_MSC_VER)
3737 #undef PLAT_GTK_WIN32
3838 #define PLAT_GTK_WIN32 1
3939 #endif
@@ -122,7 +122,7 @@
122122 }
123123 int Width() { return right - left; }
124124 int Height() { return bottom - top; }
125- bool Empty() {
125+ bool Empty() {
126126 return (Height() <= 0) || (Width() <= 0);
127127 }
128128 };
--- trunk/src/Utils/scintilla/include/SciLexer.h (revision 12674)
+++ trunk/src/Utils/scintilla/include/SciLexer.h (revision 12675)
@@ -99,6 +99,8 @@
9999 #define SCLEX_ABAQUS 84
100100 #define SCLEX_ASYMPTOTE 85
101101 #define SCLEX_R 86
102+#define SCLEX_MAGIK 87
103+#define SCLEX_POWERSHELL 88
102104 #define SCLEX_AUTOMATIC 1000
103105 #define SCE_P_DEFAULT 0
104106 #define SCE_P_COMMENTLINE 1
@@ -1203,6 +1205,34 @@
12031205 #define SCE_R_IDENTIFIER 9
12041206 #define SCE_R_INFIX 10
12051207 #define SCE_R_INFIXEOL 11
1208+#define SCE_MAGIK_DEFAULT 0
1209+#define SCE_MAGIK_COMMENT 1
1210+#define SCE_MAGIK_HYPER_COMMENT 16
1211+#define SCE_MAGIK_STRING 2
1212+#define SCE_MAGIK_CHARACTER 3
1213+#define SCE_MAGIK_NUMBER 4
1214+#define SCE_MAGIK_IDENTIFIER 5
1215+#define SCE_MAGIK_OPERATOR 6
1216+#define SCE_MAGIK_FLOW 7
1217+#define SCE_MAGIK_CONTAINER 8
1218+#define SCE_MAGIK_BRACKET_BLOCK 9
1219+#define SCE_MAGIK_BRACE_BLOCK 10
1220+#define SCE_MAGIK_SQBRACKET_BLOCK 11
1221+#define SCE_MAGIK_UNKNOWN_KEYWORD 12
1222+#define SCE_MAGIK_KEYWORD 13
1223+#define SCE_MAGIK_PRAGMA 14
1224+#define SCE_MAGIK_SYMBOL 15
1225+#define SCE_POWERSHELL_DEFAULT 0
1226+#define SCE_POWERSHELL_COMMENT 1
1227+#define SCE_POWERSHELL_STRING 2
1228+#define SCE_POWERSHELL_CHARACTER 3
1229+#define SCE_POWERSHELL_NUMBER 4
1230+#define SCE_POWERSHELL_VARIABLE 5
1231+#define SCE_POWERSHELL_OPERATOR 6
1232+#define SCE_POWERSHELL_IDENTIFIER 7
1233+#define SCE_POWERSHELL_KEYWORD 8
1234+#define SCE_POWERSHELL_CMDLET 9
1235+#define SCE_POWERSHELL_ALIAS 10
12061236 #define SCLEX_ASP 29
12071237 #define SCLEX_PHP 30
12081238 //--Autogenerated -- end of section automatically generated from Scintilla.iface
--- trunk/src/Utils/scintilla/include/Scintilla.h (revision 12674)
+++ trunk/src/Utils/scintilla/include/Scintilla.h (revision 12675)
@@ -118,6 +118,7 @@
118118 #define SC_MARK_ARROWS 24
119119 #define SC_MARK_PIXMAP 25
120120 #define SC_MARK_FULLRECT 26
121+#define SC_MARK_LEFTRECT 27
121122 #define SC_MARK_CHARACTER 10000
122123 #define SC_MARKNUM_FOLDEREND 25
123124 #define SC_MARKNUM_FOLDEROPENMID 26
@@ -666,6 +667,7 @@
666667 #define SCI_INDICATOREND 2509
667668 #define SCI_SETPOSITIONCACHE 2514
668669 #define SCI_GETPOSITIONCACHE 2515
670+#define SCI_COPYALLOWLINE 2519
669671 #define SCI_STARTRECORD 3001
670672 #define SCI_STOPRECORD 3002
671673 #define SCI_SETLEXER 4001
@@ -748,7 +750,6 @@
748750 #define SCN_AUTOCSELECTION 2022
749751 #define SCN_INDICATORCLICK 2023
750752 #define SCN_INDICATORRELEASE 2024
751-#define SCN_GETBKCOLOR 2025
752753 //--Autogenerated -- end of section automatically generated from Scintilla.iface
753754
754755 // These structures are defined to be exactly the same shape as the Win32
--- trunk/src/Utils/scintilla/src/CellBuffer.cxx (revision 12674)
+++ trunk/src/Utils/scintilla/src/CellBuffer.cxx (revision 12675)
@@ -729,6 +729,7 @@
729729 void CellBuffer::InsertLine(int line, int position) {
730730 lv.InsertLine(line, position);
731731 if (lineStates.Length()) {
732+ lineStates.EnsureLength(line);
732733 lineStates.Insert(line, 0);
733734 }
734735 }
@@ -735,7 +736,7 @@
735736
736737 void CellBuffer::RemoveLine(int line) {
737738 lv.RemoveLine(line);
738- if (lineStates.Length()) {
739+ if (lineStates.Length() > line) {
739740 lineStates.Delete(line);
740741 }
741742 }
--- trunk/src/Utils/scintilla/src/Editor.cxx (revision 12674)
+++ trunk/src/Utils/scintilla/src/Editor.cxx (revision 12675)
@@ -225,8 +225,8 @@
225225
226226 void Editor::InvalidateStyleData() {
227227 stylesValid = false;
228+ DropGraphics();
228229 palette.Release();
229- DropGraphics();
230230 llc.Invalidate(LineLayout::llInvalid);
231231 posCache.Clear();
232232 if (selType == selRectangle) {
@@ -719,19 +719,26 @@
719719 }
720720 }
721721
722-void Editor::InvalidateSelection(int currentPos_, int anchor_) {
723- int firstAffected = anchor;
724- if (firstAffected > currentPos)
725- firstAffected = currentPos;
726- if (firstAffected > anchor_)
727- firstAffected = anchor_;
722+void Editor::InvalidateSelection(int currentPos_, int anchor_, bool invalidateWholeSelection) {
723+ if (anchor != anchor_ || selType == selRectangle) {
724+ invalidateWholeSelection = true;
725+ }
726+ int firstAffected = currentPos;
727+ if (invalidateWholeSelection) {
728+ if (firstAffected > anchor)
729+ firstAffected = anchor;
730+ if (firstAffected > anchor_)
731+ firstAffected = anchor_;
732+ }
728733 if (firstAffected > currentPos_)
729734 firstAffected = currentPos_;
730- int lastAffected = anchor;
731- if (lastAffected < currentPos)
732- lastAffected = currentPos;
733- if (lastAffected < anchor_)
734- lastAffected = anchor_;
735+ int lastAffected = currentPos;
736+ if (invalidateWholeSelection) {
737+ if (lastAffected < anchor)
738+ lastAffected = anchor;
739+ if (lastAffected < anchor_)
740+ lastAffected = anchor_;
741+ }
735742 if (lastAffected < (currentPos_ + 1)) // +1 ensures caret repainted
736743 lastAffected = (currentPos_ + 1);
737744 needUpdateUI = true;
@@ -742,7 +749,7 @@
742749 currentPos_ = pdoc->ClampPositionIntoDocument(currentPos_);
743750 anchor_ = pdoc->ClampPositionIntoDocument(anchor_);
744751 if ((currentPos != currentPos_) || (anchor != anchor_)) {
745- InvalidateSelection(currentPos_, anchor_);
752+ InvalidateSelection(currentPos_, anchor_, true);
746753 currentPos = currentPos_;
747754 anchor = anchor_;
748755 }
@@ -753,7 +760,7 @@
753760 void Editor::SetSelection(int currentPos_) {
754761 currentPos_ = pdoc->ClampPositionIntoDocument(currentPos_);
755762 if (currentPos != currentPos_) {
756- InvalidateSelection(currentPos_, currentPos_);
763+ InvalidateSelection(currentPos_, anchor, false);
757764 currentPos = currentPos_;
758765 }
759766 SetRectangularRange();
@@ -1400,7 +1407,7 @@
14001407 }
14011408 }
14021409
1403-const char *StringFromEOLMode(int eolMode) {
1410+const char *Editor::StringFromEOLMode(int eolMode) {
14041411 if (eolMode == SC_EOL_CRLF) {
14051412 return "\r\n";
14061413 } else if (eolMode == SC_EOL_CR) {
@@ -2270,16 +2277,6 @@
22702277 }
22712278 }
22722279
2273- SCNotification scn = {0};
2274- scn.nmhdr.code = SCN_GETBKCOLOR;
2275- scn.line = line;
2276- scn.lParam = -1;
2277- NotifyParent(&scn);
2278- if (scn.lParam != -1)
2279- {
2280- background = scn.lParam;
2281- overrideBackground = true;
2282- }
22832280 bool drawWhitespaceBackground = (vsDraw.viewWhitespace != wsInvisible) &&
22842281 (!overrideBackground) && (vsDraw.whitespaceBackgroundSet);
22852282
@@ -2392,8 +2389,10 @@
23922389 if (ll->chars[cpos + startseg] == ' ') {
23932390 if (drawWhitespaceBackground &&
23942391 (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways)) {
2395- PRectangle rcSpace(ll->positions[cpos + startseg] + xStart, rcSegment.top,
2396- ll->positions[cpos + startseg + 1] + xStart, rcSegment.bottom);
2392+ PRectangle rcSpace(ll->positions[cpos + startseg] + xStart - subLineStart,
2393+ rcSegment.top,
2394+ ll->positions[cpos + startseg + 1] + xStart - subLineStart,
2395+ rcSegment.bottom);
23972396 surface->FillRectangle(rcSpace, vsDraw.whitespaceBackground.allocated);
23982397 }
23992398 } else {
@@ -2525,7 +2524,10 @@
25252524 if (!twoPhaseDraw && drawWhitespaceBackground &&
25262525 (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways)) {
25272526 textBack = vsDraw.whitespaceBackground.allocated;
2528- PRectangle rcSpace(ll->positions[cpos + startseg] + xStart, rcSegment.top, ll->positions[cpos + startseg + 1] + xStart, rcSegment.bottom);
2527+ PRectangle rcSpace(ll->positions[cpos + startseg] + xStart - subLineStart,
2528+ rcSegment.top,
2529+ ll->positions[cpos + startseg + 1] + xStart - subLineStart,
2530+ rcSegment.bottom);
25292531 surface->FillRectangle(rcSpace, textBack);
25302532 }
25312533 PRectangle rcDot(xmid + xStart - subLineStart, rcSegment.top + vsDraw.lineHeight / 2, 0, 0);
@@ -2780,6 +2782,7 @@
27802782 //Platform::DebugPrintf("Paint:%1d (%3d,%3d) ... (%3d,%3d)\n",
27812783 // paintingAllText, rcArea.left, rcArea.top, rcArea.right, rcArea.bottom);
27822784
2785+ pixmapLine->Release();
27832786 RefreshStyleData();
27842787 RefreshPixMaps(surfaceWindow);
27852788
@@ -2809,10 +2812,17 @@
28092812 pdoc->EnsureStyledTo(endPosPaint);
28102813 bool paintAbandonedByStyling = paintState == paintAbandoned;
28112814 if (needUpdateUI) {
2815+ // Deselect palette by selecting a temporary palette
2816+ Palette palTemp;
2817+ surfaceWindow->SetPalette(&palTemp, true);
2818+
28122819 NotifyUpdateUI();
28132820 needUpdateUI = false;
2821+
28142822 RefreshStyleData();
28152823 RefreshPixMaps(surfaceWindow);
2824+ surfaceWindow->SetPalette(&palette, true);
2825+ pixmapLine->SetPalette(&palette, !hasFocus);
28162826 }
28172827
28182828 // Call priority lines wrap on a window of lines which are likely
@@ -3496,6 +3506,12 @@
34963506 pdoc->ClearLevels();
34973507 }
34983508
3509+void Editor::CopyAllowLine() {
3510+ SelectionText selectedText;
3511+ CopySelectionRange(&selectedText, true);
3512+ CopyToClipboard(selectedText);
3513+}
3514+
34993515 void Editor::Cut() {
35003516 pdoc->CheckReadOnly();
35013517 if (!pdoc->IsReadOnly() && !SelectionContainsProtected()) {
@@ -4046,6 +4062,7 @@
40464062 case SCI_PAGEUPRECTEXTEND:
40474063 case SCI_PAGEDOWNRECTEXTEND:
40484064 case SCI_SELECTIONDUPLICATE:
4065+ case SCI_COPYALLOWLINE:
40494066 break;
40504067
40514068 // Filter out all others like display changes. Also, newlines are redundant
@@ -4912,14 +4929,37 @@
49124929 return text;
49134930 }
49144931
4915-void Editor::CopySelectionFromRange(SelectionText *ss, int start, int end) {
4916- ss->Set(CopyRange(start, end), end - start + 1,
4917- pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false);
4932+void Editor::CopySelectionFromRange(SelectionText *ss, bool allowLineCopy, int start, int end) {
4933+ bool isLine = allowLineCopy && (start == end);
4934+ if (isLine) {
4935+ int currentLine = pdoc->LineFromPosition(currentPos);
4936+ start = pdoc->LineStart(currentLine);
4937+ end = pdoc->LineEnd(currentLine);
4938+
4939+ char *text = CopyRange(start, end);
4940+ int textLen = text ? strlen(text) : 0;
4941+ // include room for \r\n\0
4942+ textLen += 3;
4943+ char *textWithEndl = new char[textLen];
4944+ textWithEndl[0] = '\0';
4945+ if (text)
4946+ strncat(textWithEndl, text, textLen);
4947+ if (pdoc->eolMode != SC_EOL_LF)
4948+ strncat(textWithEndl, "\r", textLen);
4949+ if (pdoc->eolMode != SC_EOL_CR)
4950+ strncat(textWithEndl, "\n", textLen);
4951+ ss->Set(textWithEndl, strlen(textWithEndl),
4952+ pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false, true);
4953+ delete []text;
4954+ } else {
4955+ ss->Set(CopyRange(start, end), end - start + 1,
4956+ pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false, false);
4957+ }
49184958 }
49194959
4920-void Editor::CopySelectionRange(SelectionText *ss) {
4960+void Editor::CopySelectionRange(SelectionText *ss, bool allowLineCopy) {
49214961 if (selType == selStream) {
4922- CopySelectionFromRange(ss, SelectionStart(), SelectionEnd());
4962+ CopySelectionFromRange(ss, allowLineCopy, SelectionStart(), SelectionEnd());
49234963 } else {
49244964 char *text = 0;
49254965 int size = 0;
@@ -4957,7 +4997,7 @@
49574997 }
49584998 }
49594999 ss->Set(text, size + 1, pdoc->dbcsCodePage,
4960- vs.styles[STYLE_DEFAULT].characterSet, selType == selRectangle);
5000+ vs.styles[STYLE_DEFAULT].characterSet, selType == selRectangle, selType == selLines);
49615001 }
49625002 }
49635003
@@ -4966,7 +5006,7 @@
49665006 end = pdoc->ClampPositionIntoDocument(end);
49675007 SelectionText selectedText;
49685008 selectedText.Set(CopyRange(start, end), end - start + 1,
4969- pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false);
5009+ pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false, false);
49705010 CopyToClipboard(selectedText);
49715011 }
49725012
@@ -4973,7 +5013,7 @@
49735013 void Editor::CopyText(int length, const char *text) {
49745014 SelectionText selectedText;
49755015 selectedText.Copy(text, length + 1,
4976- pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false);
5016+ pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false, false);
49775017 CopyToClipboard(selectedText);
49785018 }
49795019
@@ -5398,11 +5438,11 @@
53985438 if (lineMove < 0) {
53995439 lineMove = cs.DisplayFromDoc(pdoc->LinesTotal() - 1);
54005440 }
5401- ScrollTo(lineMove - LinesOnScreen() + 5);
5441+ ScrollTo(lineMove - LinesOnScreen() + 1);
54025442 Redraw();
54035443 } else if (pt.y < rcClient.top) {
54045444 int lineMove = cs.DisplayFromDoc(LineFromLocation(pt));
5405- ScrollTo(lineMove - 5);
5445+ ScrollTo(lineMove - 1);
54065446 Redraw();
54075447 }
54085448 EnsureCaretVisible(false, false, true);
@@ -5950,6 +5990,10 @@
59505990 Copy();
59515991 break;
59525992
5993+ case SCI_COPYALLOWLINE:
5994+ CopyAllowLine();
5995+ break;
5996+
59535997 case SCI_COPYRANGE:
59545998 CopyRangeToClipboard(wParam, lParam);
59555999 break;
@@ -7410,7 +7454,7 @@
74107454 moveExtendsSelection = !moveExtendsSelection || (selType != selStream);
74117455 selType = selStream;
74127456 }
7413- InvalidateSelection(currentPos, anchor);
7457+ InvalidateSelection(currentPos, anchor, true);
74147458 }
74157459 case SCI_GETSELECTIONMODE:
74167460 switch (selType) {
--- trunk/src/Utils/scintilla/src/Editor.h (revision 12674)
+++ trunk/src/Utils/scintilla/src/Editor.h (revision 12675)
@@ -54,16 +54,17 @@
5454 char *s;
5555 int len;
5656 bool rectangular;
57+ bool lineCopy;
5758 int codePage;
5859 int characterSet;
59- SelectionText() : s(0), len(0), rectangular(false), codePage(0), characterSet(0) {}
60+ SelectionText() : s(0), len(0), rectangular(false), lineCopy(false), codePage(0), characterSet(0) {}
6061 ~SelectionText() {
6162 Free();
6263 }
6364 void Free() {
64- Set(0, 0, 0, 0, false);
65+ Set(0, 0, 0, 0, false, false);
6566 }
66- void Set(char *s_, int len_, int codePage_, int characterSet_, bool rectangular_) {
67+ void Set(char *s_, int len_, int codePage_, int characterSet_, bool rectangular_, bool lineCopy_) {
6768 delete []s;
6869 s = s_;
6970 if (s)
@@ -73,8 +74,9 @@
7374 codePage = codePage_;
7475 characterSet = characterSet_;
7576 rectangular = rectangular_;
77+ lineCopy = lineCopy_;
7678 }
77- void Copy(const char *s_, int len_, int codePage_, int characterSet_, bool rectangular_) {
79+ void Copy(const char *s_, int len_, int codePage_, int characterSet_, bool rectangular_, bool lineCopy_) {
7880 delete []s;
7981 s = new char[len_];
8082 if (s) {
@@ -88,9 +90,10 @@
8890 codePage = codePage_;
8991 characterSet = characterSet_;
9092 rectangular = rectangular_;
93+ lineCopy = lineCopy_;
9194 }
9295 void Copy(const SelectionText &other) {
93- Copy(other.s, other.len, other.codePage, other.characterSet, other.rectangular);
96+ Copy(other.s, other.len, other.codePage, other.characterSet, other.rectangular, other.lineCopy);
9497 }
9598 };
9699
@@ -276,7 +279,7 @@
276279 int SelectionStart();
277280 int SelectionEnd();
278281 void SetRectangularRange();
279- void InvalidateSelection(int currentPos_, int anchor_);
282+ void InvalidateSelection(int currentPos_, int anchor_, bool invalidateWholeSelection);
280283 void SetSelection(int currentPos_, int anchor_);
281284 void SetSelection(int currentPos_);
282285 void SetEmptySelection(int currentPos_);
@@ -342,6 +345,7 @@
342345 void Cut();
343346 void PasteRectangular(int pos, const char *ptr, int len);
344347 virtual void Copy() = 0;
348+ virtual void CopyAllowLine();
345349 virtual bool CanPaste();
346350 virtual void Paste() = 0;
347351 void Clear();
@@ -356,7 +360,6 @@
356360 virtual void NotifyFocus(bool focus);
357361 virtual int GetCtrlID() { return ctrlID; }
358362 virtual void NotifyParent(SCNotification scn) = 0;
359- virtual void NotifyParent(SCNotification * scn) = 0;
360363 virtual void NotifyStyleToNeeded(int endStyleNeeded);
361364 void NotifyChar(int ch);
362365 void NotifyMove(int position);
@@ -407,8 +410,8 @@
407410
408411 virtual void CopyToClipboard(const SelectionText &selectedText) = 0;
409412 char *CopyRange(int start, int end);
410- void CopySelectionFromRange(SelectionText *ss, int start, int end);
411- void CopySelectionRange(SelectionText *ss);
413+ void CopySelectionFromRange(SelectionText *ss, bool allowLineCopy, int start, int end);
414+ void CopySelectionRange(SelectionText *ss, bool allowLineCopy=false);
412415 void CopyRangeToClipboard(int start, int end);
413416 void CopyText(int length, const char *text);
414417 void SetDragPosition(int newPos);
@@ -461,6 +464,8 @@
461464 void StyleSetMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
462465 sptr_t StyleGetMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
463466
467+ static const char *StringFromEOLMode(int eolMode);
468+
464469 public:
465470 // Public so the COM thunks can access it.
466471 bool IsUnicodeMode() const;
--- trunk/src/Utils/scintilla/src/KeyWords.cxx (revision 12674)
+++ trunk/src/Utils/scintilla/src/KeyWords.cxx (revision 12675)
@@ -187,6 +187,7 @@
187187 LINK_LEXER(lmLot);
188188 LINK_LEXER(lmLout);
189189 LINK_LEXER(lmLua);
190+ LINK_LEXER(lmMagikSF);
190191 LINK_LEXER(lmMake);
191192 LINK_LEXER(lmMatlab);
192193 LINK_LEXER(lmMETAPOST);
@@ -204,6 +205,7 @@
204205 LINK_LEXER(lmPHPSCRIPT);
205206 LINK_LEXER(lmPLM);
206207 LINK_LEXER(lmPOV);
208+ LINK_LEXER(lmPowerShell);
207209 LINK_LEXER(lmProgress);
208210 LINK_LEXER(lmProps);
209211 LINK_LEXER(lmPS);
--- trunk/src/Utils/scintilla/src/LexCPP.cxx (revision 12674)
+++ trunk/src/Utils/scintilla/src/LexCPP.cxx (revision 12675)
@@ -424,7 +424,9 @@
424424 levelNext--;
425425 }
426426 }
427- if (atEOL) {
427+ if (!IsASpace(ch))
428+ visibleChars++;
429+ if (atEOL || (i == endPos-1)) {
428430 int levelUse = levelCurrent;
429431 if (foldAtElse) {
430432 levelUse = levelMinCurrent;
@@ -442,8 +444,6 @@
442444 levelMinCurrent = levelCurrent;
443445 visibleChars = 0;
444446 }
445- if (!IsASpace(ch))
446- visibleChars++;
447447 }
448448 }
449449
--- trunk/src/Utils/scintilla/src/LexGen.py (revision 12674)
+++ trunk/src/Utils/scintilla/src/LexGen.py (revision 12675)
@@ -42,195 +42,195 @@
4242 # The part between \( and \) is repeated for each item in the list.
4343 # \* is replaced by each list item. \t, and \n are tab and newline.
4444 def CopyWithInsertion(input, commentPrefix, retainDefs, eolType, *lists):
45- copying = 1
46- listid = 0
47- output = []
48- for line in input.splitlines(0):
49- isStartGenerated = line.startswith(commentPrefix + "++Autogenerated")
50- if copying and not isStartGenerated:
51- output.append(line)
52- if isStartGenerated:
53- if retainDefs:
54- output.append(line)
55- copying = 0
56- definition = ""
57- elif not copying and line.startswith(commentPrefix + "**"):
58- if retainDefs:
59- output.append(line)
60- definition = line[len(commentPrefix + "**"):]
61- listid = 0
62- if definition[0] in string.digits:
63- listid = int(definition[:1])
64- definition = definition[2:]
65- # Hide double slashes as a control character
66- definition = definition.replace("\\\\", "\001")
67- # Do some normal C style transforms
68- definition = definition.replace("\\n", "\n")
69- definition = definition.replace("\\t", "\t")
70- # Get the doubled backslashes back as single backslashes
71- definition = definition.replace("\001", "\\")
72- startRepeat = definition.find("\\(")
73- endRepeat = definition.find("\\)")
74- intro = definition[:startRepeat]
75- out = ""
76- if intro.endswith("\n"):
77- pos = 0
78- else:
79- pos = len(intro)
80- out += intro
81- middle = definition[startRepeat+2:endRepeat]
82- for i in lists[listid]:
83- item = middle.replace("\\*", i)
84- if pos and (pos + len(item) >= 80):
85- out += "\\\n"
86- pos = 0
87- out += item
88- pos += len(item)
89- if item.endswith("\n"):
90- pos = 0
91- outro = definition[endRepeat+2:]
92- out += outro
93- out = out.replace("\n", eolType) # correct EOLs in generated content
94- output.append(out)
95- elif line.startswith(commentPrefix + "--Autogenerated"):
96- copying = 1
97- if retainDefs:
98- output.append(line)
99- output = [line.rstrip(" \t") for line in output] # trim trailing whitespace
100- return eolType.join(output) + eolType
45+ copying = 1
46+ listid = 0
47+ output = []
48+ for line in input.splitlines(0):
49+ isStartGenerated = line.startswith(commentPrefix + "++Autogenerated")
50+ if copying and not isStartGenerated:
51+ output.append(line)
52+ if isStartGenerated:
53+ if retainDefs:
54+ output.append(line)
55+ copying = 0
56+ definition = ""
57+ elif not copying and line.startswith(commentPrefix + "**"):
58+ if retainDefs:
59+ output.append(line)
60+ definition = line[len(commentPrefix + "**"):]
61+ listid = 0
62+ if definition[0] in string.digits:
63+ listid = int(definition[:1])
64+ definition = definition[2:]
65+ # Hide double slashes as a control character
66+ definition = definition.replace("\\\\", "\001")
67+ # Do some normal C style transforms
68+ definition = definition.replace("\\n", "\n")
69+ definition = definition.replace("\\t", "\t")
70+ # Get the doubled backslashes back as single backslashes
71+ definition = definition.replace("\001", "\\")
72+ startRepeat = definition.find("\\(")
73+ endRepeat = definition.find("\\)")
74+ intro = definition[:startRepeat]
75+ out = ""
76+ if intro.endswith("\n"):
77+ pos = 0
78+ else:
79+ pos = len(intro)
80+ out += intro
81+ middle = definition[startRepeat+2:endRepeat]
82+ for i in lists[listid]:
83+ item = middle.replace("\\*", i)
84+ if pos and (pos + len(item) >= 80):
85+ out += "\\\n"
86+ pos = 0
87+ out += item
88+ pos += len(item)
89+ if item.endswith("\n"):
90+ pos = 0
91+ outro = definition[endRepeat+2:]
92+ out += outro
93+ out = out.replace("\n", eolType) # correct EOLs in generated content
94+ output.append(out)
95+ elif line.startswith(commentPrefix + "--Autogenerated"):
96+ copying = 1
97+ if retainDefs:
98+ output.append(line)
99+ output = [line.rstrip(" \t") for line in output] # trim trailing whitespace
100+ return eolType.join(output) + eolType
101101
102102 def UpdateFile(filename, updated):
103- """ If the file is different to updated then copy updated
104- into the file else leave alone so CVS and make don't treat
105- it as modified. """
106- try:
107- infile = open(filename, "rb")
108- except IOError: # File is not there yet
109- out = open(filename, "wb")
110- out.write(updated)
111- out.close()
112- print "New", filename
113- return
114- original = infile.read()
115- infile.close()
116- if updated != original:
117- os.unlink(filename)
118- out = open(filename, "wb")
119- out.write(updated)
120- out.close()
121- print "Changed", filename
122- #~ else:
123- #~ print "Unchanged", filename
103+ """ If the file is different to updated then copy updated
104+ into the file else leave alone so CVS and make don't treat
105+ it as modified. """
106+ try:
107+ infile = open(filename, "rb")
108+ except IOError: # File is not there yet
109+ out = open(filename, "wb")
110+ out.write(updated)
111+ out.close()
112+ print "New", filename
113+ return
114+ original = infile.read()
115+ infile.close()
116+ if updated != original:
117+ os.unlink(filename)
118+ out = open(filename, "wb")
119+ out.write(updated)
120+ out.close()
121+ print "Changed", filename
122+ #~ else:
123+ #~ print "Unchanged", filename
124124
125125 def Generate(inpath, outpath, commentPrefix, eolType, *lists):
126- """Generate 'outpath' from 'inpath'.
126+ """Generate 'outpath' from 'inpath'.
127127
128- "eolType" indicates the type of EOLs to use in the generated
129- file. It should be one of following constants: LF, CRLF,
130- CR, or NATIVE.
131- """
132- #print "generate '%s' -> '%s' (comment prefix: %r, eols: %r)"\
133- # % (inpath, outpath, commentPrefix, eolType)
134- try:
135- infile = open(inpath, "r")
136- except IOError:
137- print "Can not open", inpath
138- return
139- original = infile.read()
140- infile.close()
141- updated = CopyWithInsertion(original, commentPrefix,
142- inpath == outpath, eolType, *lists)
143- UpdateFile(outpath, updated)
128+ "eolType" indicates the type of EOLs to use in the generated
129+ file. It should be one of following constants: LF, CRLF,
130+ CR, or NATIVE.
131+ """
132+ #print "generate '%s' -> '%s' (comment prefix: %r, eols: %r)"\
133+ # % (inpath, outpath, commentPrefix, eolType)
134+ try:
135+ infile = open(inpath, "r")
136+ except IOError:
137+ print "Can not open", inpath
138+ return
139+ original = infile.read()
140+ infile.close()
141+ updated = CopyWithInsertion(original, commentPrefix,
142+ inpath == outpath, eolType, *lists)
143+ UpdateFile(outpath, updated)
144144
145145 def Regenerate(filename, commentPrefix, eolType, *lists):
146- """Regenerate the given file.
146+ """Regenerate the given file.
147147
148- "eolType" indicates the type of EOLs to use in the generated
149- file. It should be one of following constants: LF, CRLF,
150- CR, or NATIVE.
151- """
152- Generate(filename, filename, commentPrefix, eolType, *lists)
148+ "eolType" indicates the type of EOLs to use in the generated
149+ file. It should be one of following constants: LF, CRLF,
150+ CR, or NATIVE.
151+ """
152+ Generate(filename, filename, commentPrefix, eolType, *lists)
153153
154154 def FindModules(lexFile):
155- modules = []
156- f = open(lexFile)
157- for l in f.readlines():
158- if l.startswith("LexerModule"):
159- l = l.replace("(", " ")
160- modules.append(l.split()[1])
161- return modules
155+ modules = []
156+ f = open(lexFile)
157+ for l in f.readlines():
158+ if l.startswith("LexerModule"):
159+ l = l.replace("(", " ")
160+ modules.append(l.split()[1])
161+ return modules
162162
163163 knownIrregularProperties = [
164- "fold",
165- "styling.within.preprocessor",
166- "tab.timmy.whinge.level",
167- "asp.default.language",
168- "html.tags.case.sensitive",
169- "ps.level",
170- "ps.tokenize",
171- "sql.backslash.escapes",
172- "nsis.uservars",
173- "nsis.ignorecase"
164+ "fold",
165+ "styling.within.preprocessor",
166+ "tab.timmy.whinge.level",
167+ "asp.default.language",
168+ "html.tags.case.sensitive",
169+ "ps.level",
170+ "ps.tokenize",
171+ "sql.backslash.escapes",
172+ "nsis.uservars",
173+ "nsis.ignorecase"
174174 ]
175175
176176 def FindProperties(lexFile):
177- properties = set()
178- f = open(lexFile)
179- for l in f.readlines():
180- if "GetProperty" in l:
181- l = l.strip()
182- if not l.startswith("//"): # Drop comments
183- propertyName = l.split("\"")[1]
184- if propertyName.lower() == propertyName:
185- # Only allow lower case property names
186- if propertyName in knownIrregularProperties or \
187- propertyName.startswith("fold.") or \
188- propertyName.startswith("lexer."):
189- properties.add(propertyName)
190- return properties
177+ properties = set()
178+ f = open(lexFile)
179+ for l in f.readlines():
180+ if "GetProperty" in l:
181+ l = l.strip()
182+ if not l.startswith("//"): # Drop comments
183+ propertyName = l.split("\"")[1]
184+ if propertyName.lower() == propertyName:
185+ # Only allow lower case property names
186+ if propertyName in knownIrregularProperties or \
187+ propertyName.startswith("fold.") or \
188+ propertyName.startswith("lexer."):
189+ properties.add(propertyName)
190+ return properties
191191
192192 def ciCompare(a,b):
193- return cmp(a.lower(), b.lower())
193+ return cmp(a.lower(), b.lower())
194194
195195 def RegenerateAll():
196- root="../../"
196+ root="../../"
197197
198- # Find all the lexer source code files
199- lexFilePaths = glob.glob(root + "scintilla/src/Lex*.cxx")
200- lexFiles = [os.path.basename(f)[:-4] for f in lexFilePaths]
201- print lexFiles
202- lexerModules = []
203- lexerProperties = set()
204- for lexFile in lexFilePaths:
205- lexerModules.extend(FindModules(lexFile))
206- lexerProperties.update(FindProperties(lexFile))
207- lexerModules.sort(ciCompare)
208- lexerProperties.remove("fold.comment.python")
209- lexerProperties = list(lexerProperties)
210- lexerProperties.sort(ciCompare)
198+ # Find all the lexer source code files
199+ lexFilePaths = glob.glob(root + "scintilla/src/Lex*.cxx")
200+ lexFiles = [os.path.basename(f)[:-4] for f in lexFilePaths]
201+ print lexFiles
202+ lexerModules = []
203+ lexerProperties = set()
204+ for lexFile in lexFilePaths:
205+ lexerModules.extend(FindModules(lexFile))
206+ lexerProperties.update(FindProperties(lexFile))
207+ lexerModules.sort(ciCompare)
208+ lexerProperties.remove("fold.comment.python")
209+ lexerProperties = list(lexerProperties)
210+ lexerProperties.sort(ciCompare)
211211
212- # Find all the SciTE properties files
213- otherProps = ["abbrev.properties", "Embedded.properties", "SciTEGlobal.properties", "SciTE.properties"]
214- if os.path.exists(root + "scite"):
215- propFilePaths = glob.glob(root + "scite/src/*.properties")
216- propFiles = [os.path.basename(f) for f in propFilePaths if os.path.basename(f) not in otherProps]
217- propFiles.sort(ciCompare)
218- print propFiles
212+ # Find all the SciTE properties files
213+ otherProps = ["abbrev.properties", "Embedded.properties", "SciTEGlobal.properties", "SciTE.properties"]
214+ if os.path.exists(root + "scite"):
215+ propFilePaths = glob.glob(root + "scite/src/*.properties")
216+ propFiles = [os.path.basename(f) for f in propFilePaths if os.path.basename(f) not in otherProps]
217+ propFiles.sort(ciCompare)
218+ print propFiles
219219
220- Regenerate(root + "scintilla/src/KeyWords.cxx", "//", NATIVE, lexerModules)
221- Regenerate(root + "scintilla/win32/makefile", "#", NATIVE, lexFiles)
222- Regenerate(root + "scintilla/win32/scintilla.mak", "#", NATIVE, lexFiles)
223- Regenerate(root + "scintilla/win32/scintilla_vc6.mak", "#", NATIVE, lexFiles)
224- # Use Unix EOLs for gtk Makefiles so they work for Linux users when
225- # extracted from the Scintilla source ZIP (typically created on
226- # Windows).
227- Regenerate(root + "scintilla/gtk/makefile", "#", LF, lexFiles)
228- Regenerate(root + "scintilla/gtk/scintilla.mak", "#", NATIVE, lexFiles)
229- Regenerate(root + "scintilla/macosx/makefile", "#", LF, lexFiles)
230- if os.path.exists(root + "scite"):
231- Regenerate(root + "scite/win32/makefile", "#", NATIVE, lexFiles, propFiles)
232- Regenerate(root + "scite/win32/scite.mak", "#", NATIVE, lexFiles, propFiles)
233- Generate(root + "scite/boundscheck/vcproj.gen",
234- root + "scite/boundscheck/SciTE.vcproj", "#", NATIVE, lexFiles)
220+ Regenerate(root + "scintilla/src/KeyWords.cxx", "//", NATIVE, lexerModules)
221+ Regenerate(root + "scintilla/win32/makefile", "#", NATIVE, lexFiles)
222+ Regenerate(root + "scintilla/win32/scintilla.mak", "#", NATIVE, lexFiles)
223+ Regenerate(root + "scintilla/win32/scintilla_vc6.mak", "#", NATIVE, lexFiles)
224+ # Use Unix EOLs for gtk Makefiles so they work for Linux users when
225+ # extracted from the Scintilla source ZIP (typically created on
226+ # Windows).
227+ Regenerate(root + "scintilla/gtk/makefile", "#", LF, lexFiles)
228+ Regenerate(root + "scintilla/gtk/scintilla.mak", "#", NATIVE, lexFiles)
229+ Regenerate(root + "scintilla/macosx/makefile", "#", LF, lexFiles)
230+ if os.path.exists(root + "scite"):
231+ Regenerate(root + "scite/win32/makefile", "#", NATIVE, lexFiles, propFiles)
232+ Regenerate(root + "scite/win32/scite.mak", "#", NATIVE, lexFiles, propFiles)
233+ Generate(root + "scite/boundscheck/vcproj.gen",
234+ root + "scite/boundscheck/SciTE.vcproj", "#", NATIVE, lexFiles)
235235
236236 RegenerateAll()
--- trunk/src/Utils/scintilla/src/LexMagik.cxx (nonexistent)
+++ trunk/src/Utils/scintilla/src/LexMagik.cxx (revision 12675)
@@ -0,0 +1,445 @@
1+// Scintilla source code edit control
2+/**
3+ * @file LexMagik.cxx
4+ * Lexer for GE(r) Smallworld(tm) MagikSF
5+ */
6+// Copyright 1998-2005 by Neil Hodgson <neilh@scintilla.org>
7+// The License.txt file describes the conditions under which this software may be distributed.
8+
9+#include <stdlib.h>
10+#include <string.h>
11+#include <ctype.h>
12+#include <stdio.h>
13+#include <stdarg.h>
14+
15+#include "Platform.h"
16+
17+#include "PropSet.h"
18+#include "Accessor.h"
19+#include "StyleContext.h"
20+#include "KeyWords.h"
21+#include "Scintilla.h"
22+#include "SciLexer.h"
23+
24+#ifdef SCI_NAMESPACE
25+using namespace Scintilla;
26+#endif
27+
28+/**
29+ * Is it a core character (C isalpha(), exclamation and question mark)
30+ *
31+ * \param ch The character
32+ * \return True if ch is a character, False otherwise
33+ */
34+static inline bool IsAlphaCore(int ch) {
35+ return (isalpha(ch) || ch == '!' || ch == '?');
36+}
37+
38+/**
39+ * Is it a character (IsAlphaCore() and underscore)
40+ *
41+ * \param ch The character
42+ * \return True if ch is a character, False otherwise
43+ */
44+static inline bool IsAlpha(int ch) {
45+ return (IsAlphaCore(ch) || ch == '_');
46+}
47+
48+/**
49+ * Is it a symbolic character (IsAlpha() and colon)
50+ *
51+ * \param ch The character
52+ * \return True if ch is a character, False otherwise
53+ */
54+static inline bool IsAlphaSym(int ch) {
55+ return (IsAlpha(ch) || ch == ':');
56+}
57+
58+/**
59+ * Is it a numerical character (IsAlpha() and 0 - 9)
60+ *
61+ * \param ch The character
62+ * \return True if ch is a character, False otherwise
63+ */
64+static inline bool IsAlNum(int ch) {
65+ return ((ch > '0' && ch < '9') || IsAlpha(ch));
66+}
67+
68+/**
69+ * Is it a symbolic numerical character (IsAlNum() and colon)
70+ *
71+ * \param ch The character
72+ * \return True if ch is a character, False otherwise
73+ */
74+static inline bool IsAlNumSym(int ch) {
75+ return (IsAlNum(ch) || ch == ':');
76+}
77+
78+/**
79+ * The lexer function
80+ *
81+ * \param startPos Where to start scanning
82+ * \param length Where to scan to
83+ * \param initStyle The style at the initial point, not used in this folder
84+ * \param keywordslists The keywordslists, currently, number 5 is used
85+ * \param styler The styler
86+ */
87+static void ColouriseMagikDoc(unsigned int startPos, int length, int initStyle,
88+ WordList *keywordlists[], Accessor &styler) {
89+ styler.StartAt(startPos);
90+
91+ WordList &keywords = *keywordlists[0];
92+ WordList &pragmatics = *keywordlists[1];
93+ WordList &containers = *keywordlists[2];
94+ WordList &flow = *keywordlists[3];
95+ WordList &characters = *keywordlists[4];
96+
97+ StyleContext sc(startPos, length, initStyle, styler);
98+
99+
100+ for (; sc.More(); sc.Forward()) {
101+
102+ repeat:
103+
104+ if(sc.ch == '#') {
105+ if (sc.chNext == '#') sc.SetState(SCE_MAGIK_HYPER_COMMENT);
106+ else sc.SetState(SCE_MAGIK_COMMENT);
107+ for(; sc.More() && !(sc.atLineEnd); sc.Forward());
108+ sc.SetState(SCE_MAGIK_DEFAULT);
109+ goto repeat;
110+ }
111+
112+ if(sc.ch == '"') {
113+ sc.SetState(SCE_MAGIK_STRING);
114+
115+ if(sc.More())
116+ {
117+ sc.Forward();
118+ for(; sc.More() && sc.ch != '"'; sc.Forward());
119+ }
120+
121+ sc.ForwardSetState(SCE_MAGIK_DEFAULT);
122+ goto repeat;
123+ }
124+
125+ // The default state
126+ if(sc.state == SCE_MAGIK_DEFAULT) {
127+
128+ // A certain keyword has been detected
129+ if (sc.ch == '_' && (
130+ sc.currentPos == 0 || !IsAlNum(sc.chPrev))) {
131+ char keyword[50];
132+ memset(keyword, '\0', 50);
133+
134+ for(
135+ int scanPosition = 0;
136+ scanPosition < 50;
137+ scanPosition++) {
138+ char keywordChar = static_cast<char>(
139+ tolower(styler.SafeGetCharAt(
140+ scanPosition +
141+ static_cast<int>(sc.currentPos+1), ' ')));
142+ if(IsAlpha(keywordChar)) {
143+ keyword[scanPosition] = keywordChar;
144+ } else {
145+ break;
146+ }
147+ }
148+
149+ // It is a pragma
150+ if(pragmatics.InList(keyword)) {
151+ sc.SetState(SCE_MAGIK_PRAGMA);
152+ }
153+
154+ // it is a normal keyword like _local, _self, etc.
155+ else if(keywords.InList(keyword)) {
156+ sc.SetState(SCE_MAGIK_KEYWORD);
157+ }
158+
159+ // It is a container keyword, such as _method, _proc, etc.
160+ else if(containers.InList(keyword)) {
161+ sc.SetState(SCE_MAGIK_CONTAINER);
162+ }
163+
164+ // It is a flow keyword, such as _for, _if, _try, etc.
165+ else if(flow.InList(keyword)) {
166+ sc.SetState(SCE_MAGIK_FLOW);
167+ }
168+
169+ // Interpret as unknown keyword
170+ else {
171+ sc.SetState(SCE_MAGIK_UNKNOWN_KEYWORD);
172+ }
173+ }
174+
175+ // Symbolic expression
176+ else if(sc.ch == ':' && !IsAlNum(sc.chPrev)) {
177+ sc.SetState(SCE_MAGIK_SYMBOL);
178+ bool firstTrip = true;
179+ for(sc.Forward(); sc.More(); sc.Forward()) {
180+ if(firstTrip && IsAlphaSym(sc.ch));
181+ else if(!firstTrip && IsAlNumSym(sc.ch));
182+ else if(sc.ch == '|') {
183+ for(sc.Forward();
184+ sc.More() && sc.ch != '|';
185+ sc.Forward());
186+ }
187+ else break;
188+
189+ firstTrip = false;
190+ }
191+ sc.SetState(SCE_MAGIK_DEFAULT);
192+ goto repeat;
193+ }
194+
195+ // Identifier (label) expression
196+ else if(sc.ch == '@') {
197+ sc.SetState(SCE_MAGIK_IDENTIFIER);
198+ bool firstTrip = true;
199+ for(sc.Forward(); sc.More(); sc.Forward()) {
200+ if(firstTrip && IsAlphaCore(sc.ch)) {
201+ firstTrip = false;
202+ }
203+ else if(!firstTrip && IsAlpha(sc.ch));
204+ else break;
205+ }
206+ sc.SetState(SCE_MAGIK_DEFAULT);
207+ goto repeat;
208+ }
209+
210+ // Start of a character
211+ else if(sc.ch == '%') {
212+ sc.SetState(SCE_MAGIK_CHARACTER);
213+ sc.Forward();
214+ char keyword[50];
215+ memset(keyword, '\0', 50);
216+
217+ for(
218+ int scanPosition = 0;
219+ scanPosition < 50;
220+ scanPosition++) {
221+ char keywordChar = static_cast<char>(
222+ tolower(styler.SafeGetCharAt(
223+ scanPosition +
224+ static_cast<int>(sc.currentPos), ' ')));
225+ if(IsAlpha(keywordChar)) {
226+ keyword[scanPosition] = keywordChar;
227+ } else {
228+ break;
229+ }
230+ }
231+
232+ if(characters.InList(keyword)) {
233+ sc.Forward(strlen(keyword));
234+ } else {
235+ sc.Forward();
236+ }
237+
238+ sc.SetState(SCE_MAGIK_DEFAULT);
239+ goto repeat;
240+ }
241+
242+ // Operators
243+ else if(
244+ sc.ch == '>' ||
245+ sc.ch == '<' ||
246+ sc.ch == '.' ||
247+ sc.ch == ',' ||
248+ sc.ch == '+' ||
249+ sc.ch == '-' ||
250+ sc.ch == '/' ||
251+ sc.ch == '*' ||
252+ sc.ch == '~' ||
253+ sc.ch == '$' ||
254+ sc.ch == '=') {
255+ sc.SetState(SCE_MAGIK_OPERATOR);
256+ }
257+
258+ // Braces
259+ else if(sc.ch == '(' || sc.ch == ')') {
260+ sc.SetState(SCE_MAGIK_BRACE_BLOCK);
261+ }
262+
263+ // Brackets
264+ else if(sc.ch == '{' || sc.ch == '}') {
265+ sc.SetState(SCE_MAGIK_BRACKET_BLOCK);
266+ }
267+
268+ // Square Brackets
269+ else if(sc.ch == '[' || sc.ch == ']') {
270+ sc.SetState(SCE_MAGIK_SQBRACKET_BLOCK);
271+ }
272+
273+
274+ }
275+
276+ // It is an operator
277+ else if(
278+ sc.state == SCE_MAGIK_OPERATOR ||
279+ sc.state == SCE_MAGIK_BRACE_BLOCK ||
280+ sc.state == SCE_MAGIK_BRACKET_BLOCK ||
281+ sc.state == SCE_MAGIK_SQBRACKET_BLOCK) {
282+ sc.SetState(SCE_MAGIK_DEFAULT);
283+ goto repeat;
284+ }
285+
286+ // It is the pragma state
287+ else if(sc.state == SCE_MAGIK_PRAGMA) {
288+ if(!IsAlpha(sc.ch)) {
289+ sc.SetState(SCE_MAGIK_DEFAULT);
290+ goto repeat;
291+ }
292+ }
293+
294+ // It is the keyword state
295+ else if(
296+ sc.state == SCE_MAGIK_KEYWORD ||
297+ sc.state == SCE_MAGIK_CONTAINER ||
298+ sc.state == SCE_MAGIK_FLOW ||
299+ sc.state == SCE_MAGIK_UNKNOWN_KEYWORD) {
300+ if(!IsAlpha(sc.ch)) {
301+ sc.SetState(SCE_MAGIK_DEFAULT);
302+ goto repeat;
303+ }
304+ }
305+ }
306+
307+ sc.Complete();
308+}
309+
310+/**
311+ * The word list description
312+ */
313+static const char * const magikWordListDesc[] = {
314+ "Accessors (local, global, self, super, thisthread)",
315+ "Pragmatic (pragma, private)",
316+ "Containers (method, block, proc)",
317+ "Flow (if, then, elif, else)",
318+ "Characters (space, tab, newline, return)",
319+ "Fold Containers (method, proc, block, if, loop)",
320+ 0};
321+
322+/**
323+ * This function detects keywords which are able to have a body. Note that it
324+ * uses the Fold Containers word description, not the containers description. It
325+ * only works when the style at that particular position is set on Containers
326+ * or Flow (number 3 or 4).
327+ *
328+ * \param keywordslist The list of keywords that are scanned, they should only
329+ * contain the start keywords, not the end keywords
330+ * \param The actual keyword
331+ * \return 1 if it is a folding start-keyword, -1 if it is a folding end-keyword
332+ * 0 otherwise
333+ */
334+static inline int IsFoldingContainer(WordList &keywordslist, char * keyword) {
335+ if(
336+ strlen(keyword) > 3 &&
337+ keyword[0] == 'e' && keyword[1] == 'n' && keyword[2] == 'd') {
338+ if (keywordslist.InList(keyword + 3)) {
339+ return -1;
340+ }
341+
342+ } else {
343+ if(keywordslist.InList(keyword)) {
344+ return 1;
345+ }
346+ }
347+
348+ return 0;
349+}
350+
351+/**
352+ * The folding function
353+ *
354+ * \param startPos Where to start scanning
355+ * \param length Where to scan to
356+ * \param keywordslists The keywordslists, currently, number 5 is used
357+ * \param styler The styler
358+ */
359+static void FoldMagikDoc(unsigned int startPos, int length, int,
360+ WordList *keywordslists[], Accessor &styler) {
361+
362+ bool compact = styler.GetPropertyInt("fold.compact") != 0;
363+
364+ WordList &foldingElements = *keywordslists[5];
365+ int endPos = startPos + length;
366+ int line = styler.GetLine(startPos);
367+ int level = styler.LevelAt(line) & SC_FOLDLEVELNUMBERMASK;
368+ int flags = styler.LevelAt(line) & ~SC_FOLDLEVELNUMBERMASK;
369+
370+ for(
371+ int currentPos = startPos;
372+ currentPos < endPos;
373+ currentPos++) {
374+ char currentState = styler.StyleAt(currentPos);
375+ char c = styler.SafeGetCharAt(currentPos, ' ');
376+ int prevLine = styler.GetLine(currentPos - 1);
377+ line = styler.GetLine(currentPos);
378+
379+ // Default situation
380+ if(prevLine < line) {
381+ styler.SetLevel(line, (level|flags) & ~SC_FOLDLEVELHEADERFLAG);
382+ flags = styler.LevelAt(line) & ~SC_FOLDLEVELNUMBERMASK;
383+ }
384+
385+ if(
386+ (
387+ currentState == SCE_MAGIK_CONTAINER ||
388+ currentState == SCE_MAGIK_FLOW
389+ ) &&
390+ c == '_') {
391+
392+ char keyword[50];
393+ memset(keyword, '\0', 50);
394+
395+ for(
396+ int scanPosition = 0;
397+ scanPosition < 50;
398+ scanPosition++) {
399+ char keywordChar = static_cast<char>(
400+ tolower(styler.SafeGetCharAt(
401+ scanPosition +
402+ currentPos + 1, ' ')));
403+ if(IsAlpha(keywordChar)) {
404+ keyword[scanPosition] = keywordChar;
405+ } else {
406+ break;
407+ }
408+ }
409+
410+ if(IsFoldingContainer(foldingElements, keyword) > 0) {
411+ styler.SetLevel(
412+ line,
413+ styler.LevelAt(line) | SC_FOLDLEVELHEADERFLAG);
414+ level++;
415+ } else if(IsFoldingContainer(foldingElements, keyword) < 0) {
416+ styler.SetLevel(line, styler.LevelAt(line));
417+ level--;
418+ }
419+ }
420+
421+ if(
422+ compact && (
423+ currentState == SCE_MAGIK_BRACE_BLOCK ||
424+ currentState == SCE_MAGIK_BRACKET_BLOCK ||
425+ currentState == SCE_MAGIK_SQBRACKET_BLOCK)) {
426+ if(c == '{' || c == '[' || c == '(') {
427+ styler.SetLevel(
428+ line,
429+ styler.LevelAt(line) | SC_FOLDLEVELHEADERFLAG);
430+ level++;
431+ } else if(c == '}' || c == ']' || c == ')') {
432+ styler.SetLevel(line, styler.LevelAt(line));
433+ level--;
434+ }
435+ }
436+ }
437+
438+}
439+
440+/**
441+ * Injecting the module
442+ */
443+LexerModule lmMagikSF(
444+ SCLEX_MAGIK, ColouriseMagikDoc, "magiksf", FoldMagikDoc, magikWordListDesc);
445+
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
--- trunk/src/Utils/scintilla/src/LexMatlab.cxx (revision 12674)
+++ trunk/src/Utils/scintilla/src/LexMatlab.cxx (revision 12675)
@@ -128,7 +128,7 @@
128128 if (sc.state == SCE_MATLAB_DEFAULT) {
129129 if (IsCommentChar(sc.ch)) {
130130 sc.SetState(SCE_MATLAB_COMMENT);
131- } else if (sc.ch == '!') {
131+ } else if (sc.ch == '!' && sc.chNext != '=' ) {
132132 sc.SetState(SCE_MATLAB_COMMAND);
133133 } else if (sc.ch == '\'') {
134134 if (transpose) {
--- trunk/src/Utils/scintilla/src/LexPerl.cxx (revision 12674)
+++ trunk/src/Utils/scintilla/src/LexPerl.cxx (revision 12675)
@@ -2,7 +2,7 @@
22 /** @file LexPerl.cxx
33 ** Lexer for subset of Perl.
44 **/
5-// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
5+// Copyright 1998-2008 by Neil Hodgson <neilh@scintilla.org>
66 // Lexical analysis fixes by Kein-Hong Man <mkh@pl.jaring.my>
77 // The License.txt file describes the conditions under which this software may be distributed.
88
@@ -666,8 +666,9 @@
666666 }
667667 } else {
668668 // bare identifier, if '/', /PATTERN/ unless digit/space immediately after '/'
669+ // if '//', always expect defined-or operator to follow identifier
669670 if (!isHereDoc &&
670- (isspacechar(chNext) || isdigit(chNext)))
671+ (isspacechar(chNext) || isdigit(chNext) || chNext == '/'))
671672 preferRE = false;
672673 // HERE docs cannot have a space after the >>
673674 if (isspacechar(chNext))
@@ -688,6 +689,7 @@
688689 // adopt heuristics similar to vim-style rules:
689690 // keywords always forced as /PATTERN/: split, if, elsif, while
690691 // everything else /PATTERN/ unless digit/space immediately after '/'
692+ // for '//', defined-or favoured unless special keywords
691693 bkend = bk + 1;
692694 while (bk > 0 && styler.StyleAt(bk-1) == SCE_PL_WORD) {
693695 bk--;
@@ -694,7 +696,7 @@
694696 }
695697 if (isPerlKeyword(bk, bkend, reWords, styler))
696698 break;
697- if (isspacechar(chNext) || isdigit(chNext))
699+ if (isspacechar(chNext) || isdigit(chNext) || chNext == '/')
698700 preferRE = false;
699701 break;
700702 // other styles uses the default, preferRE=false
@@ -724,7 +726,12 @@
724726 state = SCE_PL_REGEX;
725727 Quote.New(1);
726728 Quote.Open(ch);
727- } else { // / operator
729+ } else { // / and // operators
730+ if (chNext == '/') {
731+ i++;
732+ ch = chNext;
733+ chNext = chNext2;
734+ }
728735 goto handleOperator;
729736 }
730737 }
--- trunk/src/Utils/scintilla/src/LexPowerShell.cxx (nonexistent)
+++ trunk/src/Utils/scintilla/src/LexPowerShell.cxx (revision 12675)
@@ -0,0 +1,175 @@
1+// Scintilla source code edit control
2+/** @file LexPowerShell.cxx
3+ ** Lexer for PowerShell scripts.
4+ **/
5+// Copyright 2008 by Tim Gerundt <tim@gerundt.de>
6+// The License.txt file describes the conditions under which this software may be distributed.
7+
8+#include <stdlib.h>
9+#include <string.h>
10+#include <ctype.h>
11+#include <stdio.h>
12+#include <stdarg.h>
13+
14+#include "Platform.h"
15+
16+#include "PropSet.h"
17+#include "Accessor.h"
18+#include "StyleContext.h"
19+#include "KeyWords.h"
20+#include "Scintilla.h"
21+#include "SciLexer.h"
22+
23+#ifdef SCI_NAMESPACE
24+using namespace Scintilla;
25+#endif
26+
27+// Extended to accept accented characters
28+static inline bool IsAWordChar(int ch) {
29+ return ch >= 0x80 || isalnum(ch) || ch == '-';
30+}
31+
32+static void ColourisePowerShellDoc(unsigned int startPos, int length, int initStyle,
33+ WordList *keywordlists[], Accessor &styler) {
34+
35+ WordList &keywords = *keywordlists[0];
36+ WordList &keywords2 = *keywordlists[1];
37+ WordList &keywords3 = *keywordlists[2];
38+
39+ styler.StartAt(startPos);
40+
41+ StyleContext sc(startPos, length, initStyle, styler);
42+
43+ for (; sc.More(); sc.Forward()) {
44+
45+ if (sc.state == SCE_POWERSHELL_COMMENT) {
46+ if (sc.atLineEnd) {
47+ sc.SetState(SCE_POWERSHELL_DEFAULT);
48+ }
49+ } else if (sc.state == SCE_POWERSHELL_STRING) {
50+ // This is a doubles quotes string
51+ if (sc.ch == '\"') {
52+ sc.ForwardSetState(SCE_POWERSHELL_DEFAULT);
53+ }
54+ } else if (sc.state == SCE_POWERSHELL_CHARACTER) {
55+ // This is a single quote string
56+ if (sc.ch == '\'') {
57+ sc.ForwardSetState(SCE_POWERSHELL_DEFAULT);
58+ }
59+ } else if (sc.state == SCE_POWERSHELL_NUMBER) {
60+ if (!IsADigit(sc.ch)) {
61+ sc.SetState(SCE_POWERSHELL_DEFAULT);
62+ }
63+ } else if (sc.state == SCE_POWERSHELL_VARIABLE) {
64+ if (!IsAWordChar(sc.ch)) {
65+ sc.SetState(SCE_POWERSHELL_DEFAULT);
66+ }
67+ } else if (sc.state == SCE_POWERSHELL_OPERATOR) {
68+ if (!isoperator(static_cast<char>(sc.ch))) {
69+ sc.SetState(SCE_POWERSHELL_DEFAULT);
70+ }
71+ } else if (sc.state == SCE_POWERSHELL_IDENTIFIER) {
72+ if (!IsAWordChar(sc.ch)) {
73+ char s[100];
74+ sc.GetCurrentLowered(s, sizeof(s));
75+
76+ if (keywords.InList(s)) {
77+ sc.ChangeState(SCE_POWERSHELL_KEYWORD);
78+ } else if (keywords2.InList(s)) {
79+ sc.ChangeState(SCE_POWERSHELL_CMDLET);
80+ } else if (keywords3.InList(s)) {
81+ sc.ChangeState(SCE_POWERSHELL_ALIAS);
82+ }
83+ sc.SetState(SCE_POWERSHELL_DEFAULT);
84+ }
85+ }
86+
87+ // Determine if a new state should be entered.
88+ if (sc.state == SCE_POWERSHELL_DEFAULT) {
89+ if (sc.ch == '#') {
90+ sc.SetState(SCE_POWERSHELL_COMMENT);
91+ } else if (sc.ch == '\"') {
92+ sc.SetState(SCE_POWERSHELL_STRING);
93+ } else if (sc.ch == '\'') {
94+ sc.SetState(SCE_POWERSHELL_CHARACTER);
95+ } else if (sc.ch == '$') {
96+ sc.SetState(SCE_POWERSHELL_VARIABLE);
97+ } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
98+ sc.SetState(SCE_POWERSHELL_NUMBER);
99+ } else if (isoperator(static_cast<char>(sc.ch))) {
100+ sc.SetState(SCE_POWERSHELL_OPERATOR);
101+ } else if (IsAWordChar(sc.ch)) {
102+ sc.SetState(SCE_POWERSHELL_IDENTIFIER);
103+ }
104+ }
105+ }
106+ sc.Complete();
107+}
108+
109+// Store both the current line's fold level and the next lines in the
110+// level store to make it easy to pick up with each increment
111+// and to make it possible to fiddle the current level for "} else {".
112+static void FoldPowerShellDoc(unsigned int startPos, int length, int,
113+ WordList *[], Accessor &styler) {
114+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
115+ bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) != 0;
116+ unsigned int endPos = startPos + length;
117+ int visibleChars = 0;
118+ int lineCurrent = styler.GetLine(startPos);
119+ int levelCurrent = SC_FOLDLEVELBASE;
120+ if (lineCurrent > 0)
121+ levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
122+ int levelMinCurrent = levelCurrent;
123+ int levelNext = levelCurrent;
124+ char chNext = styler[startPos];
125+ int styleNext = styler.StyleAt(startPos);
126+ for (unsigned int i = startPos; i < endPos; i++) {
127+ char ch = chNext;
128+ chNext = styler.SafeGetCharAt(i + 1);
129+ int style = styleNext;
130+ styleNext = styler.StyleAt(i + 1);
131+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
132+ if (style == SCE_POWERSHELL_OPERATOR) {
133+ if (ch == '{') {
134+ // Measure the minimum before a '{' to allow
135+ // folding on "} else {"
136+ if (levelMinCurrent > levelNext) {
137+ levelMinCurrent = levelNext;
138+ }
139+ levelNext++;
140+ } else if (ch == '}') {
141+ levelNext--;
142+ }
143+ }
144+ if (!IsASpace(ch))
145+ visibleChars++;
146+ if (atEOL || (i == endPos-1)) {
147+ int levelUse = levelCurrent;
148+ if (foldAtElse) {
149+ levelUse = levelMinCurrent;
150+ }
151+ int lev = levelUse | levelNext << 16;
152+ if (visibleChars == 0 && foldCompact)
153+ lev |= SC_FOLDLEVELWHITEFLAG;
154+ if (levelUse < levelNext)
155+ lev |= SC_FOLDLEVELHEADERFLAG;
156+ if (lev != styler.LevelAt(lineCurrent)) {
157+ styler.SetLevel(lineCurrent, lev);
158+ }
159+ lineCurrent++;
160+ levelCurrent = levelNext;
161+ levelMinCurrent = levelCurrent;
162+ visibleChars = 0;
163+ }
164+ }
165+}
166+
167+static const char * const powershellWordLists[] = {
168+ "Commands",
169+ "Cmdlets",
170+ "Aliases",
171+ 0
172+};
173+
174+LexerModule lmPowerShell(SCLEX_POWERSHELL, ColourisePowerShellDoc, "powershell", FoldPowerShellDoc, powershellWordLists);
175+
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
--- trunk/src/Utils/scintilla/src/LineMarker.cxx (revision 12674)
+++ trunk/src/Utils/scintilla/src/LineMarker.cxx (revision 12675)
@@ -299,6 +299,10 @@
299299 };
300300 surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
301301 fore.allocated, back.allocated);
302+ } else if (markType == SC_MARK_LEFTRECT) {
303+ PRectangle rcLeft = rcWhole;
304+ rcLeft.right = rcLeft.left + 4;
305+ surface->FillRectangle(rcLeft, back.allocated);
302306 } else { // SC_MARK_FULLRECT
303307 surface->FillRectangle(rcWhole, back.allocated);
304308 }
--- trunk/src/Utils/scintilla/src/RunStyles.cxx (revision 12674)
+++ trunk/src/Utils/scintilla/src/RunStyles.cxx (revision 12675)
@@ -77,11 +77,11 @@
7777 styles = NULL;
7878 }
7979
80-int RunStyles::Length() {
80+int RunStyles::Length() const {
8181 return starts->PositionFromPartition(starts->Partitions());
8282 }
8383
84-int RunStyles::ValueAt(int position) {
84+int RunStyles::ValueAt(int position) const {
8585 return styles->ValueAt(starts->PartitionFromPosition(position));
8686 }
8787
--- trunk/src/Utils/scintilla/src/RunStyles.h (revision 12674)
+++ trunk/src/Utils/scintilla/src/RunStyles.h (revision 12675)
@@ -23,8 +23,8 @@
2323 public:
2424 RunStyles();
2525 ~RunStyles();
26- int Length();
27- int ValueAt(int position);
26+ int Length() const;
27+ int ValueAt(int position) const;
2828 int FindNextChange(int position, int end);
2929 int StartRun(int position);
3030 int EndRun(int position);
--- trunk/src/Utils/scintilla/version.txt (revision 12674)
+++ trunk/src/Utils/scintilla/version.txt (revision 12675)
@@ -1 +1 @@
1-175
1+176
--- trunk/src/Utils/scintilla/win32/PlatWin.cxx (revision 12674)
+++ trunk/src/Utils/scintilla/win32/PlatWin.cxx (revision 12675)
@@ -435,7 +435,7 @@
435435 }
436436 bitmap = 0;
437437 if (paletteOld) {
438- // Fonts are not deleted as they are owned by a Palette object
438+ // Palettes are not deleted as they are owned by a Palette object
439439 ::SelectPalette(reinterpret_cast<HDC>(hdc),
440440 reinterpret_cast<HPALETTE>(paletteOld), TRUE);
441441 paletteOld = 0;
--- trunk/src/Utils/scintilla/win32/ScintillaWin.cxx (revision 12674)
+++ trunk/src/Utils/scintilla/win32/ScintillaWin.cxx (revision 12675)
@@ -157,6 +157,7 @@
157157 bool hasOKText;
158158
159159 CLIPFORMAT cfColumnSelect;
160+ CLIPFORMAT cfLineSelect;
160161
161162 HRESULT hrOle;
162163 DropSource ds;
@@ -203,9 +204,9 @@
203204 virtual void NotifyFocus(bool focus);
204205 virtual int GetCtrlID();
205206 virtual void NotifyParent(SCNotification scn);
206- virtual void NotifyParent(SCNotification * scn);
207207 virtual void NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt);
208208 virtual void Copy();
209+ virtual void CopyAllowLine();
209210 virtual bool CanPaste();
210211 virtual void Paste();
211212 virtual void CreateCallTipWindow(PRectangle rc);
@@ -232,7 +233,7 @@
232233 virtual bool GetScrollInfo(int nBar, LPSCROLLINFO lpsi);
233234 void ChangeScrollPos(int barType, int pos);
234235
235- void InsertPasteText(const char *text, int len, int selStart, bool isRectangular);
236+ void InsertPasteText(const char *text, int len, int selStart, bool isRectangular, bool isLine);
236237
237238 public:
238239 // Public for benefit of Scintilla_DirectFunction
@@ -299,6 +300,10 @@
299300 cfColumnSelect = static_cast<CLIPFORMAT>(
300301 ::RegisterClipboardFormat(TEXT("MSDEVColumnSelect")));
301302
303+ // Likewise for line-copy (copies a full line when no text is selected)
304+ cfLineSelect = static_cast<CLIPFORMAT>(
305+ ::RegisterClipboardFormat(TEXT("MSDEVLineSelect")));
306+
302307 hrOle = E_FAIL;
303308
304309 wMain = hwnd;
@@ -1216,13 +1221,6 @@
12161221 GetCtrlID(), reinterpret_cast<LPARAM>(&scn));
12171222 }
12181223
1219-void ScintillaWin::NotifyParent(SCNotification * scn) {
1220- scn->nmhdr.hwndFrom = MainHWND();
1221- scn->nmhdr.idFrom = GetCtrlID();
1222- ::SendMessage(::GetParent(MainHWND()), WM_NOTIFY,
1223- GetCtrlID(), reinterpret_cast<LPARAM>(scn));
1224-}
1225-
12261224 void ScintillaWin::NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt) {
12271225 //Platform::DebugPrintf("ScintillaWin Double click 0\n");
12281226 ScintillaBase::NotifyDoubleClick(pt, shift, ctrl, alt);
@@ -1242,6 +1240,12 @@
12421240 }
12431241 }
12441242
1243+void ScintillaWin::CopyAllowLine() {
1244+ SelectionText selectedText;
1245+ CopySelectionRange(&selectedText, true);
1246+ CopyToClipboard(selectedText);
1247+}
1248+
12451249 bool ScintillaWin::CanPaste() {
12461250 if (!Editor::CanPaste())
12471251 return false;
@@ -1291,22 +1295,32 @@
12911295 }
12921296 };
12931297
1294-void ScintillaWin::InsertPasteText(const char *text, int len, int selStart, bool isRectangular) {
1298+void ScintillaWin::InsertPasteText(const char *text, int len, int selStart, bool isRectangular, bool isLine) {
12951299 if (isRectangular) {
12961300 PasteRectangular(selStart, text, len);
12971301 } else {
1302+ char *convertedText = 0;
12981303 if (convertPastes) {
12991304 // Convert line endings of the paste into our local line-endings mode
1300- char *convertedString = Document::TransformLineEnds(&len, text, len, pdoc->eolMode);
1301- if (pdoc->InsertString(currentPos, convertedString, len)) {
1302- SetEmptySelection(currentPos + len);
1305+ convertedText = Document::TransformLineEnds(&len, text, len, pdoc->eolMode);
1306+ text = convertedText;
1307+ }
1308+ if (isLine) {
1309+ int insertPos = pdoc->LineStart(pdoc->LineFromPosition(currentPos));
1310+ pdoc->InsertString(insertPos, text, len);
1311+ // add the newline if necessary
1312+ if ((len > 0) && (text[len-1] != '\n' && text[len-1] != '\r')) {
1313+ const char *endline = StringFromEOLMode(pdoc->eolMode);
1314+ pdoc->InsertString(insertPos + len, endline, strlen(endline));
1315+ len += strlen(endline);
13031316 }
1304- delete []convertedString;
1305- } else {
1306- if (pdoc->InsertString(currentPos, text, len)) {
1317+ if (currentPos == insertPos) {
13071318 SetEmptySelection(currentPos + len);
13081319 }
1320+ } else if (pdoc->InsertString(currentPos, text, len)) {
1321+ SetEmptySelection(currentPos + len);
13091322 }
1323+ delete []convertedText;
13101324 }
13111325 }
13121326
@@ -1314,6 +1328,7 @@
13141328 if (!::OpenClipboard(MainHWND()))
13151329 return;
13161330 pdoc->BeginUndoAction();
1331+ bool isLine = SelectionEmpty() && (::IsClipboardFormatAvailable(cfLineSelect) != 0);
13171332 ClearSelection();
13181333 int selStart = SelectionStart();
13191334 bool isRectangular = ::IsClipboardFormatAvailable(cfColumnSelect) != 0;
@@ -1348,7 +1363,7 @@
13481363 }
13491364
13501365 if (putf) {
1351- InsertPasteText(putf, len, selStart, isRectangular);
1366+ InsertPasteText(putf, len, selStart, isRectangular, isLine);
13521367 delete []putf;
13531368 }
13541369 }
@@ -1383,11 +1398,11 @@
13831398 delete []uptr;
13841399
13851400 if (putf) {
1386- InsertPasteText(putf, mlen, selStart, isRectangular);
1401+ InsertPasteText(putf, mlen, selStart, isRectangular, isLine);
13871402 delete []putf;
13881403 }
13891404 } else {
1390- InsertPasteText(ptr, len, selStart, isRectangular);
1405+ InsertPasteText(ptr, len, selStart, isRectangular, isLine);
13911406 }
13921407 }
13931408 memSelection.Unlock();
@@ -1879,6 +1894,10 @@
18791894 ::SetClipboardData(cfColumnSelect, 0);
18801895 }
18811896
1897+ if (selectedText.lineCopy) {
1898+ ::SetClipboardData(cfLineSelect, 0);
1899+ }
1900+
18821901 ::CloseClipboard();
18831902 }
18841903
@@ -1942,11 +1961,16 @@
19421961 xPos = scrollWidth;
19431962 break;
19441963 case SB_THUMBPOSITION:
1945- xPos = HiWord(wParam);
1964+ case SB_THUMBTRACK: {
1965+ // Do NOT use wParam, its 16 bit and not enough for very long lines. Its still possible to overflow the 32 bit but you have to try harder =]
1966+ SCROLLINFO si;
1967+ si.cbSize = sizeof(si);
1968+ si.fMask = SIF_TRACKPOS;
1969+ if (GetScrollInfo(SB_HORZ, &si)) {
1970+ xPos = si.nTrackPos;
1971+ }
1972+ }
19461973 break;
1947- case SB_THUMBTRACK:
1948- xPos = HiWord(wParam);
1949- break;
19501974 }
19511975 HorizontalScrollTo(xPos);
19521976 }
Show on old repository browser