2009-07-04 09:19:36 +00:00
|
|
|
A patch to Scintilla 1.79 containing our changes to Scintilla
|
|
|
|
(the column mode editing patch, removing unused lexers and an updated marshallers file).
|
|
|
|
diff -Naurp scintilla_orig/Editor.cxx scintilla/Editor.cxx
|
|
|
|
--- scintilla_orig/Editor.cxx 2009-06-27 08:02:37.000000000 +0200
|
|
|
|
+++ scintilla/Editor.cxx 2009-07-04 09:54:55.000000000 +0200
|
|
|
|
@@ -3509,22 +3509,51 @@ void Editor::AddChar(char ch) {
|
2008-12-06 10:03:16 +00:00
|
|
|
// AddCharUTF inserts an array of bytes which may or may not be in UTF-8.
|
|
|
|
void Editor::AddCharUTF(char *s, unsigned int len, bool treatAsDBCS) {
|
|
|
|
bool wasSelection = currentPos != anchor;
|
|
|
|
- ClearSelection();
|
|
|
|
- bool charReplaceAction = false;
|
|
|
|
- if (inOverstrike && !wasSelection && !RangeContainsProtected(currentPos, currentPos + 1)) {
|
|
|
|
- if (currentPos < (pdoc->Length())) {
|
|
|
|
- if (!IsEOLChar(pdoc->CharAt(currentPos))) {
|
|
|
|
- charReplaceAction = true;
|
|
|
|
- pdoc->BeginUndoAction();
|
|
|
|
- pdoc->DelChar(currentPos);
|
|
|
|
+ if(wasSelection && selType == selRectangle ) {
|
|
|
|
+ int startPos;
|
|
|
|
+ int endPos;
|
|
|
|
+
|
|
|
|
+ int c1 = pdoc->GetColumn(currentPos);
|
|
|
|
+ int c2 = pdoc->GetColumn(anchor);
|
|
|
|
+ int offset = c1 < c2 ? c1 : c2;
|
|
|
|
+
|
|
|
|
+ pdoc->BeginUndoAction();
|
|
|
|
+ SelectionLineIterator lineIterator(this, false);
|
|
|
|
+ while (lineIterator.Iterate()) {
|
|
|
|
+ startPos = lineIterator.startPos;
|
|
|
|
+ endPos = lineIterator.endPos;
|
|
|
|
+
|
|
|
|
+ if(pdoc->GetColumn(endPos) >= offset){
|
|
|
|
+ unsigned int chars = endPos - startPos;
|
|
|
|
+ if (0 != chars) {
|
|
|
|
+ pdoc->DeleteChars(startPos, chars);
|
|
|
|
+ }
|
|
|
|
+ pdoc->InsertString(startPos, s, len);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ anchor += len;
|
|
|
|
+ currentPos += len;
|
|
|
|
+ SetRectangularRange();
|
|
|
|
+ pdoc->EndUndoAction();
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ ClearSelection();
|
|
|
|
+ bool charReplaceAction = false;
|
|
|
|
+ if (inOverstrike && !wasSelection && !RangeContainsProtected(currentPos, currentPos + 1)) {
|
|
|
|
+ if (currentPos < (pdoc->Length())) {
|
|
|
|
+ if (!IsEOLChar(pdoc->CharAt(currentPos))) {
|
|
|
|
+ charReplaceAction = true;
|
|
|
|
+ pdoc->BeginUndoAction();
|
|
|
|
+ pdoc->DelChar(currentPos);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
- }
|
|
|
|
- if (pdoc->InsertString(currentPos, s, len)) {
|
|
|
|
- SetEmptySelection(currentPos + len);
|
|
|
|
- }
|
|
|
|
- if (charReplaceAction) {
|
|
|
|
- pdoc->EndUndoAction();
|
|
|
|
+ if (pdoc->InsertString(currentPos, s, len)) {
|
|
|
|
+ SetEmptySelection(currentPos + len);
|
|
|
|
+ }
|
|
|
|
+ if (charReplaceAction) {
|
|
|
|
+ pdoc->EndUndoAction();
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
// If in wrap mode rewrap current line so EnsureCaretVisible has accurate information
|
|
|
|
if (wrapState != eWrapNone) {
|
2009-07-04 09:19:36 +00:00
|
|
|
@@ -3698,14 +3727,41 @@ bool Editor::CanPaste() {
|
2008-12-06 10:03:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Editor::Clear() {
|
|
|
|
- if (currentPos == anchor) {
|
|
|
|
+ bool wasSelection = currentPos != anchor;
|
|
|
|
+ if(wasSelection && selType == selRectangle ) {
|
|
|
|
+ int startPos;
|
|
|
|
+ int endPos;
|
|
|
|
+
|
|
|
|
+ int c1 = pdoc->GetColumn(currentPos);
|
|
|
|
+ int c2 = pdoc->GetColumn(anchor);
|
|
|
|
+ int offset = c1 < c2 ? c1 : c2;
|
|
|
|
+
|
|
|
|
+ pdoc->BeginUndoAction();
|
|
|
|
+ SelectionLineIterator lineIterator(this, false);
|
|
|
|
+ while (lineIterator.Iterate()) {
|
|
|
|
+ startPos = lineIterator.startPos;
|
|
|
|
+ endPos = lineIterator.endPos;
|
|
|
|
+
|
|
|
|
+ if(pdoc->GetColumn(endPos) >= offset){
|
|
|
|
+ unsigned int chars = endPos - startPos;
|
|
|
|
+ if (0 != chars) {
|
|
|
|
+ pdoc->DeleteChars(startPos, chars);
|
|
|
|
+ } else
|
|
|
|
+ pdoc->DelChar(startPos);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ SetRectangularRange();
|
|
|
|
+ pdoc->EndUndoAction();
|
|
|
|
+
|
|
|
|
+ } else if (currentPos == anchor) {
|
|
|
|
if (!RangeContainsProtected(currentPos, currentPos + 1)) {
|
|
|
|
DelChar();
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
ClearSelection();
|
|
|
|
}
|
|
|
|
- SetEmptySelection(currentPos);
|
|
|
|
+ if( !wasSelection )
|
|
|
|
+ SetEmptySelection(currentPos);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Editor::SelectAll() {
|
2009-07-04 09:19:36 +00:00
|
|
|
@@ -3741,7 +3797,33 @@ void Editor::DelChar() {
|
2008-12-06 10:03:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Editor::DelCharBack(bool allowLineStartDeletion) {
|
|
|
|
- if (currentPos == anchor) {
|
|
|
|
+ bool wasSelection = currentPos != anchor;
|
|
|
|
+ if(wasSelection && selType == selRectangle ) {
|
|
|
|
+ int startPos;
|
|
|
|
+ int endPos;
|
|
|
|
+
|
|
|
|
+ int c1 = pdoc->GetColumn(currentPos);
|
|
|
|
+ int c2 = pdoc->GetColumn(anchor);
|
|
|
|
+ int offset = c1 < c2 ? c1 : c2;
|
|
|
|
+
|
|
|
|
+ pdoc->BeginUndoAction();
|
|
|
|
+ SelectionLineIterator lineIterator(this, false);
|
|
|
|
+ while (lineIterator.Iterate()) {
|
|
|
|
+ startPos = lineIterator.startPos;
|
|
|
|
+ endPos = lineIterator.endPos;
|
|
|
|
+
|
|
|
|
+ if(pdoc->GetColumn(endPos) >= offset){
|
|
|
|
+ unsigned int chars = endPos - startPos;
|
|
|
|
+ if (0 != chars) {
|
|
|
|
+ pdoc->DeleteChars(startPos, chars);
|
|
|
|
+ } else
|
|
|
|
+ pdoc->DelCharBack(startPos);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ SetRectangularRange();
|
|
|
|
+ pdoc->EndUndoAction();
|
|
|
|
+
|
|
|
|
+ } else if (currentPos == anchor) {
|
|
|
|
if (!RangeContainsProtected(currentPos - 1, currentPos)) {
|
|
|
|
int lineCurrentPos = pdoc->LineFromPosition(currentPos);
|
|
|
|
if (allowLineStartDeletion || (pdoc->LineStart(lineCurrentPos) != currentPos)) {
|
2009-07-04 09:19:36 +00:00
|
|
|
diff -Naurp scintilla_orig/KeyWords.cxx scintilla/KeyWords.cxx
|
|
|
|
--- scintilla_orig/KeyWords.cxx 2009-05-15 12:20:26.000000000 +0200
|
|
|
|
+++ scintilla/KeyWords.cxx 2009-07-04 09:55:30.000000000 +0200
|
|
|
|
@@ -141,97 +141,35 @@ int Scintilla_LinkLexers() {
|
2008-12-06 10:03:16 +00:00
|
|
|
|
|
|
|
//++Autogenerated -- run src/LexGen.py to regenerate
|
|
|
|
//**\(\tLINK_LEXER(\*);\n\)
|
|
|
|
- LINK_LEXER(lmAbaqus);
|
2009-05-03 17:49:33 +00:00
|
|
|
LINK_LEXER(lmAda);
|
2008-12-06 10:03:16 +00:00
|
|
|
- LINK_LEXER(lmAns1);
|
|
|
|
- LINK_LEXER(lmAPDL);
|
|
|
|
LINK_LEXER(lmAsm);
|
|
|
|
- LINK_LEXER(lmASY);
|
|
|
|
- LINK_LEXER(lmAU3);
|
|
|
|
- LINK_LEXER(lmAVE);
|
|
|
|
- LINK_LEXER(lmBaan);
|
|
|
|
LINK_LEXER(lmBash);
|
|
|
|
- LINK_LEXER(lmBatch);
|
|
|
|
- LINK_LEXER(lmBlitzBasic);
|
|
|
|
- LINK_LEXER(lmBullant);
|
|
|
|
LINK_LEXER(lmCaml);
|
|
|
|
- LINK_LEXER(lmClw);
|
|
|
|
- LINK_LEXER(lmClwNoCase);
|
2009-05-03 17:49:33 +00:00
|
|
|
LINK_LEXER(lmCmake);
|
|
|
|
- LINK_LEXER(lmCOBOL);
|
2008-12-06 10:03:16 +00:00
|
|
|
- LINK_LEXER(lmConf);
|
|
|
|
LINK_LEXER(lmCPP);
|
|
|
|
- LINK_LEXER(lmCPPNoCase);
|
|
|
|
- LINK_LEXER(lmCsound);
|
|
|
|
LINK_LEXER(lmCss);
|
|
|
|
LINK_LEXER(lmD);
|
|
|
|
LINK_LEXER(lmDiff);
|
|
|
|
- LINK_LEXER(lmEiffel);
|
|
|
|
- LINK_LEXER(lmEiffelkw);
|
|
|
|
- LINK_LEXER(lmErlang);
|
|
|
|
- LINK_LEXER(lmErrorList);
|
|
|
|
- LINK_LEXER(lmESCRIPT);
|
|
|
|
LINK_LEXER(lmF77);
|
|
|
|
- LINK_LEXER(lmFlagShip);
|
|
|
|
- LINK_LEXER(lmForth);
|
|
|
|
LINK_LEXER(lmFortran);
|
2009-05-03 17:49:33 +00:00
|
|
|
LINK_LEXER(lmFreeBasic);
|
2008-12-06 10:03:16 +00:00
|
|
|
- LINK_LEXER(lmGAP);
|
|
|
|
- LINK_LEXER(lmGui4Cli);
|
|
|
|
LINK_LEXER(lmHaskell);
|
|
|
|
LINK_LEXER(lmHTML);
|
|
|
|
- LINK_LEXER(lmInno);
|
|
|
|
- LINK_LEXER(lmKix);
|
|
|
|
LINK_LEXER(lmLatex);
|
|
|
|
- LINK_LEXER(lmLISP);
|
|
|
|
- LINK_LEXER(lmLot);
|
|
|
|
- LINK_LEXER(lmLout);
|
|
|
|
LINK_LEXER(lmLua);
|
|
|
|
- LINK_LEXER(lmMagikSF);
|
|
|
|
LINK_LEXER(lmMake);
|
|
|
|
LINK_LEXER(lmMatlab);
|
|
|
|
- LINK_LEXER(lmMETAPOST);
|
|
|
|
- LINK_LEXER(lmMMIXAL);
|
|
|
|
- LINK_LEXER(lmMSSQL);
|
|
|
|
- LINK_LEXER(lmMySQL);
|
2009-05-03 17:49:33 +00:00
|
|
|
- LINK_LEXER(lmNimrod);
|
2008-12-06 10:03:16 +00:00
|
|
|
- LINK_LEXER(lmNncrontab);
|
2009-05-03 17:49:33 +00:00
|
|
|
LINK_LEXER(lmNsis);
|
2008-12-06 10:03:16 +00:00
|
|
|
LINK_LEXER(lmNull);
|
|
|
|
- LINK_LEXER(lmOctave);
|
|
|
|
- LINK_LEXER(lmOpal);
|
|
|
|
LINK_LEXER(lmPascal);
|
|
|
|
- LINK_LEXER(lmPB);
|
|
|
|
LINK_LEXER(lmPerl);
|
|
|
|
- LINK_LEXER(lmPHPSCRIPT);
|
|
|
|
- LINK_LEXER(lmPLM);
|
|
|
|
LINK_LEXER(lmPo);
|
|
|
|
- LINK_LEXER(lmPOV);
|
2009-05-03 17:49:33 +00:00
|
|
|
- LINK_LEXER(lmPowerPro);
|
2008-12-06 10:03:16 +00:00
|
|
|
- LINK_LEXER(lmPowerShell);
|
|
|
|
- LINK_LEXER(lmProgress);
|
|
|
|
LINK_LEXER(lmProps);
|
|
|
|
- LINK_LEXER(lmPS);
|
|
|
|
- LINK_LEXER(lmPureBasic);
|
|
|
|
LINK_LEXER(lmPython);
|
|
|
|
LINK_LEXER(lmR);
|
|
|
|
- LINK_LEXER(lmREBOL);
|
|
|
|
LINK_LEXER(lmRuby);
|
|
|
|
- LINK_LEXER(lmScriptol);
|
|
|
|
- LINK_LEXER(lmSmalltalk);
|
2009-05-03 17:49:33 +00:00
|
|
|
- LINK_LEXER(lmSML);
|
|
|
|
- LINK_LEXER(lmSorc);
|
2008-12-06 10:03:16 +00:00
|
|
|
- LINK_LEXER(lmSpecman);
|
|
|
|
- LINK_LEXER(lmSpice);
|
|
|
|
LINK_LEXER(lmSQL);
|
2009-05-03 17:49:33 +00:00
|
|
|
- LINK_LEXER(lmTACL);
|
2008-12-06 10:03:16 +00:00
|
|
|
- LINK_LEXER(lmTADS3);
|
2009-05-03 17:49:33 +00:00
|
|
|
- LINK_LEXER(lmTAL);
|
2008-12-06 10:03:16 +00:00
|
|
|
LINK_LEXER(lmTCL);
|
|
|
|
- LINK_LEXER(lmTeX);
|
|
|
|
- LINK_LEXER(lmVB);
|
|
|
|
- LINK_LEXER(lmVBScript);
|
|
|
|
- LINK_LEXER(lmVerilog);
|
|
|
|
LINK_LEXER(lmVHDL);
|
|
|
|
LINK_LEXER(lmXML);
|
|
|
|
LINK_LEXER(lmYAML);
|
2009-07-04 09:19:36 +00:00
|
|
|
diff -Naurp scintilla_orig/scintilla-marshal.c scintilla/scintilla-marshal.c
|
|
|
|
--- scintilla_orig/scintilla-marshal.c 2004-04-04 11:59:37.000000000 +0200
|
|
|
|
+++ scintilla/scintilla-marshal.c 2009-06-21 23:17:08.000000000 +0200
|
2008-12-06 10:03:16 +00:00
|
|
|
@@ -35,8 +35,8 @@
|
|
|
|
#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong
|
|
|
|
#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64
|
|
|
|
#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64
|
|
|
|
-#define g_marshal_value_peek_enum(v) (v)->data[0].v_int
|
|
|
|
-#define g_marshal_value_peek_flags(v) (v)->data[0].v_uint
|
|
|
|
+#define g_marshal_value_peek_enum(v) (v)->data[0].v_long
|
|
|
|
+#define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong
|
|
|
|
#define g_marshal_value_peek_float(v) (v)->data[0].v_float
|
|
|
|
#define g_marshal_value_peek_double(v) (v)->data[0].v_double
|
|
|
|
#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer
|
|
|
|
@@ -50,10 +50,10 @@
|
|
|
|
/* NONE:INT,POINTER (scintilla-marshal.list:1) */
|
|
|
|
void
|
|
|
|
scintilla_marshal_VOID__INT_POINTER (GClosure *closure,
|
|
|
|
- GValue *return_value,
|
|
|
|
+ GValue *return_value G_GNUC_UNUSED,
|
|
|
|
guint n_param_values,
|
|
|
|
const GValue *param_values,
|
|
|
|
- gpointer invocation_hint,
|
|
|
|
+ gpointer invocation_hint G_GNUC_UNUSED,
|
|
|
|
gpointer marshal_data)
|
|
|
|
{
|
|
|
|
typedef void (*GMarshalFunc_VOID__INT_POINTER) (gpointer data1,
|