Age | Commit message (Collapse) | Author | Files | Lines |
|
* dirname and basename calculations can be done easier with
the new file_get_dirname_len()
* platform-dependant derive_dir_separator() function has been removed
|
|
We used g_path_get_dirname() which does not always return strict prefixes
of the input file name. For file names without directory, it returns "."
(the current directory). This is useful for passing that directory to
functions expecting a proper directory (like g_dir_open()) but was
unsuitable for building file name candidates for autocompletion.
Therefore, we tried to determine if the dirname is a prefix of the filename.
This however failed for "hidden" file names beginning with dot.
All in all it is easier to calculate our own directory name based on
the previously calculated basename than to handle the current-directory
case with g_path_get_dirname(). Now we'll get "" for the current directory,
so we have to handle the empty-string-is-current-dir case.
|
|
* for historic reasons, the backspace key can be transmitted as
^H by the terminal. Some terminal emulators might do that - these
are fixed by this commit.
* Use CTL_KEY('H') instead of standard C '\b' as the former is less
ambiguous given the confusion around the backspace character.
|
|
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.
|
|
* the popup resetting was done after character insertion, so typing
0EB would clear the popup immediately
* the new implementation is functionally equivalent to the
old pre-reinsertion-commandline-handling, by resetting the popup
based on the immediate editing command before insertion
|
|
we are not guaranteed to reach the start parser state
again if the command is not terminated on the rubbed out
command line
|
|
|
|
* we cannot prevent GTK from delivering the function key presses,
as we can on Curses. Therefore Cmdline::fnmacro() checks again if
function keys are enabled.
|
|
* this is a Linux/glibc-only optimization
|
|
(also replaces ^T)
* CTRL+G toggles the behaviour of the rubout (Backspace, ^W, ^U) commands:
When the so called immediate editing command modifier is enabled/active,
the rubout commands will do the opposite and insert from the rubbed out
command line.
This command is somewhat similar to Emacs' C-g command.
* The CTRL+G command also replaces the ^T immediate editing command
for auto-completing filenames in any string argument.
Now the TAB key can be used for that purpose after activating the
^G modifier.
^T is a classic TECO command that will be supported sooner or later
by SciTECO, so it's good to have it available directly.
|
|
cleanup/refactoring
* characters rubbed out are not totally removed from the command line,
but only from the *effective* command line.
* The rubbed out command line is displayed after the command line cursor.
On Curses it is grey and underlined.
* When characters are inserted that are on the rubbed out part of the command line,
the cursor simply moves forward.
NOTE: There's currently no immediate editing command for reinserting the
next character/word from the rubbed out command line.
* Characters resulting in errors are no longer simply discarded but rubbed out,
so they will stay in the rubbed out part of the command line, reminding you
which character caused the error.
* Improved Cmdline formatting on Curses UI:
* Asterisk is printed bold
* Control characters are printed in REVERSE style, similar to what
Scinterm does. The controll character formatting has thus been moved
from macro_echo() in cmdline.cpp to the UI implementations.
* Updated the GTK+ UI (UNTESTED): I did only, the most important API
adaptions. The command line still does not use any colors.
* Refactored entire command line handling:
* The command line is now a class (Cmdline), and most functions
in cmdline.cpp have been converted to methods.
* Esp. process_edit_cmd() (now Cmdline::process_edit_cmd()) has been
simplified. There is no longer the possibility of a buffer overflow
because of static insertion buffer sizes
* Cleaned up usage of the cmdline_pos variable (now Cmdline::pc) which
is really a program counter that used a different origin as macro_pc
which was really confusing.
* The new Cmdline class is theoretically 8-bit clean. However all of this
will change again when we introduce Scintilla views for the command line.
* Added 8-bit clean (null-byte aware) versions of QRegisterData::set_string()
and QRegisterData::append_string()
|
|
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
|
|
|
|
* the ^I command was altered to insert indention characters
rather than plain tabs always.
* The <TAB> immediate editing command was added for all
insertion arguments (I, ^I but also FR and FS)
* documentation was extended for a discussion of indention
|
|
Windows
* this is actually UNTESTED on Windows
|
|
optimized screen refreshing/redrawing
* pressing e.g. TAB when the popup is showing a list of auto-completions
will show the next page, eventually beginning at the first one again.
* do not redraw curses windows in the UI methods directly. this resulted
in flickering during command-line editing macros and ordinary macro calls
because the physical screen was updated immediately.
Instead, window refreshing and updated is done centrally in
event_loop_iter() only after a key has been processed.
Also we use wnoutrefresh() and doupdate() to send as little to the
terminal (emulator) as possible.
|
|
* added platform-dependant file_is_visible() function
|
|
* in batch mode, Scintilla undo actions are simply leaked memory
* Since we have more than one Scintilla view now, we must empty
the undo buffer of all scintilla views when a command line is committed ($$)
|
|
* 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.
|
|
the QUIT hook is actually not that trivial and required
some architectural changes.
First, the QUIT hook execution and any error that might
occurr cannot always be attached to an existing error stack
frame. Thereforce, to give a stack frame for QUIT hooks and
to improve the readability of error traces for ED hooks in general,
a special EDHookFrame is added to every ED hook execution error.
Secondly, since QUIT hooks can themselves throw errors, we cannot
run it from an atexit() handler. Instead it's always called manually
before __successful__ program termination. An error in a QUIT hook
will result in a failure return code nevertheless.
Thirdly, errors in QUIT hooks should not prevent program termination
(in interactive mode), therefore they are only invoked from main()
and always in batch mode. I.e. if the interactive mode is terminated
(EX$$), SciTECO will switch back to batch mode and run the QUIT
hook there. This is also symmetric to program startup, which is
always in batch mode.
This means that Interface::event_loop() no longer runs indefinitely.
If it returns, this signals that the interface shut down and
batch mode may be restored by SciTECO.
|
|
Template Pattern.
* without the one-view-per-buffer designs, many Scintilla send message (SSM)
calls could be inlined
* with the new design, this was no longer possible using the abstract
base classes. the CRT pattern allows inlining again but introduces
a strange level of code obscurity.
* tests suggest that at high optimization levels, the one-view-per-buffer
design and the CRT pattern reduces typical macro runtimes by 30%
(e.g. for symbols-extract.tes).
* only updated the NCurses UI for the time being
|
|
* the GError expection has been renamed to GlibError, to avoid
nameclashes when working from the SciTECO namespace
|
|
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).
|
|
behaves just like ^T in string arguments.
later we might add special Bash-completion support
|
|
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.
|
|
* 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.
|
|
|
|
* specifications resulted in runtime errors (unexpected exception) when bad_alloc ocurred
* specs should be used scarcely: only when the errors that may be thrown are all known
and for documentary purposes
|
|
* when an error is thrown, stack frames are collected on clean up, up to
the toplevel macro
* the toplevel macro decides how to display the error
* now errors in interactive and batch mode are displayed differently
* in batch mode, a backtrace is displayed as a sequence of messages
* Execute::file() forwards errors correctly
* the correct error in the file is displayed in interactive mode
* necessary to build the stack trace
|
|
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
|
|
tab-completions
* StateExpectFile adds no functionality (currently), but is useful for checking state types
|
|
* flow control and other structures have not been documented this ways.
I have not yet decided whether they should be documented in separate
sections or use the documentation tool.
|
|
|
|
initialization revised
* g_get_environ() appears to be broken, at least in Wine and Win2k
|
|
ensure that undo tokens for first differing characters are actually
associated with this character instead of the next.
(resulted in strange behaviour on rubout and subsequent replacements)
|
|
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
|
|
see comment: special handling of <CTL/Z> in terminal might
be disabled, or commandline input might be in X11 window...
|
|
when not in string-state, <CTL/U> is self inserting (unlike traditional
TECO where it would clear your entire commandline)
|
|
|
|
|
|
words or entire commands
* when rubbing out words (in string params), use Scintilla's definition of a word
|
|
* fixes autocompletion at the beginning of string params
* is also available in filename commands and would allow filename completion after string beginning
* also did some editing command cleanup
|
|
cmdline and cmdline_pos is no longer modified by code executed by step()
instead it is modified at the outermost macro level (commandline macro level)
|
|
allows commandline editing scripted by macros
|
|
* simplified traditional commandline editing. no need to extend cmdline string one character
at a time when inserting multiple. instead there's a marker (cmdline_pos) specifying the macro
length to execute in a "step" and also the anchor for generating undo tokens
* implementation does not yet work in macro calls
* while editing the commandline, other buffers/registers may not be edited
(need push-down-list and auxiliary q-register)
|
|
do not accidentally overwrite the Scintilla (SCI_...) message
symbol set
|
|
|
|
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
|
|
commandline
fixes errors in loops or loop interruptions (may leave program counter
somewhere in the loop)
|
|
|