GithubHelp home page GithubHelp logo

orbitalquark / scinterm Goto Github PK

View Code? Open in Web Editor NEW
20.0 6.0 0.0 2.84 MB

Scinterm is a curses platform for Scintilla that supports ncurses, PDCurses, and X/Open Curses.

Home Page: https://orbitalquark.github.io/scinterm

License: MIT License

Makefile 2.85% C++ 84.25% C 12.91%
scintilla curses pdcurses editors terminal

scinterm's Introduction

Scinterm

Scinterm is a curses platform for Scintilla that supports ncurses, PDCurses, and X/Open Curses.

Scinterm

It is highly recommended to run Scinterm in a UTF-8-aware terminal with a font that supports many UTF-8 characters ("DejaVu Sans Mono" is one of them), since Scinterm makes use of UTF-8 characters when drawing wrap symbols, some marker symbols, and call tip arrows.

Requirements

  • Scinterm 5.x requires Scintilla 5.3.0 - 5.x.
  • Scinterm 4.x requires Scintilla 5.3.0 - 5.x.
  • Scinterm 3.2 requires Scintilla 5.1.4 - 5.2.4.
  • Scinterm 3.1 requires Scintilla 5.1.0 - 5.1.1.
  • Scinterm 3.0 requires Scintilla 3.20.0 - 3.21.0.
  • Scinterm 2.0 requires Scintilla 3.20.0 - 3.21.0.
  • Scinterm 1.12 requires Scintilla 3.11.0 - 3.11.2.
  • Scinterm 1.11 requires Scintilla 3.10.0 - 3.10.6.
  • Scinterm 1.10 requires Scintilla 3.8.0.
  • Scinterm 1.9 requires Scintilla 3.7.5 - 3.7.6.
  • Scinterm 1.8 requires Scintilla 3.6.3 - 3.7.4.
  • Scinterm 1.7 requires Scintilla 3.6.3 - 3.7.4.
  • Scinterm 1.6 requires Scintilla 3.5.5 - 3.6.2.
  • Scinterm 1.5 requires Scintilla 3.5.2 - 3.5.4.
  • Scinterm 1.4 requires Scintilla 3.5.0 - 3.5.1.
  • Scinterm 1.3 requires Scintilla 3.4.2 - 3.4.4.
  • Scinterm 1.2 requires Scintilla 3.3.7 - 3.4.1.
  • Scinterm 1.1 requires Scintilla 3.2.2 - 3.3.6.
  • Scinterm 1.0 requires Scintilla 3.2.2 - 3.3.6.

Download

Scinterm releases can be found here.

Compile

After downloading Scinterm, it is recommended to unzip it into the top-level directory of an instance of Scintilla, similar to other Scintilla platforms like gtk/ and win32/. After that, go into the Scinterm directory and run make patch followed by make to build the usual ../bin/scintilla.a.

You can optionally build the demo application, jinx, by going into jinx/ and running make. Pressing the q key quits the demo. Note that the demo assumes lexilla is a sibling to the ../../../scintilla directory, and that it has been built (i.e. ../../../lexilla/bin/liblexilla.so exists).

Usage

Scinterm's Application Programming Interface (API) documentation is located in the project's docs/ directory and covers how to create and interact with a Scintilla widget in a terminal application.

Curses Compatibility

Scinterm lacks some Scintilla features due to the terminal's constraints:

  • Any settings with alpha values are not supported.
  • Autocompletion lists cannot show images (pixmap surfaces are not supported). Instead, they show the first character in the string passed to SCI_REGISTERIMAGE.
  • Buffered drawing is not supported.
  • Caret settings like period, line style, and width are not supported (terminals use block carets with their own period definitions).
  • Code pages other than UTF-8 have not been tested and it is possible some curses implementations do not support them.
  • Drag and drop is not supported.
  • Edge lines are not displayed properly (the line is drawn over by text lines).
  • Extra ascent and descent for lines is not supported.
  • Fold lines cannot be drawn above or below lines.
  • Hotspot underlines are not drawn on mouse hover (surface->FillRectangle() is not supported).
  • Indicators other than INDIC_ROUNDBOX and INDIC_STRAIGHTBOX are not drawn (surface->LineTo() and surface->FillRectangle() are not supported for drawing indicator shapes and pixmap surfaces are not supported). Translucent drawing and rounded corners are not supported either.
  • Some complex marker types are not drawn properly or at all (pixmap surfaces are not supported and surface->LineTo() is not supported for drawing some marker shapes).
  • Mouse cursor types are not supported.
  • Up to 16 colors are supported, regardless of how many colors the terminal supports. They are (in "0xBBGGRR" format): black (0x000000), red (0x000080), green (0x008000), yellow (0x008080), blue (0x800000), magenta (0x800080), cyan (0x808000), white (0xC0C0C0), light black (0x404040), light red (0x0000FF), light green (0x00FF00), light yellow (0x00FFFF), light blue (0xFF0000), light magenta (0xFF00FF), light cyan (0xFFFF00), and light white (0xFFFFFF). Even if your terminal uses a different color map, you must use these color values with Scintilla; unrecognized colors are set to white by default. For some terminals, you may need to set a lexer style's bold attribute in order to use the light color variant.
  • Some styles settings like font name, font size, and italic do not display properly (terminals use one only font, size and variant).
  • X selections (primary and secondary) are not integrated into the clipboard.
  • Zoom is not supported (terminal font size is fixed).
  • When using the mouse in the Windows console, Shift+Double-click extends selections and quadruple-clicking inside a selection collapses it.

Contribute

Scinterm is open source. Feel free to report bugs and submit patches. Thanks to everyone who has contributed.

scinterm's People

Contributors

orbitalquark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

scinterm's Issues

Use Native Caret Instead of Artificial One

Currently, Scinterm draws the caret like it draws text, indicators, etc. The
actual curses screen cursor position ends up being at the bottom right and
should often be hidden. Ideally, instead of drawing a caret, Scinterm should set
the current curses position so that the caret behaves like the user's terminal
cursor.

Hide terminal caret when the caret position is off-screen

When scrolling a view such that the Scintilla caret is off-screen, the terminal caret is still visible at the bottom right of the view after drawing. Ideally it would be hidden in these cases, but only if the view has active focus (a split view with an off-screen caret shouldn't hide the on-screen caret for the current view).

Cannot compile the current version, throws error "invalid conversion"

I downloaded the most recent version of scintilla (realease 4.4.6) for Linux. I then cloned the current head of this repository and copied into scintillas root directory. I cd'd into scintilla/scinterm/ and ran make, just as specified in the readme. After a while of compiling, I received the following error message:

g++ -std=c++17 -pedantic -DCURSES -DSCI_LEXER -I ../include -I ../src -I ../lexlib -Wall -DNDEBUG -Os  -c ScintillaCurses.cxx
ScintillaCurses.cxx: In constructor ‘ScintillaCurses::ScintillaCurses(void (*)(void*, int, SCNotification*, void*), void*)’:
ScintillaCurses.cxx:973:31: error: invalid conversion from ‘void (*)(Scintilla::Surface*, Scintilla::PRectangle, int, const Scintilla::ViewStyle&)’ to ‘Scintilla::DrawTabArrowFn’ {aka ‘void (*)(Scintilla::Surface*, Scintilla::PRectangle, int)’} [-fpermissive]
     view.customDrawTabArrow = DrawTabArrow; // draw text arrows for tabs
                               ^~~~~~~~~~~~
make: *** [Makefile:35: ScintillaCurses.o] Error 1

I ran this inside a Debian-WSL.
Any help is appreciated.

Cursor encroaches into other split views

Given two side-by-side views, go to the end of a long line in the left view that is clipped by the right view. The cursor will be in the right view rather than scrolling the left view.

Support Two-Phase Drawing

Single-phase drawing in Scintilla is deprecated, yet Scinterm currently relies
on it. Scinterm will need to support two phase drawing, likely by Scintilla 5.

Among other things:

  • Ensure brace match indicators can be used -- only styles can be used right
    now.
  • Ensure line edge mode only updates the column's background color, not
    overwrites an existing character.

what make patch is doing

Hi, thanks for great project!
Could you please explain what make patch is doing? I am concerned that it modifies my scintilla source tree that I use for other (Gtk) projects.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.