Commit Graph

87 Commits

Author SHA1 Message Date
tg f1e29cb1a1 use NELEM 2006-11-10 01:24:38 +00:00
tg 273ca89019 * check.t: add new regression test "typeset-padding-1" according to TFM
* edit.c: remove debug stuff again; next time better use shl.c functions ;)
* sh.h: add format attributes to a few shf functions
* histrap.c, var.c: fix format string mistakes
* main.c, sh.h: error_prefix and warningf take bool not int
* misc.c: make chvt() stuff use shf_* functions
* misc.c: rewrite the TIOCSTTY stuff to be better integrated in mksh,
  since it originally was an external patch
* misc.c: chvt() no longer fails if e.g. chown fails due to e.g. R/O / fs
* var.c: fix typeset padding for right-justified zero-filled
2006-11-10 01:13:52 +00:00
tg 68caa9afdd save 464 text with restructuring 2006-11-09 22:38:31 +00:00
tg bc215df211 make a few functions static that should be, and optimise a little 2006-11-09 21:20:49 +00:00
tg 36ac8dc0f7 get rid of the need of strlcat() altogether (only one use was left) 2006-11-09 15:02:31 +00:00
tg 39057dd592 add the new function utf_ptradj() which does the same as utf_widthadj()
except it doesn't return a value and is much cheaper (no internal con-
version to UCS-2, just range checking on the multibytes)
2006-11-09 00:39:27 +00:00
tg fb9c6e30bb fix another warning
now builds on MirOS, DragonFly, NetBSD, Debian stale (i386), Solaris 8,
Debian testing (s390x) - Solaris /bin/sh, bash, ksh93, mksh
2006-11-09 00:28:36 +00:00
tg dc9f457f24 don't use __predict_false() here either 2006-11-09 00:01:36 +00:00
tg 3d61efea7d fix backward deletion off-by-one in non-border case
take #if 0'd back debugging code for a while, until
the next release comes out… you never know…
2006-11-06 19:57:19 +00:00
tg 230d52135d remove debugging, simplify 2006-11-05 21:11:17 +00:00
tg 1b55015772 fix that inherited pdksh buglet as well... the xlp wasn't invalidated once… 2006-11-05 21:00:08 +00:00
tg 45f1602850 nuke some of the dbg 2006-11-05 19:56:20 +00:00
tg a3331fd8e9 fix another cursor positioning glitch (cause for \b at x_col == 0) 2006-11-05 19:48:58 +00:00
tg b03ed7b315 * catch limit off in x_redraw (bytes vs chars vs curpos)
XXX should probably be screenpos, might need to use x_size* here
  XXX this seems to be the tab bug I noticed which we inherited from obsd
* catch backspace if x_col == 0 (XXX better)
2006-11-05 19:35:52 +00:00
tg 47daa0eadc fix issue with line splits inmidst of multibyte characters 2006-11-05 19:15:15 +00:00
tg 6b02a01833 track down an off-by-one and a segfault 2006-11-05 19:12:41 +00:00
tg 33ac6cb0d9 multibyte search-character-{for,back}ward 2006-11-05 17:54:46 +00:00
tg 72f958edea fix deleting AND moving left 2006-11-05 17:34:39 +00:00
tg 15fd277841 delete and move word fore- and backwards by the right amount, too 2006-11-05 17:24:00 +00:00
tg 260eaa9d51 eliminate segfault 2006-11-05 17:11:25 +00:00
tg abe860d486 fix deleting forward with count 2006-11-05 16:53:34 +00:00
tg aa867d19bb if we can't delete, keep position, as before 2006-11-05 16:48:17 +00:00
tg dba2dec094 backspace counting
rest'll follow
2006-11-05 16:43:57 +00:00
tg cc261c7968 make backspacing (and moving forward and backward) work perfectly
(in Emacs mode, of course) - for count=1 only though (yet)
2006-11-05 16:41:02 +00:00
tg 4787566fb6 multibyte insertion, the Plan 9 way 2006-11-05 16:10:10 +00:00
tg 08d3457cff utf hack depends on emacs-usemeta off (the default) 2006-11-05 15:36:09 +00:00
tg a373d2e7ab first part of utf-8 ability in mksh, already works pretty well 2006-11-05 15:31:37 +00:00
tg c81966621a merge non-Plan9-specific stuff from the branch, add KNF, etc. 2006-08-24 20:32:53 +00:00
tg 4fac7ec24b * remove redundancy
* integrate compat.h, version.h into sh.h (dependency trick didn't work anyway)
* mention #ksh in mksh(1) since the founder (twkm) said it's on topic too
  (don't remove mention of #mksh despite it's usually empty because of control)
2006-08-22 22:49:38 +00:00
tg 4661992d5b remove the 'stuff' functionality altogether,
ksh93 doesn't have it, and I don't know, nor
do I care about what "the BRL ^T mini-systat
feature" is.
2006-08-08 20:17:22 +00:00
tg 5176249248 * bind ^T to transpose-chars as documented in the manual page,
not to stuff, even if TIOCSTI is available
* it's transpose-chars not transpose

bug spotted by hondza who wondered that on ^T the line repeats itself forever
2006-08-08 20:07:53 +00:00
tg 174b4c5a1d the 'delete' key does *not* act as Ctrl-D (EOT, cf. ascii(7)) 2006-08-02 14:02:55 +00:00
tg 58e5606710 bind xterm-xfree86 and wscons (NetBSD®) wsvt25/vt220 too 2006-08-02 14:00:19 +00:00
tg c96e31a707 implement a hack whereas you can now bind functions (and macros)
to keys with a trailing tilde (after prefix + control char); the
function is then invoked after prefices, control char and one more
character X are entered; if X is not a tilde, it is ungetc(3)d
2006-08-02 13:32:18 +00:00
tg b99aa06d9b save whitespace 2006-08-02 12:54:48 +00:00
tg 99007d97e7 cry if the 'bind' editing command gets too long arguments
minor KNF while here
2006-08-02 12:49:04 +00:00
tg 790c312e9f fix the prompt redrawal routines for multi-line prompts, prompts
with embedded newline (\n), and multi-line prompts with embedded
newlines. single-line prompts should be not affected; prompts with
embedded carriage return (\r) should be fixed by this as well.
also fix prompt_redraw comment (can't remove the variable though,
since it's required if the shell inserts a newline after the prompt
herself).
tested on cygwin and interix
2006-08-02 11:33:37 +00:00
tg 857fb659bc fix multiline prompts with "delimiter chars"
(only the last line of the prompt is redrawn, keep this in mind
when doing the ANSI colour game)

TODO:
* maybe go back up one line and redraw whole prompt?
* optionally edit command on multiple lines, bash-like,
  instead of scrolling horizontally
2006-08-01 14:59:51 +00:00
tg a15c5c319a * use modulo operation, Mr Glockner
* allow promptlen to return values > $COLUMNS
2006-08-01 14:35:44 +00:00
tg ce18e01f2c move promptlen from edit.c into lex.c 2006-08-01 14:10:25 +00:00
tg c504a42ac1 (partial) sync with openbsd (and fix after them),
gives us a better wrapping prompt and a manpage wording cleanup
2006-08-01 14:09:20 +00:00
tg db107a9b05 bring back the 'version' editing command at "ESC ^V" like AT&T ksh93+r 2006-08-01 12:44:17 +00:00
tg 64598758fb * TNF needs more to silence char subscript warnings (on 3.0-stable)
* bump vsn
2006-07-11 14:51:01 +00:00
tg bc93d1c90d fix the "char subscripts" issue, bump version 2006-07-03 12:16:31 +00:00
tg 7672b9b346 apply some fixes from OpenBSD and don't apply some others
but sync RCS IDs for easier future adaption:
* Simplify savefd() by removing the "noclose" flag and make noclose
  behavior the default. Almost all uses of savefd() are followed
  by an implicit or explicit close.
* fix typos
* might as well make ksh_getopt() match real getopt(), ie. get rid of that
  stupid EOF concept that was never true. adobriyan@gmail
* use SEEK_* for lseek()
* fix lint comments, no functional changes
* remove excessive optimization; from adobriyan@gmail
* only santa checks things twice; from adobriyan@gmail
* Interpret zero-filled numbers as decimal; PR 4213; from Alexey Dobriyan
2006-05-10 18:54:13 +00:00
tg 9e838e765c * convert most of the interna of edit.c to unsigned where it's
important for the signedness of the target, to enable using
  high-bit7 characters on the command line (eg. in UTF-8 locales)
* make emacs-usemeta and vi-show8 equivalent and document that
  in the manual page (i.e. beware if you're in a latin1 locale)
* do not reference SUSv3 (helps GNU groff), write \&" out instead
2006-02-16 11:48:32 +00:00
tg 3f2912d717 * update to mksh R26c
* there is no comma in front of "which" in English, I was taught
2006-01-30 12:37:24 +00:00
tg 94ee3b388a sync with OpenBSD: remove unused code and vars; name clash with libc
compiles under MirBSD
2006-01-29 20:04:54 +00:00
tg 95cfad6339 * only have one $MirOS RCS ID per file to shrink source size
(this is an exception from normal use)
* bump to R26
2005-11-22 18:40:44 +00:00
tg 9b97d72d5e * move _all_ #include stuff into sh.h
* sort out #include stuff which isn't necessary on MirOS into compat.h
2005-10-25 19:53:29 +00:00