Age | Commit message (Collapse) | Author | Files | Lines |
|
on Scintilla styles
* The first 16 colors of the terminal palette can be redefined
using the 3EJ property - with all restrictions that ncurses
and UNIX terminals impose on us.
It is still important to be able to redefine the palette for
some color schemes like Solarized since it may be difficult
for users to set up the terminal emulator's palette manually.
Also when using PDCurses, setting the palette is port-specific
or only possible using init_color(). In order to allow color
redefinitions across all curses ports it makes sense if SciTECO
gives access to the color initialization of curses even if it can
guarantee very little about its semantics in general.
* 3EJ is completely ignored for GTK+
* use the STYLE_DEFAULT of the current document to style the message line.
Fg and bg colors are reversed to guarantee a good contrast to the
Scintilla view.
Errors are still hardcoded to a red background, warnings to yellow
and info messages to green.
This allows color-scheming more of SciTECO given that the
red, yellow and green terminal colors are not changed fundamentally
in the terminal's palette.
* info line is now also styled using STYLE_DEFAULT (reverse colors).
The Q-Register and buffer names are now written out using format_str()
which means that control characters are written out in REVERSE just
like in the command line.
String::canonicalize_ctl() is still used to canonicalize window
titles.
* Command line is now modelled as a curses Pad and "blitted" to the
command line window. This allowed simplification of the command line
drawing code and introduction of format_str().
The command line is now styled according to STYLE_DEFAULT (original
fg and bg colors).
The rubbed-out part of the command line can now longer be shown in
bold black - or even bold light black - since that is not visible in
all color themes. Instead it is now only shown in bold.
Command line theming problems will be gone once we use a Scintilla
view for the command line.
* The popup widget is now styled according to STYLE_CALLTIP.
* This means that all relevant parts of SciTECO's user interface
can now be themed. This allows the creation of themes that redefine
the terminal palette radically (e.g. Solarized) and the creation of
"bright" themes (e.g. Solarized/bright).
* theming of the non-scintilla-view parts of SciTECO is currently
unsupported on GTK+. The reason is that both the popup widget
and command line widgets have to be rewritten completely in GTK+
and are work in progress, so adapting the current code would be
a waste of time.
* Added a manual section about the UI and theming.
|
|
* ^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.
|
|
* both vmsg() and stdio_msg() behave like vprintf() are allowed
to leave their `va_list` in an undefined state.
* therefore when writing messages to stdio in addition to the
message line, we have to copy the argument list.
* fixes SEGFAULTs when trying to log any message
(but this bug did not manifest on every test system)
|
|
* this fixes the CTRL+V command
* PDC_set_function_key() may be used to implement a
"shutdown" function key macro later on.
* interruptions via CTRL+C are not (easily) possible
in this port of PDCurses - similar to XCurses.
However, I may ask the author if this is possible.
|
|
* CTRL+C interruptions are now possible.
ncurses/win32 needs a noraw() (bug!?) and
the console_ctrl_handler for this to work.
* setting the window title is not possible on this port
* stdio output can be redirected, even in interactive mode.
Also, we can write to stdout/stderr even in interactive mode
without disrupting the terminal.
After endwin(), the user will see these messages (if they
haven't been redirected).
* there's one bug left:
the Scintilla cursor is not drawn correctly at the end of
lines.
* part of the solution to #4
|
|
* enabled via --with-interface=xcurses, so we can configure
it automatically via xcurses-config.
This also adds XCURSES_CFLAGS and XCURSES_LIBS.
* The X11 window class name is set to "SciTECO".
X11 resource overrides can currently not be set via
sciteco's command line. The user may use .Xdefaults though.
* interruptions via CTRL+C are currently not supported.
Apparently, XCurses also does send SIGINT in cbreak() mode.
An XCurses-specific hack would be cumbersome.
* ~InterfaceCurses() should probably be rewritten.
Curses cleanup should be completely in restore_batch() as
the destructor may be called after Curses-cleanup handlers.
E.g. isendwin() SEGFAULTs on XCurses when called from the
destructor.
|
|
this avoids some problematic includes, so we no longer have
to #undef interface.
Also it should speed up building a bit.
|
|
* this was an issue at least in PDCurses/win32
|
|
* it now works as in the ncurses port: ^C during macro execution
interrupts just as SIGINT does; else it is read as a character.
* On Windows we need to register a special "console ctrl handler"
which is the analogue to a signal handler.
* It must be tested how ncurses/win32 and PDCurses/win32a behaves
in this regard. PDCurses/win32a is still actively maintained,
so we can also patch its source base.
* See #4
|
|
* relies on a patched version of Scinterm that allows you to
construct Scintilla objects, send messages etc. before Curses
is initialized.
The Scintilla and Scinterm submodules have been updated.
* This once and for all fixes batch mode and stdio redirections
in batch mode on all Curses platforms and operating systems.
* Fixes the ^C-does-not-interrupt bug on ncurses/UNIX.
See #4.
* On ncurses/UNIX we will still do a newterm()-initialization.
This allows us to keep stdout/stderr alone in case they are
redirected. This effectively allows redirecting SciTECO's
output into a file even in interactive mode.
ncurses/UNIX now behaves like, e.g. PDCurses/win32a and GTK+
in this regard.
* Curses environment variable handling fixed.
The environment registers are exported into the process environment
so that Curses environment variables can be set/modified by the
SciTECO profile.
* Use term.h for accessing terminfo now.
Explained set_window_title() limitations.
* fixed interruption via SIGINT. If the UI is waiting for user
input, SIGINT is effectively ignored instead of letting the
next character fail always.
* Updated sciteco(1) and sciteco(7): More options, environment variables
and signals documented. Also rewritten DESCRIPTION section
(different modes of operation).
|
|
* the registers beginning with "$" are exported into sub-process
environments. Therefore macros can now modify the environment
(variables) of commands executed via EC/EG.
A variable can be modified temporarily, e.g.:
[[$FOO] ^U[$FOO]bar$ EC...$ ][$FOO]
* SciTECO accesses the global environment registers instead of
using g_getenv(). Therefore now, tilde-expansion will always
use the current value of the "$HOME" register.
Previously, both register and environment variable could diverge.
* This effectively fully maps the process environment to a subset of
Q-Registers beginning with "$".
* This hasn't been implemented by mapping those registers to
special implementations that updates the process environment
directly, since g_setenv() is non-thread-safe on UNIX
and we're expected to have threads soon - at least in the GTK+ UI.
|
|
* If TERM is set but wrong, it might still fail. Errors are reported now.
* If $TERM is unset or empty, we refuse to start the interactive mode.
Unfortunately, we cannot easily let curses decide this since
newterm() does not work as expected.
* However this solution should be quite good: Either $TERM is empty - then
batch mode will work but not interactive mode.
Or it is not empty, then it is checked by the first call to newterm()
when initializing batch mode.
The chance of starting up interactive mode with a wrong $TERM
or in head-less environments is now quite low.
* This is most likely responsible for the PPA build issues.
|
|
Unfortunately, I cannot really test this curses port
since it is not supported by Windows 2000 (missing AttachConsole() API)
and it does not run very well in Wine.
Under Wine, it does not require the LINES and COLS variable to be set.
However, endwin() and the refresh later on result in a very unusable
state of operation. I cannot currently check whether this is true on
Windows XP or later.
|
|
|
|
when SciTECO interactive mode is started, the curses prog
mode is restored automatically.
Therefore it should already be set up correctly (after SciTECO
batch mode initialization).
This fixes console glitches on MinGW/PDCurses.
partial revert of commit 4dced2
|
|
* 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.
|
|
|
|
|
|
|
|
* I now understand better why the old initialization worked ;-)
By not calling initscr(), we could prevent some terminal setup
and screen clearing usually performed which would interfere with
with having a clean stdout stream.
However the Curses screen was still basically attached to the
terminal.
* That's why there was screen flickering in urxvt when calling sciteco
(even in batch mode). Also that's why calling batch-mode SciTECO
did not work from other Curses programs (including SciTECO).
* The new implementation directs Curses at /dev/null, so it will
completely stay away from /dev/tty.
* /dev/tty is associated with the Curses screen only when the
interactive mode is initialized. This works elegantly via
freopen() - there's no need to create a new Curses screen.
* This does currently not work on PDCurses where the batch mode
will still initscr() followed by endwin().
I should investigate how newterm() behaves there - especially
on Windows.
|
|
|
|
|
|
* it is now redrawn once after each key press, even if the
info line has not changed.
* This is because Interface::update_info() is called very often
in interactive mode, so it makes more sense to redraw it after user
interaction (where even unnecessary delays are not noticed so easily),
than thousands of times in a macro.
* This is especially important since InterfaceCurses::update_info() now
also sets the Window title on PDCurses - this is a very costly operation.
* The same optimization was applied to InterfaceGtk where it is probably
greatly responsible for the sluggishness of the UI.
The GTK+ changes are currently UNTESTED.
|
|
* use g_strconcat() instead of g_strdup_printf()
* InterfaceGtk::info_update() now longer has an arbitrary
255 byte limit on the length of the info line.
|
|
* this relied on Curses' control character drawing on Curses.
However it treats tab and line feed differently than other
control characters, so registers like "^Mfoo" could not be displayed
properly.
Even if we can configure Curses to display them correctly, we need
a "canonicalized", flat form of strings for other purposes (like setting
window titles. This is form is different from the formatting used
for command lines which may change anyway once we introduce Scintilla
mini buffers.
* therefore String::canonicalize_ctl() was introduced
* also set window title on PDCurses
|
|
Interface::main() was called
esp. fixes command line --help on PDCurses/win32
|
|
* 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.
|
|
* 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.
|
|
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()
|
|
|
|
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.
|
|
* simplified code
* fixed spurious empty lines in the popup which truncated file names/tokens
that would otherwise be displayed
* fixed memleak when freeing the popup entry list
|
|
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.
|
|
* does not change ./configure parameters
You still have to specifiy --with-interface=ncurses for
the Curses interface with default settings
* the "NCurses" UI was used for many different Curses
variants, so plain "Curses" is a better name.
|