tvi: shape option for controlling letter shaping - neatvi - [fork] simple vi-type editor with UTF-8 support
(HTM) git clone git://src.adamsgaard.dk/neatvi
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) commit 685cdd8a70a01377e93fb1e49a6674200c92a5cd
(DIR) parent 667b29ccc16bd6e63382acb7cb1a9a254d4b96d9
(HTM) Author: Ali Gholami Rudi <ali@rudi.ir>
Date: Wed, 20 May 2015 13:41:30 +0430
vi: shape option for controlling letter shaping
Diffstat:
M ex.c | 2 ++
M ren.c | 2 +-
M vi.h | 3 ++-
3 files changed, 5 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/ex.c b/ex.c
t@@ -20,6 +20,7 @@ int xrow, xcol, xtop; /* current row, column, and top row */
int xrow_alt; /* alternate row, column, and top row */
int xled = 1; /* use the line editor */
int xdir = +1; /* current direction context */
+int xshape = 1; /* perform letter shaping */
/* read ex command location */
static char *ex_loc(char *s, char *loc)
t@@ -447,6 +448,7 @@ static struct option {
{"ai", "autoindent", &xai},
{"ic", "ignorecase", &xic},
{"td", "textdirection", &xdir},
+ {"shape", "shape", &xshape},
};
static char *cutword(char *s, char *d)
(DIR) diff --git a/ren.c b/ren.c
t@@ -203,5 +203,5 @@ int ren_cwid(char *s, int pos)
char *ren_translate(char *s, char *ln)
{
char *p = ren_placeholder(s);
- return p ? p : uc_shape(ln, s);
+ return p || !xshape ? p : uc_shape(ln, s);
}
(DIR) diff --git a/vi.h b/vi.h
t@@ -143,6 +143,7 @@ extern int xrow_alt;
extern char xpath[];
extern char xpath_alt[];
extern int xquit;
-extern int xdir;
extern int xic;
extern int xai;
+extern int xdir;
+extern int xshape;