diff options
-rw-r--r-- | INSTALL | 9 | ||||
-rw-r--r-- | Makefile.am | 3 | ||||
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | debian/copyright | 4 | ||||
-rwxr-xr-x | distribute | 4 | ||||
-rw-r--r-- | patches/010-scintilla-teco-control-codes.patch | 33 | ||||
-rw-r--r-- | patches/020-scinterm-fix-64-bit.patch | 22 | ||||
-rw-r--r-- | patches/030-scinterm-crosscompile.patch | 19 | ||||
-rw-r--r-- | patches/035-scinterm-curses-header.patch | 11 | ||||
-rw-r--r-- | patches/040-scinterm-compat.patch | 13 | ||||
-rw-r--r-- | patches/050-scinterm-lexlib.patch | 17 | ||||
-rw-r--r-- | patches/README | 3 | ||||
-rw-r--r-- | src/document.cpp | 39 |
13 files changed, 72 insertions, 106 deletions
@@ -3,7 +3,7 @@ Installation Instructions Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. -Copyright (C) 2013 Robin Haberkorn +Copyright (C) 2013-2014 Robin Haberkorn Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright @@ -16,10 +16,10 @@ SciTECO Build and Runtime Dependencies * Autotools, GNU C/C++ (v4.4 or later) or LLVM/gcc or LLVM/Clang * Glib 2 as a cross-platform runtime library: https://launchpad.net/~robin-haberkorn/+archive/sciteco - * Scintilla (v3.2.3 up to v3.3.1): + * Scintilla (v3.3.7 or later): http://www.scintilla.org/ * Curses interface: - * Scinterm (v1.1 or later): + * Scinterm (v1.2 or later): http://foicica.com/scinterm/ * NCurses (http://www.gnu.org/software/ncurses/), PDCurses/XCurses (http://pdcurses.sourceforge.net/) or @@ -99,6 +99,9 @@ from a source bundle: site-configuration (./configure) options to tell SciTECO where to find Scintilla/Scinterm. +The remainder of this document are the standard GNU installation +instructions. + Basic Installation ================== diff --git a/Makefile.am b/Makefile.am index 11172d7..b3aaf24 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,6 +6,7 @@ noinst_HEADERS = compat/bsd/sys/cdefs.h \ compat/bsd/sys/queue.h \ compat/bsd/sys/tree.h -EXTRA_DIST = $(wildcard @top_srcdir@/patches/*.patch) +EXTRA_DIST = $(wildcard @top_srcdir@/patches/*.patch) \ + README EXTRA_DIST += TODO @@ -47,6 +47,7 @@ Features: like teco.ini is found): perhaps by introducing special characters in the default SCITECOPATH or hardcoding the defaults * automatic EOL detection of buffers; easy EOL setting + * refactor State::Error into separate C file and namespace Optimizations: * prevent command-line flickering when using function key macros. diff --git a/debian/copyright b/debian/copyright index 3d191df..30ca476 100644 --- a/debian/copyright +++ b/debian/copyright @@ -43,11 +43,11 @@ License: OR PERFORMANCE OF THIS SOFTWARE. Files: scintilla/scinterm/* -Copyright: Copyright 2007-2012 Mitchell <mitchell.att.foicica.com> +Copyright: Copyright 2012-2014 Mitchell <mitchell.att.foicica.com> License: The MIT License . - Copyright (c) 2007-2012 Mitchell + Copyright (c) 2012-2014 Mitchell . Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -3,10 +3,10 @@ SCITECO_VERSION = 0.5 SCITECO_SRC = sciteco-$(SCITECO_VERSION).tar.gz -SCINTILLA_VERSION = 325 +SCINTILLA_VERSION = 339 SCINTILLA_SRC = scintilla$(SCINTILLA_VERSION).tgz -SCINTERM_VERSION = 1.1 +SCINTERM_VERSION = 1.2 SCINTERM_SRC = scinterm_$(SCINTERM_VERSION).zip $(SCITECO_SRC): diff --git a/patches/010-scintilla-teco-control-codes.patch b/patches/010-scintilla-teco-control-codes.patch deleted file mode 100644 index f479909..0000000 --- a/patches/010-scintilla-teco-control-codes.patch +++ /dev/null @@ -1,33 +0,0 @@ -Hacks Scintilla to display control characters like TECO does: -Caret followed by code+64 with a few exceptions. -Also improves Scinterm's heuristics for printing control -characters. ---- a/scintilla/src/Editor.cxx 2013-01-19 21:51:58.002270685 +0100 -+++ b/scintilla/src/Editor.cxx 2013-01-20 02:07:27.212272030 +0100 -@@ -351,10 +351,10 @@ - - const char *ControlCharacterString(unsigned char ch) { - const char *reps[] = { -- "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL", -- "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI", -- "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB", -- "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US" -+ "^@", "^A", "^B", "^C", "^D", "^E", "^F", "^G", -+ "^H", "TAB" /* ^I */, "LF" /* ^J */, "^K", "^L", "CR" /* ^M */, "^N", "^O", -+ "^P", "^Q", "^R", "^S", "^T", "^U", "^V", "^W", -+ "^X", "^Y", "^Z", "$" /* ^[ */, "^\\", "^]", "^^", "^_" - }; - if (ch < (sizeof(reps) / sizeof(reps[0]))) { - return reps[ch]; ---- a/scintilla/scinterm/ScintillaTerm.cxx 2013-01-19 23:49:46.092268831 +0100 -+++ b/scintilla/scinterm/ScintillaTerm.cxx 2013-01-20 01:55:36.213521263 +0100 -@@ -290,8 +290,7 @@ - void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, - const char *s, int len, ColourDesired fore, - ColourDesired back) { -- if ((len == 2 && (isupper(s[0]) && isupper(s[1]))) || -- (len == 3 && (isupper(s[0]) && isupper(s[1]) && isupper(s[2])))) -+ if (rc.left >= rc.right) - rc.left -= 2, rc.right -= 2, rc.top -= 1, rc.bottom -= 1; - else if (rc.top > rc.bottom) - rc.top -= 1, rc.bottom += 1; diff --git a/patches/020-scinterm-fix-64-bit.patch b/patches/020-scinterm-fix-64-bit.patch deleted file mode 100644 index 47c7e6d..0000000 --- a/patches/020-scinterm-fix-64-bit.patch +++ /dev/null @@ -1,22 +0,0 @@ -Fixes (void *) to (attr_t) casting on certain target configurations -where sizeof(attr_t) < sizeof(void *) ---- a/scintilla/scinterm/ScintillaTerm.cxx 2013-03-17 19:22:04.864167902 +0100 -+++ b/scintilla/scinterm/ScintillaTerm.cxx 2013-03-17 19:44:48.832401507 +0100 -@@ -9,6 +9,7 @@ - #include <stdio.h> - #include <stdlib.h> - #include <string.h> -+#include <stdint.h> - - #include <string> - #include <vector> -@@ -274,7 +275,8 @@ - void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, - const char *s, int len, ColourDesired fore, - ColourDesired back) { -- wattr_set(win, reinterpret_cast<attr_t>(font_.GetID()), -+ intptr_t id = reinterpret_cast<intptr_t>(font_.GetID()); -+ wattr_set(win, static_cast<attr_t>(id), - term_color_pair(fore, back), NULL); - if (rc.left < 0) s += static_cast<int>(-rc.left), rc.left = 0; - mvwaddnstr(win, rc.top, rc.left, s, Platform::Minimum(len, COLS - rc.left)); diff --git a/patches/030-scinterm-crosscompile.patch b/patches/030-scinterm-crosscompile.patch deleted file mode 100644 index e4bcd46..0000000 --- a/patches/030-scinterm-crosscompile.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/scintilla/scinterm/Makefile 2013-02-18 20:41:07.357813654 +0100 -+++ b/scintilla/scinterm/Makefile 2013-02-18 20:42:31.535828138 +0100 -@@ -2,6 +2,7 @@ - - .SUFFIXES: .cxx .c .o .h .a - -+AR = ar - CXX = g++ - INCLUDEDIRS = -I ../include -I ../src -I ../lexlib - CXXFLAGS = -Wall -Wno-missing-braces -Wno-char-subscripts -Wno-long-long \ -@@ -30,7 +31,7 @@ - CharacterSet.o LexerBase.o LexerModule.o LexerNoExceptions.o \ - LexerSimple.o PropSetSimple.o StyleContext.o WordList.o \ - $(lexers) ScintillaTerm.o -- ar rc $@ $^ -+ $(AR) rc $@ $^ - touch $@ - clean: - rm -f *.o $(scintilla) diff --git a/patches/035-scinterm-curses-header.patch b/patches/035-scinterm-curses-header.patch deleted file mode 100644 index fbce286..0000000 --- a/patches/035-scinterm-curses-header.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/scintilla/scinterm/ScintillaTerm.cxx 2013-03-19 18:32:55.511861027 +0100 -+++ b/scintilla/scinterm/ScintillaTerm.cxx 2013-03-19 18:33:05.747736822 +0100 -@@ -15,7 +15,7 @@ - #include <vector> - #include <map> - --#include <ncurses.h> -+#include <curses.h> - - #include "Platform.h" - diff --git a/patches/040-scinterm-compat.patch b/patches/040-scinterm-compat.patch deleted file mode 100644 index 30e21a8..0000000 --- a/patches/040-scinterm-compat.patch +++ /dev/null @@ -1,13 +0,0 @@ -Necessary for Scintilla 3.3.1 compatibility -(already fixed in Scinterm repository) ---- a/scintilla/scinterm/Makefile 2013-07-05 19:59:35.094018253 +0200 -+++ b/scintilla/scinterm/Makefile 2013-07-05 19:59:45.102018598 +0200 -@@ -5,7 +5,7 @@ - CXX = g++ - INCLUDEDIRS = -I ../include -I ../src -I ../lexlib - CXXFLAGS = -Wall -Wno-missing-braces -Wno-char-subscripts -Wno-long-long \ -- -pedantic -DNCURSES -DSCI_LEXER $(INCLUDEDIRS) -+ -pedantic -DNCURSES -DCURSES -DSCI_LEXER $(INCLUDEDIRS) - ifdef DEBUG - CXXFLAGS += -DDEBUG -g - else diff --git a/patches/050-scinterm-lexlib.patch b/patches/050-scinterm-lexlib.patch new file mode 100644 index 0000000..bdc3fd8 --- /dev/null +++ b/patches/050-scinterm-lexlib.patch @@ -0,0 +1,17 @@ +Link the entire lexlib into Scinterm's scintilla.a. +The author forgot to add CharacterCategory.o. +--- a/scintilla/scinterm/Makefile 2014-02-16 06:44:03.572368461 +0100 ++++ b/scintilla/scinterm/Makefile 2014-02-16 06:47:07.495772994 +0100 +@@ -28,9 +28,9 @@ + Document.o Editor.o ExternalLexer.o Indicator.o KeyMap.o \ + LineMarker.o PerLine.o PositionCache.o RESearch.o RunStyles.o \ + ScintillaBase.o Selection.o Style.o UniConversion.o ViewStyle.o \ +- XPM.o Accessor.o CharacterSet.o LexerBase.o LexerModule.o \ +- LexerNoExceptions.o LexerSimple.o PropSetSimple.o StyleContext.o \ +- WordList.o $(lexers) ScintillaTerm.o ++ XPM.o Accessor.o CharacterCategory.o CharacterSet.o LexerBase.o \ ++ LexerModule.o LexerNoExceptions.o LexerSimple.o PropSetSimple.o \ ++ StyleContext.o WordList.o $(lexers) ScintillaTerm.o + $(AR) rc $@ $^ + touch $@ + clean: diff --git a/patches/README b/patches/README new file mode 100644 index 0000000..9ce62c8 --- /dev/null +++ b/patches/README @@ -0,0 +1,3 @@ +This directory contains Scintilla/Scinterm patches. +Most of them are required for SciTECO to function properly. +Please refer to INSTALL.
\ No newline at end of file diff --git a/src/document.cpp b/src/document.cpp index a7276f0..c01bd4c 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -28,6 +28,32 @@ #include "undo.h" #include "document.h" +static inline void +set_representations(void) +{ + static const char *reps[] = { + "^@", "^A", "^B", "^C", "^D", "^E", "^F", "^G", + "^H", "TAB" /* ^I */, "LF" /* ^J */, "^K", "^L", "CR" /* ^M */, "^N", "^O", + "^P", "^Q", "^R", "^S", "^T", "^U", "^V", "^W", + "^X", "^Y", "^Z", "$" /* ^[ */, "^\\", "^]", "^^", "^_" + }; + + for (guint cc = 0; cc < G_N_ELEMENTS(reps); cc++) { + gchar buf[] = {(gchar)cc, '\0'}; + interface.ssm(SCI_SETREPRESENTATION, + (uptr_t)buf, (sptr_t)reps[cc]); + } +} + +class UndoSetRepresentations : public UndoToken { +public: + void + run(void) + { + set_representations(); + } +}; + void TECODocument::edit(void) { @@ -38,11 +64,24 @@ TECODocument::edit(void) interface.ssm(SCI_SETFIRSTVISIBLELINE, first_line); interface.ssm(SCI_SETXOFFSET, xoffset); interface.ssm(SCI_SETSEL, anchor, (sptr_t)dot); + + /* + * Default TECO-style character representations. + * They are reset on EVERY SETDOCPOINTER call by Scintilla. + */ + set_representations(); } void TECODocument::undo_edit(void) { + /* + * see above: set TECO-style character representations + * NOTE: could be done with push_msg() but that requires + * making the entire mapping static constant + */ + undo.push(new UndoSetRepresentations()); + undo.push_msg(SCI_SETSEL, anchor, (sptr_t)dot); undo.push_msg(SCI_SETXOFFSET, xoffset); undo.push_msg(SCI_SETFIRSTVISIBLELINE, first_line); |