diff options
author | mitchell <70453897+orbitalquark@users.noreply.github.com> | 2021-02-13 18:55:37 -0500 |
---|---|---|
committer | mitchell <70453897+orbitalquark@users.noreply.github.com> | 2021-02-13 18:55:37 -0500 |
commit | a81fbc0b621aef0eae640be3dc453eda409c70c2 (patch) | |
tree | ae9908e547e00b6c9064a105e83100d8515651f2 | |
parent | cd17224d42a019dc54e33b0ec787242165fcf90e (diff) |
Take advantage of Scinterm being able to use a native terminal caret.
Also change brace highlight style to not change the background color, as some
terminal cursors invert the current cell, so this would cause the highlighted
brace at the current position to "unhighlight", causing confusion.
This requires latest Scinterm.
-rw-r--r-- | src/Makefile | 4 | ||||
-rw-r--r-- | src/scintilla.patch | 25 | ||||
-rw-r--r-- | src/textadept.c | 5 | ||||
-rw-r--r-- | themes/term.lua | 2 |
4 files changed, 6 insertions, 30 deletions
diff --git a/src/Makefile b/src/Makefile index 655a9745..889e8d9e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -410,7 +410,9 @@ scintilla: scintilla.patch | $(scintilla_tgz) for patch in $^; do echo Applying $$patch; patch -d $@ -N -p1 < $$patch; done $(scinterm_zip): ; $(WGET) $(scinterm_url) -O $@ scinterm: scintilla/curses -scintilla/curses: | $(scinterm_zip) ; unzip -d $@ -j $| "*/*.cxx" "*/*.h" +scintilla/curses: | $(scinterm_zip) + unzip -d $@ $| && mv $@/*/* $@ + make -C $@ patch $(scintillua_zip): ; $(WGET) $(scintillua_url) -O $@ scintillua: ../lexers $(LexLPeg) ../lexers: | $(scintillua_zip) ; unzip -d $@ -j $| "*/lexers/*" -x "*/themes/*" diff --git a/src/scintilla.patch b/src/scintilla.patch index 6850f62f..751c96af 100644 --- a/src/scintilla.patch +++ b/src/scintilla.patch @@ -3,7 +3,6 @@ Scintilla changes: * Hijack SCI_LOADLEXERLIBRARY for programmatically setting input method. This is helpful on newer versions of macOS, where changing the input method is flaky. -* Update DrawTabArrowFn() signature in order to draw strikeout tabs. * Handle leading whitespace in XPM images in order to prevent crashes. diff -r 6e368ee248e4 gtk/ScintillaGTK.cxx @@ -21,30 +20,6 @@ diff -r 6e368ee248e4 gtk/ScintillaGTK.cxx case SCI_TARGETASUTF8: return TargetAsUTF8(CharPtrFromSPtr(lParam)); -diff -r 22b6bbb36280 src/EditView.cxx ---- a/src/EditView.cxx Sat Sep 05 07:55:08 2020 +1000 -+++ b/src/EditView.cxx Fri Oct 02 19:34:46 2020 -0400 -@@ -1951,7 +1951,7 @@ - if (!customDrawTabArrow) - DrawTabArrow(surface, rcTab, segmentTop, vsDraw); - else -- customDrawTabArrow(surface, rcTab, segmentTop); -+ customDrawTabArrow(surface, rcTab, segmentTop, vsDraw); - } - } - } else { -diff -r 22b6bbb36280 src/EditView.h ---- a/src/EditView.h Sat Sep 05 07:55:08 2020 +1000 -+++ b/src/EditView.h Fri Oct 02 19:34:46 2020 -0400 -@@ -40,7 +40,7 @@ - void DrawStyledText(Surface *surface, const ViewStyle &vs, int styleOffset, PRectangle rcText, - const StyledText &st, size_t start, size_t length, DrawPhase phase); - --typedef void (*DrawTabArrowFn)(Surface *surface, PRectangle rcTab, int ymid); -+typedef void (*DrawTabArrowFn)(Surface *surface, PRectangle rcTab, int ymid, const ViewStyle &vsDraw); - - class LineTabstops; - diff -r 22b6bbb36280 src/XPM.cxx --- a/src/XPM.cxx Sat Sep 05 07:55:08 2020 +1000 +++ b/src/XPM.cxx Fri Oct 02 20:32:13 2020 -0400 diff --git a/src/textadept.c b/src/textadept.c index 43b58f09..f2e4129e 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -364,6 +364,8 @@ static void refresh_all() { refresh_pane(pane); if (command_entry_active) scintilla_noutrefresh(command_entry); refresh(); + if (findbox) return; + scintilla_update_cursor(!command_entry_active ? focused_view : command_entry); } /** @@ -455,7 +457,6 @@ static int focus_find(lua_State *L) { setCDKEntryPostProcess(find_entry, find_keypress, NULL); char *clipboard = scintilla_get_clipboard(focused_view, NULL); GPasteBuffer = copyChar(clipboard); // set the CDK paste buffer - curs_set(1); refreshCDKScreen(findbox), activateCDKEntry(focused_entry = find_entry, NULL); while (focused_entry->exitType == vNORMAL || focused_entry->exitType == vNEVER_ACTIVATED) { @@ -466,7 +467,6 @@ static int focus_find(lua_State *L) { find_entry->exitType = repl_entry->exitType = vNEVER_ACTIVATED; refreshCDKScreen(findbox), activateCDKEntry(focused_entry, NULL); } - curs_set(0); // Set Scintilla clipboard with new CDK paste buffer if necessary. if (strcmp(clipboard, GPasteBuffer) != 0) SS(focused_view, SCI_COPYTEXT, strlen(GPasteBuffer), (sptr_t)GPasteBuffer); @@ -2504,7 +2504,6 @@ int main(int argc, char **argv) { ta_tk = termkey_new(0, 0); setlocale(LC_CTYPE, ""); // for displaying UTF-8 characters properly initscr(); // raw()/cbreak() and noecho() are taken care of in libtermkey - curs_set(0); // disable cursor when Scintilla has focus #if NCURSES_REENTRANT ESCDELAY = getenv("ESCDELAY") ? atoi(getenv("ESCDELAY")) : 100; #endif diff --git a/themes/term.lua b/themes/term.lua index 8e24dfe0..804bcc18 100644 --- a/themes/term.lua +++ b/themes/term.lua @@ -29,7 +29,7 @@ colors.light_white = 0xFFFFFF -- Predefined styles. styles.default = {fore = colors.white, back = colors.black} styles.line_number = {fore = colors.black, bold = true} -styles.brace_light = {fore = colors.black, back = colors.white} +styles.brace_light = {fore = colors.yellow, bold = true} --styles.control_char = --styles.indent_guide = styles.call_tip = {fore = colors.white, back = colors.black} |