aboutsummaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2024-09-09allow Unicode characters in command line arguments (refs #5)Robin Haberkorn2-4/+8
* the locale must be initialized very early before g_option_context_parse() * will allow UTF-8 characters in the test suite
2024-09-09Glyph to byte offset mapping is now using the line character index (refs #5)Robin Haberkorn7-68/+130
* This works reasonably well unless lines are exceedingly long (as on a line we always count characters). The following test case is still slow (on Unicode buffers): 10000<@I/XX/> <%a-1:J;> While the following is now also fast: 10000<@I/X^J/> <%a-1:J;> * Commands with relative character offsets (C, R, A, D) have a special optimization where they always count characters beginning at dot, as long as the argument is now exceedingly large. This means they are fast even on exceedingly long lines. * The remaining commands (search, EC/EG, Xq) now accept glyph indexes.
2024-09-09implemented Unicode support for rubin/rubout and a number of commands (WIP) ↵Robin Haberkorn5-44/+148
(refs #5) certain test cases are still way too slow: 10000<@I/X^J/> 20000<R> or 10000<@I/X^J/> 20000<%a-1J> SCI_ALLOCATELINECHARACTERINDEX does not help much here. It probably speeds up only SCI_LINEFROMINDEXPOSITION and SCI_INDEXPOSITIONFROMLINE.
2024-09-09prefer libncursesw (widechar variant) (refs #5)Robin Haberkorn3-4/+9
* Some platforms like Ubuntu actually ship widechar and non-widechar versions of ncurses with different pkg-config files. Other platforms like FreeBSD will ship an "ncursesw" and "ncurses" pkg-config file but both point to the same wide-char library anyway. * Currently we are not using wide-char APIs to ensure maximum compatibility even with embedded systems where ncurses might be built without widechar support. But in order to handle Unicode correctly, we still need to link against the widechar version of ncurses (if available). * Compilation on platforms without a widechar ncurses is now handled by the common AC_CHECK_LIB() fallback (which might actually find a widechar version anyway if it just didn't install the pkg-config file). If necessary, we could also check for the "ncurses" package if "ncursesw" is not found. * This fixes Unicode display and input on Ubuntu.
2024-09-09input and displaying of Unicode characters is now possible (refs #5)Robin Haberkorn6-27/+73
* All non-ASCII characters are inserted as Unicode. On Curses, this also requires a properly set up locale. * We still do not need any widechar Curses, as waddch() handles multibyte characters on ncurses. We will see whether there is any Curses variant that strictly requires wadd_wch(). If this will be an exception, we might keep both widechar and non-widechar support. * By convention gsize is used exclusively for byte sizes. Character offsets or lengths use int or long.
2024-08-28fixed retrieval of characters with codes larger than 127 - always return ↵Robin Haberkorn3-5/+10
unsigned integer * SCI_GETCHARAT is internally casted to `char`, which may be signed. Characters > 127 therefore become negative and stay so when casted to sptr_t. We therefore cast it back to guchar (unsigned char). * The same is true whenever returning a string's character to SciTECO (teco_int_t) as our string type is `gchar *`. * <^^x> now also works for those characters. Eventually, the parser will probably become UTF8-aware and this will have to be done differently.
2024-08-24win32 CI: also set PDCURSES_CFLAGSRobin Haberkorn1-1/+4
Should fix `make distcheck`.
2024-08-23hopefully fixed the Windows CI testsRobin Haberkorn1-1/+2
* `make distcheck` will try to build against libncurses, which is not installed. Therefore, I set DISTCHECK_CONFIGURE_FLAGS in order to force it to PDCurses.
2024-08-23debian package: updated copyright to 2024Robin Haberkorn1-1/+1
2024-08-23Lexilla: the troff branch has been merged, so we point to the upstream ↵Robin Haberkorn1-0/+0
repository again
2024-08-23fully support out of tree buildsRobin Haberkorn12-88/+57
* You no longer have to copy contrib/scintilla, contrib/scinterm and contrib/lexilla manually to the build directory. * It turns out, that Scintilla/Lexilla was supporting this since 2016. Scintilla allows pointing to a source directory (srdir) and Lexilla to a binary directory (DIR_O). * For Scinterm I opened a pull request in order to add srcdir/basedir variables: https://github.com/orbitalquark/scinterm/pull/21 * `make distcheck` is therefore now also fixed. * The FreeBSD package is now allowed to build out of source. I haven't tested it yet. * See also https://github.com/ScintillaOrg/lexilla/issues/266
2024-08-22some updates on Scintilla/Lexilla out-of-tree buildsRobin Haberkorn2-0/+7
2024-08-22bumped Lexilla submodule: it has just been rebasedRobin Haberkorn1-0/+0
This should not change anything functionally.
2024-08-21reverted adf0c46a70b20d187b62c596052f643a6673f68f and updated Scinterm to v5.0Robin Haberkorn2-1/+1
* The patch for indicator styles turned out to be unnecessary, so I switched back to the mainline Scinterm repository. * Scinterm is now on the latest commit that still supports my version of Scintilla (v5.3.4).
2024-08-21Curses UI: fixed drawing of boxed indicatorsRobin Haberkorn3-5/+2
* The scinterm submodule temporarily points to my own fork. * This is necessary for the aspell macro on Curses. See https://github.com/rhaberkorn/sciteco/wiki/Useful-Macros#spell-checker * See also https://github.com/orbitalquark/scinterm/pull/19
2024-08-18added troff/nroff lexerRobin Haberkorn7-4/+90
* This is optimized for Groff, but works for Heirloom Troff and Neatroff as well. Currently, the Heirloom and Neatroff requests are just added ontop of the Groff ones. Theoretically, we could also try to separate the keyword lists into a base K&R set with Groff, Heirloom and Neatroff ontop. * The lexer necessarily has many restrictions, as Troff is fundamentally unparseable (like classic TECO) and needs a lot of per-request knowledge. * The "*.mm" extension has been removed from the lexers/cpp.tes. I don't know what language this was for, and I prefer `*.mm` files to be considered Troff. * Temporarily changed the lexilla submodule URL. The corresponding Lexila lexer is in the process of being upstreamed. Once it is, I will probably revert the submodule to the official repository, as the "troff" branch is not stable (can be rebased).
2024-05-23nightly builds: avoid uploading pkg2appimage.AppImageRobin Haberkorn1-3/+3
2024-05-22Gtk AppImage: exclude libglib to improve portabilityRobin Haberkorn1-0/+4
* Since they blacklist Pango among other things, it would use the Pango from the host system with the glib from the AppImage, which resulted in a version mismatch on Linux Mint 21.1. * It is now confirmed to work at least on Linux Mint 21.1. * The Curses AppImage still bundles libglib as SciTECO should be the only thing referencing its functions.
2024-05-22AppImage: fixed the Ubuntu package download URLsRobin Haberkorn2-2/+2
2024-05-22build and upload AppImages as part of nightly buildsRobin Haberkorn5-5/+82
2024-05-22ci.yml: hopefully fixed Mac OS CI builds - it appears we need sudo nowRobin Haberkorn1-1/+1
2024-05-22updated CI workflows: bumped some versionsRobin Haberkorn3-13/+20
* MacOS packages are now built on macos-12 since macos-11 has been deprecated.
2024-03-27don't check for -pthread on MinGWRobin Haberkorn1-7/+8
* probably not necessary for std::thread support in Scintilla * should fix MinGW nightly builds
2024-02-14README: insert image using markdown tag and try to center iconRobin Haberkorn1-3/+2
2024-02-14README: image fixesRobin Haberkorn1-1/+2
2024-02-14README: added demo gifRobin Haberkorn1-1/+4
2024-02-08updated TODORobin Haberkorn1-12/+48
2024-02-08fixed expressions like `1,(2)` or `(1),(2)`: they are reported as two ↵Robin Haberkorn2-0/+4
numbers now * Instead of TECO_OP_NEW, there should perhaps simply be a flag of whether `,` was used.
2024-02-06fixed the power (^*) operator: did not handle corner cases and was inefficientRobin Haberkorn2-1/+31
* in fact, with a negative exponent the previous naive implementation would even hang indefinitely! * Now uses the squaring algorithm. This is slightly longer but significantly more efficient. * added test cases
2024-02-06avoid Groff warnings due to `\` escapesRobin Haberkorn2-3/+3
* It's generally a bad idea to pass backslashes as a glyph in macro arguments, even as `\\` since this could easily be interpreted as an escape. * Instead we now always use `\[rs]`.
2024-02-06use bool instead of guint for 1-bit fieldsRobin Haberkorn2-7/+10
* gboolean cannot be used since it is a signed type * bool is still more readable, even though we mostly use glib typedefs. * AFAIK the glib types are deprecated, so sooner or later we will switch to stdint/stdbool types anyway.
2024-02-03GTK: allow disabling client-side decorations by setting $GTK_CSD=0Robin Haberkorn2-7/+6
* This is the same variable used by gtk3-nocsd, but we will now work even without preloading any libraries. Also, it turns out that gtk3-nocsd does not ship as a FreeBSD port and hasn't been updated in a long time. * Setting this in .teco_ini wouldn't have been easy since the teco_interface_init() is called before any TECO code. Also, you might not even want disable this globally but depending on the window manager. * Therefore, you are advised to `export GTK_CSD=0` in ~/.xsession. * The --no-csd command line option is kept for the time being, but probably serves no more purpose.
2024-02-03Gtk: set icons a bit later after calling gtk_widget_show()Robin Haberkorn1-39/+44
* Also turns out, I will have to use gtk_window_set_icon_list(). * This fixes icons in tabbed and st (when embedding SciTECO).
2024-01-28updated TODORobin Haberkorn1-10/+9
2024-01-28cursor movement via fnkeys.tes now preserves the column as in most text editorsRobin Haberkorn3-28/+67
* Horizontal movements (left/right cursor keys) establish the current column and vertical movements (up/down) will try to keep on that column. * This has long been problematic in SciTECO as it requires state that gets reversed when the command line replacement takes place. * I experimented with encoding the current horizontal position into the braced movement operations as in (123C5U$), but I decided that this was clumsy and I generally did not want these expressions to become even larger. * Instead I decided to add some minimal support to the C core in the form of 4EJ which is like a number register only that it does NOT get reversed on rubout. This is exploited by the fnkeys.tes macros by storing the current position beyond replacements. * In theory, this should be a property of the document, but we cannot easily store custom parameters per document. So instead, there is just one global variable. When editing another buffer, it gets reset to .ESGETCOLUMN$$. sample.teco_ini has been updated. * The current X position only makes sense in the context of fnkeys.tes, as TECO commands like <C> are not necessarily "horizonal" movements. For the same reason, the core does not try to initialize 4EJ automatically when editing new buffers. It's entirely left to the TECO macros. * The commandline replacement is more robust now as it checks braced expressions at the end of the command line more thorougly. It will no longer swallow all preceding braced expressions. Only if they are at least 4 characters in length and end in `C)` or `R)`.
2024-01-22FreeBSD port: allow `make test` and appease `make check-plist`Robin Haberkorn1-0/+6
2024-01-22FreeBSD port: moved xvfb-run.sh to scripts/ subdirRobin Haberkorn2-1/+1
2024-01-21updated copyright to 2024Robin Haberkorn61-61/+61
2024-01-21FreeBSD port: I am now the maintainer and will try to submit it to the ↵Robin Haberkorn1-2/+2
FreeBSD ports tree * see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276492 * also the license is GPLv3+ to be precise
2024-01-20fnkeys.tes: support zooming via F9/F10Robin Haberkorn1-0/+9
* Works only in Gtk of course and only in the parser start state. * Since its side effects can neither be reversed, nor does it have any side effects on the editor state, we can completely rub it out. * Currently, it will only affect the current buffer and only the text area. It would be trivial to apply the zoom to the commandline widget as well (FIXME?). There is currently no way that the zoom value or any font size could be passed to the CSS, though. So the auto-completion overlay could only be zoomed if Gtk supports a zoom factor as well.
2024-01-20removed nonsensical line from sciteco(7) man pageRobin Haberkorn1-1/+0
* was introduced in e7867fb0
2024-01-20fixed Clang warnings about one-bit-wide boolean integers ↵Robin Haberkorn2-7/+7
(-Wsingle-bit-bitfield-constant-conversion) * gboolean is defined as gint which is a signed type. A gboolean 1-bit-wide bitfield cannot have the values 0 and 1 but only 0 and -1. * This wasn't practically a bug unless you would try to compare one of those bitfields with TRUE. * All of those bitfields are now guint, even though this is less self-documenting.
2024-01-13README: mention aksr's Arch packageRobin Haberkorn1-2/+3
* This port is quite basic and does not yet allow building Gtk versions.
2024-01-13fixed <EC$> assertions: specifying empty command strings was undefinedRobin Haberkorn2-19/+23
* passing an empty command string down to the shell would always do nothing, so it doesn't make sense to support that. * for the time being, we generate a proper error * in the future, it might make sense to define some special behavior like repeating the last command - but EC does not currently save the command line anywhere. * The generated documentation is currently ugly (FIXME). mandatory parameters are not properly detected by tedoc and we cannot keep apart Q-Registers from mandatory parameters either. Also, we should allow <param> markup in command summaries.
2023-07-23FreeBSD port: fixed the LEXILLA optionRobin Haberkorn2-76/+77
* The lexer scripts are not installed if the LEXILLA option is disabled, so they need to be excluded from pkg-plist.
2023-07-23FreeBSD port: modified the pkg-message.in to use UCL formatRobin Haberkorn1-0/+7
* The plain text format is deprecated. * Thanks to Bob Eager.
2023-07-06fixed ]$ and ]~ (pop from Q-Reg stack to special Q-Registers)Robin Haberkorn2-164/+90
* This was setting only the teco_doc but wasn't calling the necessary set_string() methods. * The idiom [$ FG...$ ]$ to change the working directory temporarily now works. * Similarily you can now write [~ ^U~...$ ]~ to change the clipboard temporarily. * Added test suite cases. The clipboard is not tested since it's not supported everywhere and would interfer with the host system. * Resolved lots of redundancies in qreg.c. The clipboard and workingdir Q-Regs have lots in common. This is now abstracted in the "external" Q-Reg base "class" (ie. via initializer TECO_INIT_QREG_EXTERNAL()). It uses vtable calls which is slightly more inefficient than per register implementations, but avoiding redundancies is probably more important.
2023-07-05set target release to v2.1.0Robin Haberkorn1-1/+1
2023-07-03fixup 69b4bbb8341cfda5d8456ccbf951034d63e4340c: added missing Makefile for ↵Robin Haberkorn1-0/+87
FreeBSD port * Makefiles are in .gitignore.
2023-07-03introduced TECO_DEBUG_CLEANUP to mark destructors that should only be used ↵Robin Haberkorn10-29/+19
for debug builds * There is cleanup that is not strictly necessary, because it only frees memory which is freed on program termination anyway. * However, it helps to explicitly free everything for debugging memory leaks via Valgrind. * The new macro reduces the number of #ifdef statements. * On NDEBUG, the code of these functions will still be eliminated. * If functions are referenced only from the destructor, there will be no unused function warnings, even in NDEBUG.