mirror of https://github.com/tildeclub/ex-vi.git
* When moving left while the cursor is positioned over a multicolumn
character at the end of the line, the bell is rung now (Bugreport by Matthew Fischer). * When moving up or down to a row with different column arrangement while the cursor is positioned over a multicolumn character, the leftmost character above the original position is chosen in the new row.
This commit is contained in:
parent
280906a241
commit
1dbb3c2a66
6
Changes
6
Changes
|
@ -20,6 +20,12 @@ Release ...
|
||||||
* A non-null exit status is now returned if a file could not be opened.
|
* A non-null exit status is now returned if a file could not be opened.
|
||||||
* If the match for a substitution is of length zero, a line overflow is
|
* If the match for a substitution is of length zero, a line overflow is
|
||||||
now avoided when compiled with the 'UNIX(R) Regular Expression Library'.
|
now avoided when compiled with the 'UNIX(R) Regular Expression Library'.
|
||||||
|
* When moving left while the cursor is positioned over a multicolumn
|
||||||
|
character at the end of the line, the bell is rung now (Bugreport by
|
||||||
|
Matthew Fischer).
|
||||||
|
* When moving up or down to a row with different column arrangement while
|
||||||
|
the cursor is positioned over a multicolumn character, the leftmost
|
||||||
|
character above the original position is chosen in the new row.
|
||||||
|
|
||||||
Release 1/19/05
|
Release 1/19/05
|
||||||
* The last release erroneously made 'X' work like 'x' in visual mode. It now
|
* The last release erroneously made 'X' work like 'x' in visual mode. It now
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* @(#)ex_proto.h 1.26 (gritter) 2/15/05
|
* @(#)ex_proto.h 1.27 (gritter) 2/15/05
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -259,6 +259,7 @@ extern int any(int, register char *);
|
||||||
extern int backtab(register int);
|
extern int backtab(register int);
|
||||||
extern void change(void);
|
extern void change(void);
|
||||||
extern int column(register char *);
|
extern int column(register char *);
|
||||||
|
extern int lcolumn(register char *);
|
||||||
extern void comment(void);
|
extern void comment(void);
|
||||||
extern void Copy(register char *, register char *, register int);
|
extern void Copy(register char *, register char *, register int);
|
||||||
extern void copyw(register line *, register line *, register int);
|
extern void copyw(register line *, register line *, register int);
|
||||||
|
|
7
ex_put.c
7
ex_put.c
|
@ -73,7 +73,7 @@
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifdef DOSCCS
|
#ifdef DOSCCS
|
||||||
static char sccsid[] = "@(#)ex_put.c 1.30 (gritter) 2/15/05";
|
static char sccsid[] = "@(#)ex_put.c 1.31 (gritter) 2/15/05";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -745,11 +745,12 @@ dontcr:
|
||||||
((i=vtube[outline][outcol]) < ' ')
|
((i=vtube[outline][outcol]) < ' ')
|
||||||
#else
|
#else
|
||||||
((i=vtube[outline][outcol]) == 0)
|
((i=vtube[outline][outcol]) == 0)
|
||||||
|| (i!=MULTICOL && !printable(i&~MULTICOL))
|
|| (i!=MULTICOL && !printable(i&~INVBIT&~MULTICOL))
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
i = ' ';
|
i = ' ';
|
||||||
if(i & QUOTE) /* mjm: no sign extension on 3B */
|
if((i & (QUOTE|INVBIT)) == QUOTE) /* mjm: no sign
|
||||||
|
extension on 3B */
|
||||||
i = ' ';
|
i = ' ';
|
||||||
if ((insmode || i == MULTICOL) && ND)
|
if ((insmode || i == MULTICOL) && ND)
|
||||||
tputs(ND, 0, plodput);
|
tputs(ND, 0, plodput);
|
||||||
|
|
19
ex_subr.c
19
ex_subr.c
|
@ -73,7 +73,7 @@
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifdef DOSCCS
|
#ifdef DOSCCS
|
||||||
static char sccsid[] = "@(#)ex_subr.c 1.36 (gritter) 2/15/05";
|
static char sccsid[] = "@(#)ex_subr.c 1.37 (gritter) 2/15/05";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -84,6 +84,8 @@ static char sccsid[] = "@(#)ex_subr.c 1.36 (gritter) 2/15/05";
|
||||||
#include "ex_tty.h"
|
#include "ex_tty.h"
|
||||||
#include "ex_vis.h"
|
#include "ex_vis.h"
|
||||||
|
|
||||||
|
static short lastsc;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Random routines, in alphabetical order.
|
* Random routines, in alphabetical order.
|
||||||
*/
|
*/
|
||||||
|
@ -137,6 +139,12 @@ column(register char *cp)
|
||||||
return (qcolumn(cp, NULL));
|
return (qcolumn(cp, NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
lcolumn(register char *cp)
|
||||||
|
{
|
||||||
|
return column(cp) - (lastsc - 1);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Ignore a comment to the end of the line.
|
* Ignore a comment to the end of the line.
|
||||||
* This routine eats the trailing newline so don't call newline().
|
* This routine eats the trailing newline so don't call newline().
|
||||||
|
@ -659,20 +667,19 @@ qcolumn(register char *lim, register char *gp)
|
||||||
int
|
int
|
||||||
qcount(int c)
|
qcount(int c)
|
||||||
{
|
{
|
||||||
int sc;
|
|
||||||
|
|
||||||
if (c == '\t') {
|
if (c == '\t') {
|
||||||
vcntcol += value(TABSTOP) - vcntcol % value(TABSTOP);
|
vcntcol += value(TABSTOP) - vcntcol % value(TABSTOP);
|
||||||
|
lastsc = 1;
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Take account of filler characters inserted at the end of
|
* Take account of filler characters inserted at the end of
|
||||||
* the visual line if a multi-column character does not fit.
|
* the visual line if a multi-column character does not fit.
|
||||||
*/
|
*/
|
||||||
sc = colsc(c);
|
lastsc = colsc(c&TRIM&~MULTICOL);
|
||||||
while (vcntcol < WCOLS && vcntcol + sc - 1 >= WCOLS)
|
while (vcntcol < WCOLS && vcntcol + lastsc - 1 >= WCOLS)
|
||||||
vcntcol++;
|
vcntcol++;
|
||||||
vcntcol += c & MULTICOL ? 1 : sc;
|
vcntcol += c & MULTICOL ? 1 : lastsc;
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifdef DOSCCS
|
#ifdef DOSCCS
|
||||||
static char sccsid[] = "@(#)ex_voper.c 1.25 (gritter) 1/19/05";
|
static char sccsid[] = "@(#)ex_voper.c 1.27 (gritter) 2/15/05";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -586,7 +586,7 @@ errlab:
|
||||||
case CTRL('p'):
|
case CTRL('p'):
|
||||||
wdot = dot - cnt;
|
wdot = dot - cnt;
|
||||||
if (vmoving == 0)
|
if (vmoving == 0)
|
||||||
vmoving = 1, vmovcol = column(cursor);
|
vmoving = 1, vmovcol = lcolumn(cursor);
|
||||||
wcursor = 0;
|
wcursor = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -635,7 +635,7 @@ errlab:
|
||||||
case NL:
|
case NL:
|
||||||
wdot = dot + cnt;
|
wdot = dot + cnt;
|
||||||
if (vmoving == 0)
|
if (vmoving == 0)
|
||||||
vmoving = 1, vmovcol = column(cursor);
|
vmoving = 1, vmovcol = lcolumn(cursor);
|
||||||
wcursor = 0;
|
wcursor = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -960,7 +960,7 @@ edge(void)
|
||||||
if (linebuf[0] == 0)
|
if (linebuf[0] == 0)
|
||||||
return (1);
|
return (1);
|
||||||
if (dir == 1)
|
if (dir == 1)
|
||||||
return (wcursor[1] == 0);
|
return (wcursor[skipright(linebuf, wcursor)] == 0);
|
||||||
else
|
else
|
||||||
return (wcursor == linebuf);
|
return (wcursor == linebuf);
|
||||||
}
|
}
|
||||||
|
|
11
ex_vput.c
11
ex_vput.c
|
@ -73,7 +73,7 @@
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifdef DOSCCS
|
#ifdef DOSCCS
|
||||||
static char sccsid[] = "@(#)ex_vput.c 1.48 (gritter) 2/15/05";
|
static char sccsid[] = "@(#)ex_vput.c 1.49 (gritter) 2/15/05";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -588,7 +588,7 @@ vinschar(int c)
|
||||||
register cell *tp;
|
register cell *tp;
|
||||||
char *OIM;
|
char *OIM;
|
||||||
bool OXN;
|
bool OXN;
|
||||||
int noim;
|
int noim, filler = 0;
|
||||||
|
|
||||||
insmc1 = colsc(c) - 1;
|
insmc1 = colsc(c) - 1;
|
||||||
if ((!IM || !EI) && ((hold & HOLDQIK) || !value(REDRAW) || value(SLOWOPEN))) {
|
if ((!IM || !EI) && ((hold & HOLDQIK) || !value(REDRAW) || value(SLOWOPEN))) {
|
||||||
|
@ -747,6 +747,11 @@ vinschar(int c)
|
||||||
noim = 0;
|
noim = 0;
|
||||||
#ifdef MB
|
#ifdef MB
|
||||||
if (mb_cur_max > 1) {
|
if (mb_cur_max > 1) {
|
||||||
|
if (destcol + 1 + insmc1 == WCOLS + 1) {
|
||||||
|
noim = 1;
|
||||||
|
if (insmc1 == 1 && insmc0 == 0)
|
||||||
|
filler = 1;
|
||||||
|
}
|
||||||
for (i = inscol; vtube0[i]; i++)
|
for (i = inscol; vtube0[i]; i++)
|
||||||
if (i + 1 >= WCOLS && vtube0[i] & MULTICOL) {
|
if (i + 1 >= WCOLS && vtube0[i] & MULTICOL) {
|
||||||
noim = 1;
|
noim = 1;
|
||||||
|
@ -796,7 +801,7 @@ vinschar(int c)
|
||||||
* Now put the cursor in its final resting place.
|
* Now put the cursor in its final resting place.
|
||||||
*/
|
*/
|
||||||
destline = LINE(vcline);
|
destline = LINE(vcline);
|
||||||
destcol = inscol + inssiz + insmc1;
|
destcol = inscol + inssiz + insmc1 + filler;
|
||||||
vcsync();
|
vcsync();
|
||||||
if (IM != OIM) {
|
if (IM != OIM) {
|
||||||
IM = OIM;
|
IM = OIM;
|
||||||
|
|
Loading…
Reference in New Issue