forked from aniani/vim
patch 8.2.0785: libvterm code lags behind the upstream version
Problem: Libvterm code lags behind the upstream version. Solution: Include revisions 734 - 740.
This commit is contained in:
parent
94d729cbe8
commit
6fc3b59ee9
22
src/libvterm/CONTRIBUTING
Normal file
22
src/libvterm/CONTRIBUTING
Normal file
@ -0,0 +1,22 @@
|
||||
How to Contribute
|
||||
-----------------
|
||||
|
||||
The main resources for this library are:
|
||||
|
||||
Launchpad
|
||||
https://launchpad.net/libvterm
|
||||
|
||||
Freenode:
|
||||
##tty or #tickit on irc.freenode.net
|
||||
|
||||
Email:
|
||||
Paul "LeoNerd" Evans <leonerd@leonerd.org.uk>
|
||||
|
||||
|
||||
Bug reports and feature requests can be sent to any of the above resources.
|
||||
|
||||
New features, bug patches, etc.. should in the first instance be discussed via
|
||||
any of the resources listed above, before starting work on the actual code.
|
||||
There may be future plans or development already in-progress that could be
|
||||
affected so it is better to discuss the ideas first before starting work
|
||||
actually writing any code.
|
@ -37,13 +37,13 @@ INCFILES=$(TBLFILES:.tbl=.inc)
|
||||
HFILES_INT=$(sort $(wildcard src/*.h)) $(HFILES)
|
||||
|
||||
VERSION_MAJOR=0
|
||||
VERSION_MINOR=0
|
||||
VERSION_MINOR=1
|
||||
|
||||
VERSION_CURRENT=0
|
||||
VERSION_REVISION=0
|
||||
VERSION_AGE=0
|
||||
|
||||
VERSION=0
|
||||
VERSION=$(VERSION_MAJOR).$(VERSION_MINOR)
|
||||
|
||||
PREFIX=/usr/local
|
||||
BINDIR=$(PREFIX)/bin
|
||||
@ -110,13 +110,11 @@ install-bin: $(BINFILES)
|
||||
|
||||
# DIST CUT
|
||||
|
||||
VERSION=$(VERSION_MAJOR).$(VERSION_MINOR)
|
||||
|
||||
DISTDIR=libvterm-$(VERSION)
|
||||
|
||||
distdir: $(INCFILES)
|
||||
mkdir __distdir
|
||||
cp LICENSE __distdir
|
||||
cp LICENSE CONTRIBUTING __distdir
|
||||
mkdir __distdir/src
|
||||
cp src/*.c src/*.h src/*.inc __distdir/src
|
||||
mkdir __distdir/src/encoding
|
||||
|
@ -167,6 +167,7 @@ between states.
|
||||
123 SGR 1 = Bold on
|
||||
SGR 3 = Italic on
|
||||
123 SGR 4 = Underline single
|
||||
SGR 4:x = Underline style
|
||||
123 SGR 5 = Blink on
|
||||
123 SGR 7 = Reverse on
|
||||
SGR 9 = Strikethrough on
|
||||
|
@ -19,6 +19,12 @@ extern "C" {
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned int uint32_t;
|
||||
|
||||
#define VTERM_VERSION_MAJOR 0
|
||||
#define VTERM_VERSION_MINOR 1
|
||||
|
||||
#define VTERM_CHECK_VERSION \
|
||||
vterm_check_version(VTERM_VERSION_MAJOR, VTERM_VERSION_MINOR)
|
||||
|
||||
typedef struct VTerm VTerm;
|
||||
typedef struct VTermState VTermState;
|
||||
typedef struct VTermScreen VTermScreen;
|
||||
@ -175,6 +181,8 @@ typedef struct {
|
||||
void (*free)(void *ptr, void *allocdata);
|
||||
} VTermAllocatorFunctions;
|
||||
|
||||
void vterm_check_version(int major, int minor);
|
||||
|
||||
// Allocate and initialize a new terminal with default allocators.
|
||||
VTerm *vterm_new(int rows, int cols);
|
||||
|
||||
@ -330,6 +338,13 @@ typedef struct {
|
||||
unsigned int dhl : 2; // On a DECDHL line (1=top 2=bottom)
|
||||
} VTermScreenCellAttrs;
|
||||
|
||||
enum {
|
||||
VTERM_UNDERLINE_OFF,
|
||||
VTERM_UNDERLINE_SINGLE,
|
||||
VTERM_UNDERLINE_DOUBLE,
|
||||
VTERM_UNDERLINE_CURLY,
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
#define VTERM_MAX_CHARS_PER_CELL 6
|
||||
uint32_t chars[VTERM_MAX_CHARS_PER_CELL];
|
||||
|
@ -261,9 +261,26 @@ INTERNAL void vterm_state_setpen(VTermState *state, const long args[], int argco
|
||||
setpenattr_bool(state, VTERM_ATTR_ITALIC, 1);
|
||||
break;
|
||||
|
||||
case 4: // Underline single
|
||||
state->pen.underline = 1;
|
||||
setpenattr_int(state, VTERM_ATTR_UNDERLINE, 1);
|
||||
case 4: // Underline
|
||||
state->pen.underline = VTERM_UNDERLINE_SINGLE;
|
||||
if(CSI_ARG_HAS_MORE(args[argi])) {
|
||||
argi++;
|
||||
switch(CSI_ARG(args[argi])) {
|
||||
case 0:
|
||||
state->pen.underline = 0;
|
||||
break;
|
||||
case 1:
|
||||
state->pen.underline = VTERM_UNDERLINE_SINGLE;
|
||||
break;
|
||||
case 2:
|
||||
state->pen.underline = VTERM_UNDERLINE_DOUBLE;
|
||||
break;
|
||||
case 3:
|
||||
state->pen.underline = VTERM_UNDERLINE_CURLY;
|
||||
break;
|
||||
}
|
||||
}
|
||||
setpenattr_int(state, VTERM_ATTR_UNDERLINE, state->pen.underline);
|
||||
break;
|
||||
|
||||
case 5: // Blink
|
||||
@ -288,8 +305,8 @@ INTERNAL void vterm_state_setpen(VTermState *state, const long args[], int argco
|
||||
break;
|
||||
|
||||
case 21: // Underline double
|
||||
state->pen.underline = 2;
|
||||
setpenattr_int(state, VTERM_ATTR_UNDERLINE, 2);
|
||||
state->pen.underline = VTERM_UNDERLINE_DOUBLE;
|
||||
setpenattr_int(state, VTERM_ATTR_UNDERLINE, state->pen.underline);
|
||||
break;
|
||||
|
||||
case 22: // Bold off
|
||||
@ -405,8 +422,10 @@ INTERNAL int vterm_state_getpen(VTermState *state, long args[], int argcount UNU
|
||||
if(state->pen.italic)
|
||||
args[argi++] = 3;
|
||||
|
||||
if(state->pen.underline == 1)
|
||||
if(state->pen.underline == VTERM_UNDERLINE_SINGLE)
|
||||
args[argi++] = 4;
|
||||
if(state->pen.underline == VTERM_UNDERLINE_CURLY)
|
||||
args[argi++] = 4 | CSI_ARG_FLAG_MORE, args[argi++] = 3;
|
||||
|
||||
if(state->pen.blink)
|
||||
args[argi++] = 5;
|
||||
@ -420,7 +439,7 @@ INTERNAL int vterm_state_getpen(VTermState *state, long args[], int argcount UNU
|
||||
if(state->pen.font)
|
||||
args[argi++] = 10 + state->pen.font;
|
||||
|
||||
if(state->pen.underline == 2)
|
||||
if(state->pen.underline == VTERM_UNDERLINE_DOUBLE)
|
||||
args[argi++] = 21;
|
||||
|
||||
if(state->fg_index >= 0 && state->fg_index < 8)
|
||||
|
@ -406,3 +406,20 @@ void vterm_copy_cells(VTermRect dest,
|
||||
(*copycell)(pos, srcpos, user);
|
||||
}
|
||||
}
|
||||
|
||||
void vterm_check_version(int major, int minor)
|
||||
{
|
||||
if(major != VTERM_VERSION_MAJOR) {
|
||||
fprintf(stderr, "libvterm major version mismatch; %d (wants) != %d (library)\n",
|
||||
major, VTERM_VERSION_MAJOR);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if(minor > VTERM_VERSION_MINOR) {
|
||||
fprintf(stderr, "libvterm minor version mismatch; %d (wants) > %d (library)\n",
|
||||
minor, VTERM_VERSION_MINOR);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Happy
|
||||
}
|
||||
|
@ -28,6 +28,14 @@ PUSH "\e[21m"
|
||||
?pen underline = 2
|
||||
PUSH "\e[24m"
|
||||
?pen underline = 0
|
||||
PUSH "\e[4m\e[4:0m"
|
||||
?pen underline = 0
|
||||
PUSH "\e[4:1m"
|
||||
?pen underline = 1
|
||||
PUSH "\e[4:2m"
|
||||
?pen underline = 2
|
||||
PUSH "\e[4:3m"
|
||||
?pen underline = 3
|
||||
PUSH "\e[4m\e[m"
|
||||
?pen underline = 0
|
||||
|
||||
|
@ -177,9 +177,11 @@ open my $test, "<", $ARGV[0] or die "Cannot open test script $ARGV[0] - $!";
|
||||
|
||||
while( my $line = <$test> ) {
|
||||
$line =~ s/^\s+//;
|
||||
next if $line =~ m/^(?:#|$)/;
|
||||
|
||||
chomp $line;
|
||||
|
||||
next if $line =~ m/^(?:#|$)/;
|
||||
last if $line eq "__END__";
|
||||
|
||||
do_line( $line );
|
||||
}
|
||||
|
||||
|
@ -746,6 +746,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
785,
|
||||
/**/
|
||||
784,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user