geany/scintilla/scintilla_changes.patch

302 lines
9.9 KiB
Diff
Raw Normal View History

A patch to Scintilla 1.78 containing our changes to Scintilla.
These are mainly the column mode editing patch and removing unused lexers.
diff -Naurp /tmp/scintilla/Editor.cxx scintilla/Editor.cxx
--- /tmp/scintilla/Editor.cxx 2009-04-25 02:06:03.000000000 +0200
+++ scintilla/Editor.cxx 2009-05-01 11:37:30.000000000 +0200
@@ -3540,22 +3540,51 @@ void Editor::AddChar(char ch) {
// 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) {
@@ -3729,14 +3758,41 @@ bool Editor::CanPaste() {
}
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() {
@@ -3772,7 +3828,33 @@ void Editor::DelChar() {
}
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)) {
diff -Naurp /tmp/scintilla/include/Scintilla.h scintilla/include/Scintilla.h
--- /tmp/scintilla/include/Scintilla.h 2009-04-25 02:06:02.000000000 +0200
+++ scintilla/include/Scintilla.h 2009-05-01 11:51:07.000000000 +0200
@@ -26,7 +26,7 @@ int Scintilla_LinkLexers();
* hold a pointer and sptr_t, a signed integer large enough to hold a pointer.
* May need to be changed for 64 bit platforms. */
#if defined(_WIN32)
-#include <BaseTsd.h>
+#include <basetsd.h>
#endif
#ifdef MAXULONG_PTR
typedef ULONG_PTR uptr_t;
@@ -845,7 +845,7 @@ struct SCNotification {
int ch; /* SCN_CHARADDED, SCN_KEY */
int modifiers; /* SCN_KEY */
int modificationType; /* SCN_MODIFIED */
- const char *text; // SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */
+ const char *text; /* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */
int length; /* SCN_MODIFIED */
int linesAdded; /* SCN_MODIFIED */
int message; /* SCN_MACRORECORD */
diff -Naurp /tmp/scintilla/KeyWords.cxx scintilla/KeyWords.cxx
--- /tmp/scintilla/KeyWords.cxx 2009-03-29 08:28:12.000000000 +0200
+++ scintilla/KeyWords.cxx 2009-05-01 11:32:44.000000000 +0200
@@ -141,99 +141,35 @@ int Scintilla_LinkLexers() {
//++Autogenerated -- run src/LexGen.py to regenerate
//**\(\tLINK_LEXER(\*);\n\)
- LINK_LEXER(lmAbaqus);
LINK_LEXER(lmAda);
- LINK_LEXER(lmAns1);
- LINK_LEXER(lmAPDL);
LINK_LEXER(lmAsm);
- LINK_LEXER(lmASP);
- 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);
LINK_LEXER(lmCmake);
- LINK_LEXER(lmCOBOL);
- 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);
LINK_LEXER(lmFreeBasic);
- 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);
- LINK_LEXER(lmNimrod);
- LINK_LEXER(lmNncrontab);
LINK_LEXER(lmNsis);
LINK_LEXER(lmNull);
- LINK_LEXER(lmOctave);
- LINK_LEXER(lmOpal);
LINK_LEXER(lmPascal);
- LINK_LEXER(lmPB);
LINK_LEXER(lmPerl);
- LINK_LEXER(lmPHP);
- LINK_LEXER(lmPHPSCRIPT);
- LINK_LEXER(lmPLM);
LINK_LEXER(lmPo);
- LINK_LEXER(lmPOV);
- LINK_LEXER(lmPowerPro);
- 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);
- LINK_LEXER(lmSML);
- LINK_LEXER(lmSorc);
- LINK_LEXER(lmSpecman);
- LINK_LEXER(lmSpice);
LINK_LEXER(lmSQL);
- LINK_LEXER(lmTACL);
- LINK_LEXER(lmTADS3);
- LINK_LEXER(lmTAL);
LINK_LEXER(lmTCL);
- LINK_LEXER(lmTeX);
- LINK_LEXER(lmVB);
- LINK_LEXER(lmVBScript);
- LINK_LEXER(lmVerilog);
LINK_LEXER(lmVHDL);
LINK_LEXER(lmXML);
LINK_LEXER(lmYAML);
diff -Naurp /tmp/scintilla/scintilla-marshal.c scintilla/scintilla-marshal.c
--- /tmp/scintilla/scintilla-marshal.c 2004-04-04 11:59:37.000000000 +0200
+++ scintilla/scintilla-marshal.c 2008-07-03 15:57:09.000000000 +0200
@@ -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,