aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2016-02-15implemented <$$> command for returning from a macroRobin Haberkorn2-6/+5
* <$$> is faster than jumping to the end of the macro and enables shorter code for returning values from macros. * this also replaces $$ as an immediate editing command. In other words, command line termination is an ordinary command now. The old behaviour was similar to what classic TECO did. Classic TECO however had no choice than to track key presses directly for command line termination as it did not keep track about the parser state as input was typed. This led to some glitches in the language. For instance "FS$$" would terminate the command line, unless the second escape was typed after backspace, etc. This behaviour is not worth copying and SciTECO did a better job than that by making sure that at least the second escape is only effective if it is not part of language syntax. This still lead to some undesirable cases like "ES...$$$" that would terminate the command line unexpectedly. To terminate the command line after something like "FS$$", you will now have to type "FS$$$$". * As it is a regular command now - just executed immediately - and its properties stay close to the macro return behaviour, command line termination may now not always be performed when $$ is typed even as a standalone command. E.g. "Ofoo$ !bar!$$ !foo!Obar$" will curiously terminate the command line now. * This also means that macros can finally terminate command lines by using the command line editing commands ({ and }) to insert $$ into the command line macro. This is also of interest for function key macros. * This implementation showed some serious shortcoming in SciTECO's current parser that yet have to be fixed. E.g. the macro "@^Ua{<$$>}" is currently unsafe since loops abuse the expression stack for storing their state and $$ does not touch the expression stack. Calling "Ma>" would actually continue the loop jumping to the beginning of the command line since program counters referring to the macro A will be reused! This cannot be easily solved by checking for loop termination since being able to return that way from loops is a useful feature. This is a problem even without loops and $$, e.g. as in "@^Ua{1,2,3(4,5} Ma)". Instead, a kind of expression stack frame pointer must be added to macro invocation stack frames, pointing to the beginning of the expression stack for the current frame. At the end of macros or on return, the stack contents of corresponding to the frame can be discarded while preserving the immediate arguments at the time of the return or end-of-macro. This would stabilize SciTECO's macro semantics. * When a top-level macro returns in batch mode, it would be a good idea to use the last argument to calculate the process return code, so it can be set by SciTECO scripts (TODO).
2016-02-15lexer library: avoid unnecessary argument discards after SETLEXERLANGUAGERobin Haberkorn69-69/+69
* causes problems with the $$ command implemented * was already fixed in scite2co.lua but the existing code was manually updated and generated with an earlier version of scite2co.lua
2016-02-03Gtk UI: automatically configure font of the command lineRobin Haberkorn1-0/+4
* This uses the font and size of STYLE_DEFAULT. * We cannot just pass the font down to the user CSS. There are no font variables in Gtk CSS. Therefore we configure the command line widget directly. This can still be overwritten by an user CSS. * Instead of using the deprecated gtk_widget_modify_font(), we generate CSS. Ugly, but still better than writing our own style provider. * Font setting is exposed to the user using a new optional Q-Reg "lexer.font". The numeric part is the point size multiplied with 100 (fractional point size). * Font setting in lexer.auto is skipped in Curses where it is irrelevant anyway to speed up startup. * Perhaps the "Monospace" font name is also a good default value instead of Courier? fixup
2015-07-21fixed scite2co.lua: use SCI_SETLEXERLANGUAGE instead of SCI_SETLEXERRobin Haberkorn70-70/+74
* the lexer names used in SciTE property files are not SCLEX constants but the internal LexerModule names, so auto-generated SciTECO lexer configurations can only be set by name, i.e. via SETLEXERLANGUAGE, since we cannot easily map those names to SCLEX constants. * should be about as fast as using SCI_SETLEXER (since SciTECO has to look up symbolic names as well at runtime). * this especially fixes opening *.mak files -- often Makefiles but identified as "Mako" files. The macro "lexer.set.mako" used the wrong SCLEX_ symbol. * will also fix the HTML and all other lexers that use the SCLEX_HTML/hypertext lexer. * all lexer files have been updated, to be more compatible with scite2co.lua's output. This eases lexer updates in the future.
2015-07-15changed default popup background color and color schemesRobin Haberkorn2-3/+3
* use black on light white as the default popup colors (e.g. in --no-profile mode). this looks less annoying than black on light blue and is more often more readable (since light blue will be rendered quite dark often). It's no longer necessary to highlight the popup with (distinct) colors. Keeping the foreground black ensures that there's a brighter foreground color for bold entries in case the terminal does not support bold fonts. * the `terminal.tes` scheme keeps the default popup style. However since it uses white on black as the default colors, this will often still stand out from the message line (on 16 color terminals). * `solarized.tes` now uses a similar high-contrast popup style with either a bright or dark background. The foreground colors have been chosen so that bright variants exist for non-bold terminals - although these bright variants do not stand out very much.
2015-07-14added port of the Solarized color schemeRobin Haberkorn2-1/+140
* see http://ethanschoonover.com/solarized * I don't know if I want this port to be linked into the main solarized repository as it is certainly not perfect. * However both light and dark modes are supported and usable since to SciTECO's new theming support. * Set -U[solarized.light] before munging to enable light mode. * Registers function key F5 to toggle between light and dark modes. * Works on ncurses (with some restrictions) and almost all other PDCurses ports. GTK+ also works somewhat, but not all parts of the GTK+ UI are currently themable.
2015-07-14fixed default colors in color.tes and style Q-Register viewRobin Haberkorn3-32/+68
* the RGB values of the 8 standard colors defined by color.tes were wrong (i.e. did not correspond to the normal 8 color codes defined by Scinterm but only the bright versions). Except for `color.black` which referred to terminal color 0. * now we define the 16 colors defined by Scinterm, allowing color schemes to explicitly use bright color versions without using the bold attribute. On 8 color terminals, the bold attribute might still be the only way to get a bright color. * terminal.tes: Use bright default color instead of relying on bold to get bright color versions. This is especially important for comments which where relied on bold black to be rendered grey. This did not work by default on terminals supporting bold fonts (e.g. OS X Terminal) or GTK+. The scheme now works on more terminals out of the box and on GTK+ and is thus a good default color scheme. * Color schemes will now also define the default style, the line number style and caret foreground/background. `color.calltip` is now also defined for STYLE_CALLTIP and can later be used to style SciTECO's custom popup widget.
2015-06-29<:Q> returns -1 for non-existent registers nowRobin Haberkorn1-2/+2
* added a new OPTIONAL behaviour for QRegSpecMachines * allows you to implement commands that have an optional Q-Register argument that should not be initialized if undefined. * Using QRegSpecMachine::fail() you may still check for existence of the register conditionally to emulate the QREG_REQUIRED behaviour. * Using :Q for checking for register existence makes sense, because usually you will want to check for both existence and non-emptyness as in :Qq">. So in this common case, you no longer have to keep in mind that the register may also be undefined. * This finally allows us to create arrays in the Q-Register tables without keeping a separate entry for the number of elements. E.g. an array.0 to array.N can be iterated like this: 0Ui <:Q[array.^E\i]:; ! work with element i ! %i>
2015-06-27enable function key macros automatically when sourcing fnkeys.tesRobin Haberkorn1-0/+3
* this simplifies profile setup * should anybody wish to load the default function key macros but not enable function key support, he/she can still explicitly call "64,0ED" to disable them again.
2015-06-24added "^FCLOSE" function key macro and defined SIGTERM behaviourRobin Haberkorn1-0/+3
* ^FCLOSE is inserted when the "Close" key is pressed. It is used by the GTK+ UI to deliver window close requests and SIGTERM occurrences. (this replaces the "Break" key used before in the GTK+ UI). * The default action of ^FCLOSE is to quit SciTECO, therefore window closing is possible even in --no-profile mode for instance. * fixed a minor memleak in Cmdline::fnmacro() * added ^FCLOSE implementation to fnkeys.tes to insert EX. This currently has the disadvantage of overwriting the error message with syntax errors if there are modified buffers but it will at least not close the window if there are modified buffers. * SIGTERM will now be similar to SIGINT by default instead of terminating SciTECO right away. * the GTK+ UI handles SIGTERM by emulating the "close" key while still interrupting like SIGINT. * GTK+: SIGTERM and ^C will interrupt by sending SIGINT to the entire process group instead of simply setting `sigint_occurred`. This fixes interrupting EC and EG commands with long-running or hanging programs and is relevant to the solution of #4.
2015-06-11fixed lexer configuration for the unnamed bufferRobin Haberkorn1-0/+1
* The unnamed buffer must be handled separately since the "lexer.test..." macros assume that register "*" is non-empty. Else it will be configured for some arbitrary lexer. * this was a regression compared to v0.6.4
2015-05-25extended <EN> command and used it to optimize "lexer.test..." macrosRobin Haberkorn72-246/+333
* EN may now be used for matching file names (similar to fnmatch(3)). This is used to check the current buffers file extension in the lexer configuration macros instead of using expensive Q-Register manipulations. This halves the overall startup time - it is now acceptable even with the current amount of lexer configurations. * EN may now be used for checking file types. session.tes has been simplified. * BREAKS macro portability (EN now has 2 string arguments). * The Globber class has been extended to allow filtering of glob results by file type.
2015-03-24added new lexer configs auto-generated by scite2co.luaRobin Haberkorn63-5/+3190
* these are still not all languages supported by Scintilla. scite2co.lua does not do a good job of generating styles when SciTE's property files use hardcoded colors/fonts. This commit only includes reasonably good conversion results. The remaining languages need some additional manual labor. * Even these lexers are not perfect and should be revised by comparing them with SciTE's properties. * So many lexers make the "lexer.auto" macro too slow. We need some optimization. E.g. the search-command optimization described in TODO, or an extended EN command for globbing manually specified file names.
2015-03-24reformatted existing lexer definitionsRobin Haberkorn8-147/+113
* they are updated with the results of scite2co.lua This makes it easier in the future to update lexer settings based on the property files of new SciTE releases.
2015-03-24added scite2co.lua: a script for generating SciTECO lexer definitions from ↵Robin Haberkorn2-0/+173
SciTE properties files
2015-03-16implemented function key masking (context-sensitive function key macros)Robin Haberkorn1-2/+18
* fnkeys.tes has been updated to enable the command line editing macros (cursor keys, etc.) only in the "start" state. This avoids the annoying effect of inserting the macros into string arguments where they have no effect and must be rubbed out again.
2015-03-02used file lists instead of wildcards in lib/Makefile.amRobin Haberkorn1-4/+13
* this is recommended by Automake since wildcards are not portable. However we rely on GNU Make extensions in other places. * This fixes out-of-source builds. * The lists can be updated relatively easily with SciTECO (EN command...)
2015-03-02added function key macro for Shift+DEL: Acts as a "reverse" ruboutRobin Haberkorn1-0/+4
It reinserts when the immediate editing modifier is disabled and rubs out when it is enabled - without modifying the state of the ^G modifier.
2015-02-18added session.hg and session.vcs macrosRobin Haberkorn1-0/+19
* session.hg sets up the buffer session in the current Mercurial repository * session.vcs is a convenience macro that may be used in profiles to enable buffer sessions per repo for all supported VCS (Git, Hg and SVN)
2015-02-17added session.svn macro to set up a session profile in the current ↵Robin Haberkorn1-2/+16
Subversion working copy * it uses "svn info --xml" since otherwise the output of "svn info" might be localized.
2014-11-24allow disabling of buffer sessions. in sample.teco_ini, disable sessions ↵Robin Haberkorn1-3/+6
automatically when files are given. this allows you to use sciteco in a Git repository to edit a specific file, without changing the buffer session. Also useful if SciTECO is used as the GIT_EDITOR without thrashing the repository's session every time a commit message is edited.
2014-11-24fixed standard library installationRobin Haberkorn1-1/+4
2014-11-24introduced $SCITECOCONFIG env variable, and set different default for ↵Robin Haberkorn1-1/+1
$SCITECOPATH on Windows * $SCITECOCONFIG has been introduced, so have a macro-accessible location for the profile, buffer session etc. This is set to the program dir on Windows. That way, the config files will be found, regardless of the current working dir, but it may also be set up for Unix-like environments on Windows. * $SCITECOPATH defaults to the program dir + "/lib" now on Windows. * The default profile is now always called ".teco_ini". Also on Windows. Platform differences like this would need to be documented. * The sample teco.ini has been renamed to "sample.teco_ini" for clarity
2014-11-24Q-Register loading and saving using the IOView classRobin Haberkorn1-2/+1
* EW can save Q-Registers now * the new E% may be used to save a q-register without making it the current document
2014-11-22updated lexer and session libraries using new EU, [* and ]* commandsRobin Haberkorn2-23/+21
2014-11-22allow setting the "*" register as an alternative to nEBRobin Haberkorn1-4/+3
this is more consistent with SciTECO's idea of abstract registers and allows the currend buffer to be saved on the Q-Register stack. This allows the idiom: [* ! ...change current buffer... ! ]*
2014-11-22added a buffer session module (session.tes)Robin Haberkorn2-1/+43
This is a simple and straight-forward implementation of buffer sessions in SciTECO. A session is merely a SciTECO script that opens files when executed (and restores properties). The current session is identified by this script's filename in Q-Register "session.path": ~/.teco_session by default. Users may set "session.path" to manage different profiles. An abstraction of session "names" is not provided. Users are expected to hack these on their own. For the common task of having one session per profile, the "session.git" macro is provided. It set's up the current session relative to the current Git repository. This will create ".teco_session" files in the root of Git repositories, that may be added to a global ignore pattern (or they may even be versioned!)
2014-11-22added globbing command ENRobin Haberkorn8-36/+13
* implements the same globbing as the EB command already did * uses Globber helper class that behaves more like UNIX glob(). glib only has a glob-style pattern matcher. * The Globber class may be extended later to provide more UNIX-like globbing. * lexer.tes has been updated to make use of globbing. Now, lexers can be automatically loaded and registered at startup. To install a new lexer, it's sufficient to copy a file to the lexers/ directory.
2014-11-20lexer library: added M[lexer.checkheader] and M[lexer.checkname] for ↵Robin Haberkorn8-20/+32
matching a pattern against the first line of a buffer or its filename. This simplifies the "lexer.test..." macros and allows us to select lexers based on the #! line.
2014-11-19added first draft of new modular lexer systemRobin Haberkorn11-233/+337
2014-11-10revised default function key macrosRobin Haberkorn1-18/+63
* use shorter function key macros. * instead, every function key has a commandline editing macro based on the macro "^Tc" * dot is no longer modified to calculate positions, instead Scintilla messages are used * prevent that function key macros move dot off-page * improved behaviour: HOME will will first skip spaces and tabs at the beginning of the line and only the second press will move dot to the real line beginning. UP and DOWN will try to keep the column. However this does not work quite as good as in other editors, since there's no (sane) way to save the column last set by one of the function keys.
2014-11-09revised U command: fail if no argument is providedRobin Haberkorn1-2/+2
* there is no reasonable default value for U * omitting the parameter for U might be a frequent programming error * U can be colon-modified now, in which case it may be used * to check for the presence of arguments in macros
2014-11-09Clarify `symcasecmp` macro in string.tesRobin Haberkorn1-1/+2
2014-11-02changed syntax for long Q-Register names: use [] brackets instead of {}Robin Haberkorn2-23/+23
this breaks many existing scripts, and means you may have to rebuild SciTECO with ./configure --enable-bootstrap The syntax of SciTECO might change in backwards-incompatible until version 1.0 is released.
2013-07-04updated lexer config: CMake and XML lexingRobin Haberkorn1-0/+87
2013-03-16fixed break-command: without-param it evaluates the search-statusRobin Haberkorn1-1/+1
2013-02-24moved QuickSort macros from symbols-extract script into own string.tes macro ↵Robin Haberkorn2-0/+46
library * therefore for bootstrapping to work, the SCITECOPATH is always set explicitly
2013-02-22added --with-default-scitecopath config option: default value of $SCITECOPATHRobin Haberkorn1-1/+1
useful for Windows where the desired default path does not correspond with the installation dir of the std lib macros
2013-02-22added some default function key macrosRobin Haberkorn2-1/+29
2013-02-15install standard macros into special standard library path (pkgdatadir/lib)Robin Haberkorn2-0/+152
* SCITECOPATH environment variable defaults to this directory * manpage updated * default teco.ini updated: no need to generate it anymore