mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
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)
|
HFILES_INT=$(sort $(wildcard src/*.h)) $(HFILES)
|
||||||
|
|
||||||
VERSION_MAJOR=0
|
VERSION_MAJOR=0
|
||||||
VERSION_MINOR=0
|
VERSION_MINOR=1
|
||||||
|
|
||||||
VERSION_CURRENT=0
|
VERSION_CURRENT=0
|
||||||
VERSION_REVISION=0
|
VERSION_REVISION=0
|
||||||
VERSION_AGE=0
|
VERSION_AGE=0
|
||||||
|
|
||||||
VERSION=0
|
VERSION=$(VERSION_MAJOR).$(VERSION_MINOR)
|
||||||
|
|
||||||
PREFIX=/usr/local
|
PREFIX=/usr/local
|
||||||
BINDIR=$(PREFIX)/bin
|
BINDIR=$(PREFIX)/bin
|
||||||
@ -110,13 +110,11 @@ install-bin: $(BINFILES)
|
|||||||
|
|
||||||
# DIST CUT
|
# DIST CUT
|
||||||
|
|
||||||
VERSION=$(VERSION_MAJOR).$(VERSION_MINOR)
|
|
||||||
|
|
||||||
DISTDIR=libvterm-$(VERSION)
|
DISTDIR=libvterm-$(VERSION)
|
||||||
|
|
||||||
distdir: $(INCFILES)
|
distdir: $(INCFILES)
|
||||||
mkdir __distdir
|
mkdir __distdir
|
||||||
cp LICENSE __distdir
|
cp LICENSE CONTRIBUTING __distdir
|
||||||
mkdir __distdir/src
|
mkdir __distdir/src
|
||||||
cp src/*.c src/*.h src/*.inc __distdir/src
|
cp src/*.c src/*.h src/*.inc __distdir/src
|
||||||
mkdir __distdir/src/encoding
|
mkdir __distdir/src/encoding
|
||||||
|
@ -167,6 +167,7 @@ between states.
|
|||||||
123 SGR 1 = Bold on
|
123 SGR 1 = Bold on
|
||||||
SGR 3 = Italic on
|
SGR 3 = Italic on
|
||||||
123 SGR 4 = Underline single
|
123 SGR 4 = Underline single
|
||||||
|
SGR 4:x = Underline style
|
||||||
123 SGR 5 = Blink on
|
123 SGR 5 = Blink on
|
||||||
123 SGR 7 = Reverse on
|
123 SGR 7 = Reverse on
|
||||||
SGR 9 = Strikethrough on
|
SGR 9 = Strikethrough on
|
||||||
|
@ -19,6 +19,12 @@ extern "C" {
|
|||||||
typedef unsigned char uint8_t;
|
typedef unsigned char uint8_t;
|
||||||
typedef unsigned int uint32_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 VTerm VTerm;
|
||||||
typedef struct VTermState VTermState;
|
typedef struct VTermState VTermState;
|
||||||
typedef struct VTermScreen VTermScreen;
|
typedef struct VTermScreen VTermScreen;
|
||||||
@ -175,6 +181,8 @@ typedef struct {
|
|||||||
void (*free)(void *ptr, void *allocdata);
|
void (*free)(void *ptr, void *allocdata);
|
||||||
} VTermAllocatorFunctions;
|
} VTermAllocatorFunctions;
|
||||||
|
|
||||||
|
void vterm_check_version(int major, int minor);
|
||||||
|
|
||||||
// Allocate and initialize a new terminal with default allocators.
|
// Allocate and initialize a new terminal with default allocators.
|
||||||
VTerm *vterm_new(int rows, int cols);
|
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)
|
unsigned int dhl : 2; // On a DECDHL line (1=top 2=bottom)
|
||||||
} VTermScreenCellAttrs;
|
} VTermScreenCellAttrs;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
VTERM_UNDERLINE_OFF,
|
||||||
|
VTERM_UNDERLINE_SINGLE,
|
||||||
|
VTERM_UNDERLINE_DOUBLE,
|
||||||
|
VTERM_UNDERLINE_CURLY,
|
||||||
|
};
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
#define VTERM_MAX_CHARS_PER_CELL 6
|
#define VTERM_MAX_CHARS_PER_CELL 6
|
||||||
uint32_t chars[VTERM_MAX_CHARS_PER_CELL];
|
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);
|
setpenattr_bool(state, VTERM_ATTR_ITALIC, 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4: // Underline single
|
case 4: // Underline
|
||||||
state->pen.underline = 1;
|
state->pen.underline = VTERM_UNDERLINE_SINGLE;
|
||||||
setpenattr_int(state, VTERM_ATTR_UNDERLINE, 1);
|
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;
|
break;
|
||||||
|
|
||||||
case 5: // Blink
|
case 5: // Blink
|
||||||
@ -288,8 +305,8 @@ INTERNAL void vterm_state_setpen(VTermState *state, const long args[], int argco
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 21: // Underline double
|
case 21: // Underline double
|
||||||
state->pen.underline = 2;
|
state->pen.underline = VTERM_UNDERLINE_DOUBLE;
|
||||||
setpenattr_int(state, VTERM_ATTR_UNDERLINE, 2);
|
setpenattr_int(state, VTERM_ATTR_UNDERLINE, state->pen.underline);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 22: // Bold off
|
case 22: // Bold off
|
||||||
@ -405,8 +422,10 @@ INTERNAL int vterm_state_getpen(VTermState *state, long args[], int argcount UNU
|
|||||||
if(state->pen.italic)
|
if(state->pen.italic)
|
||||||
args[argi++] = 3;
|
args[argi++] = 3;
|
||||||
|
|
||||||
if(state->pen.underline == 1)
|
if(state->pen.underline == VTERM_UNDERLINE_SINGLE)
|
||||||
args[argi++] = 4;
|
args[argi++] = 4;
|
||||||
|
if(state->pen.underline == VTERM_UNDERLINE_CURLY)
|
||||||
|
args[argi++] = 4 | CSI_ARG_FLAG_MORE, args[argi++] = 3;
|
||||||
|
|
||||||
if(state->pen.blink)
|
if(state->pen.blink)
|
||||||
args[argi++] = 5;
|
args[argi++] = 5;
|
||||||
@ -420,7 +439,7 @@ INTERNAL int vterm_state_getpen(VTermState *state, long args[], int argcount UNU
|
|||||||
if(state->pen.font)
|
if(state->pen.font)
|
||||||
args[argi++] = 10 + state->pen.font;
|
args[argi++] = 10 + state->pen.font;
|
||||||
|
|
||||||
if(state->pen.underline == 2)
|
if(state->pen.underline == VTERM_UNDERLINE_DOUBLE)
|
||||||
args[argi++] = 21;
|
args[argi++] = 21;
|
||||||
|
|
||||||
if(state->fg_index >= 0 && state->fg_index < 8)
|
if(state->fg_index >= 0 && state->fg_index < 8)
|
||||||
|
@ -406,3 +406,20 @@ void vterm_copy_cells(VTermRect dest,
|
|||||||
(*copycell)(pos, srcpos, user);
|
(*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
|
?pen underline = 2
|
||||||
PUSH "\e[24m"
|
PUSH "\e[24m"
|
||||||
?pen underline = 0
|
?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"
|
PUSH "\e[4m\e[m"
|
||||||
?pen underline = 0
|
?pen underline = 0
|
||||||
|
|
||||||
|
@ -177,9 +177,11 @@ open my $test, "<", $ARGV[0] or die "Cannot open test script $ARGV[0] - $!";
|
|||||||
|
|
||||||
while( my $line = <$test> ) {
|
while( my $line = <$test> ) {
|
||||||
$line =~ s/^\s+//;
|
$line =~ s/^\s+//;
|
||||||
next if $line =~ m/^(?:#|$)/;
|
|
||||||
|
|
||||||
chomp $line;
|
chomp $line;
|
||||||
|
|
||||||
|
next if $line =~ m/^(?:#|$)/;
|
||||||
|
last if $line eq "__END__";
|
||||||
|
|
||||||
do_line( $line );
|
do_line( $line );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -746,6 +746,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
785,
|
||||||
/**/
|
/**/
|
||||||
784,
|
784,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user