aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sciteco.h
AgeCommit message (Collapse)AuthorFilesLines
2015-03-16implemented automatic EOL translation supportRobin Haberkorn1-0/+4
* activated via bit 4 of the ED flag (enabled by default) * automatic EOL guessing on file loading and translation to LFs. * works with files that have inconsistent EOL sequences. * automatic translation to original EOL sequences on file saving * works with inconsistent EOL sequences in the buffer. This should usually not happen if the file was read in with automatic EOL translation enabled. * also works with the EC and EG commands * performance is OK, depending on the file being translated. When reading files with UNIX EOLs, the overhead is minimal typically-sized files. For DOS EOLs the overhead is larger but still acceptable. * Return (line feed) is now an immediate editing command. This centralizes EOL sequence insertion. Later, other features like auto-indent could be added to the editing command. * get_eol() has been moved to main.cpp (now called get_eol_seq() * Warn if file ownership could not be preserved when saving files. * IOView has been almost completely rewritten based on GIOChannels. The EOL translation code is also in IOView.
2015-03-07cleaned up usage of the escape control character: introduced CTL_KEY_ESC and ↵Robin Haberkorn1-2/+15
CTL_KEY_ESC_STR * the reason for the CTL_KEY() macro is to get the control character resulting from a CTRL+Key press -- at least this is how SciTECO presents these key presses. It is also a macro and may be resolved to a constant expression, so it can be used in switch-case statements. Sometimes it is clearer to use standard C escape sequences (like '\t'). * CTL_KEY('[') for escape is hard to read, so I always used '\x1B' which is even more cryptic.
2015-03-01moved String helper functions from sciteco.h and main.cpp to ↵Robin Haberkorn1-49/+0
string-utils.cpp and string-utils.h * also improved performance of String::append() by using g_realloc() * added String::append() variant for non-null-terminated strings
2015-02-11updated copyright to 2015Robin Haberkorn1-1/+1
2014-11-11added all of SciTECO's declarations to the "SciTECO" namespaceRobin Haberkorn1-0/+4
normally, since SciTECO is not a library, this is not strictly necessary since every library should use proper name prefixes or namespaces for all global declarations to avoid name clashes. However * you cannot always rely on that * Scintilla does violate the practice of using prefixes or namespaces. The public APIs are OK, but it does define global functions/methods, e.g. for "Document" that clashed with SciTECO's "TECODocument" class at link-time. Scintilla can put its definitions in a namespace, but this feature cannot be easily enabled without patching Scintilla. * a "SciTECO" namespace will be necessary if "SciTECO" is ever to be turned into a library. Even if this library will have only a C-linkage API, it must ensure it doesn't clutter the global namespace. So the old "TECODocument" class was renamed back to "Document" (SciTECO::Document).
2014-11-09implemented EC command (execute operating system command) in spawn.cppRobin Haberkorn1-1/+2
powerful command for filtering a SciTECO buffer through an external program. It will be described in the sciteco(7) man pages. The implementation uses an asynchronous background process with pipes but is platform independant thanks to glib's g_spawn functions, GIOChannels and event loops. There are however platform differences in how the operating system command is interpreted/parsed.
2014-02-18removed unreliable CHR2STR() macroRobin Haberkorn1-8/+16
* referencing temporaries is unreliable/buggy in GNU C++, at least since v4.7 * in higher optimization levels it resulted in massive memory corruptions * this is responsible for the build issues (PPA build issues) * instead, always declare a buffer on the stack which guarantees that the variable lives long enough * the g_strdup(CHR2STR(x)) idiom has been replaced with String::chrdup(x)
2014-02-16rewritten command-line completion without Glib's g_complete_ functionsRobin Haberkorn1-0/+11
* they have been marked deprecated in recent libglib versions (since v2.26) * there is no alternative in recent libglib versions, so we simply do it with a little string handling. this works with older and newer libglib versions.
2014-02-15updated Copyright to year 2014Robin Haberkorn1-1/+1
2014-02-15String::get_coord() calculates line and column of a string positionRobin Haberkorn1-0/+4
* use to get line and column into a stack frame
2013-03-19rewritten CHR2STR() using compound statementRobin Haberkorn1-1/+6
* fixes compilation on g++ 4.7 where compound literals are suddenly temporaries (from which you cannot get a pointer) * the compound statement (also GCC extension) should ensure that the string is allocated on the stack with automatic lifetime
2013-03-18declare all global inter-dependant objects in main.cpp and get rid of ↵Robin Haberkorn1-4/+0
init_priority attribute * we cannot use weak symbols in MinGW, so we avoid init_priority for symbol initialization by compiling the empty definitions into sciteco-minimal but the real ones into sciteco (had to add new file symbols-minimal.cpp) * this fixes compilation/linking on LLVM Clang AND Dragonegg since their init_priority attribute is broken! this will likely be fixed in the near future but broken versions will be around for some time
2013-03-18make sure a (void*)0 is used as sentinelsRobin Haberkorn1-1/+7
since including glib.h on LLVM-Clang (32-bit) results in NULL being redefined to 0 and compiler warnings being emitted when NULL is used as sentinels
2013-02-22use typedef for SciTECO integers and make it configurable at configure timeRobin Haberkorn1-3/+12
* storage size should always be 64 (gint64) to aid macro portability * however, for performance reasons users compiling from source might explicitly compile with 32 bit integers
2013-02-16function key support (keys without printable representation) using keyboard ↵Robin Haberkorn1-1/+2
macros * if enabled, when a function key is pressed it is looked up in Q-Registers ^F... e.g. HOME key corresponds to register ^FHOME * the string if available is inserted as if it was entered by key-presses (later it may be entered as a single input token which may be removed in a single rubout) * only NCurses currently, key names directly correspond to Curses key names * on Curses if function keys are enabled ESCAPE will be inserted after a delay (because function keys are transmitted via escape sequences). A function key macro may be used to define an alternative escape character
2013-02-01fixed buffer Ring initializationRobin Haberkorn1-0/+4
* there was a dependency on interface initialization. it did not cause issues because destruction order was by chance. * introduced INIT_PRIO and PRIO_* macros to easy initialization order declaration (using a PRIO_* formula makes code self-documenting) * also used this to clean up QRegisterTable initialization (we do not need the explicit initialize() method) * also used to clean up symbols initialization
2013-01-23implemented special save last commandline command ("*" at beginning of ↵Robin Haberkorn1-5/+0
commandline macro) * only works as part of commandline macro, * at the beginning of other macros, it is treated like an arithmetic asterisk * variables defined in cmdline.cpp are now declared by new cmdline.h
2013-01-19updated copyright (2012-2013)Robin Haberkorn1-1/+1
2013-01-19allow <CTRL/C> to be typed; aborts last typed charRobin Haberkorn1-0/+4
* CTRL/C will be a command so it is important to be able to type it directly * aborting character processing is important because it allows aborting infinite loops * since the loop interruption currently relies on SIGINT handling, there is only limited support for XCurses and GTK - CTRL/C has to be typed in the terminal window. later support for input queue polling might be added
2012-12-04added copyright notice to every source fileRobin Haberkorn1-0/+17
2012-12-04first working version of autotools based build-systemRobin Haberkorn1-5/+0
2012-12-04autoconf preparation: move everything into src/ subdirRobin Haberkorn1-0/+76