From 301e4e6ef30ee0e90b71ffa7169e4e14e7e393f8 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sun, 10 Jan 1993 10:46:38 +0000 Subject: [PATCH] Typed characters are now grouped properly by undo regardless of their position on the line. --- v7/src/edwin/comred.scm | 47 ++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/v7/src/edwin/comred.scm b/v7/src/edwin/comred.scm index 728be5516..88acd09c7 100644 --- a/v7/src/edwin/comred.scm +++ b/v7/src/edwin/comred.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: comred.scm,v 1.95 1993/01/09 01:16:01 cph Exp $ +;;; $Id: comred.scm,v 1.96 1993/01/10 10:46:38 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-93 Massachusetts Institute of Technology ;;; @@ -269,44 +269,43 @@ (let ((normal (lambda () (set! *non-undo-count* 0) - (undo-boundary! point) + (if (not *command-argument*) + (undo-boundary! point)) (apply procedure (interactive-arguments command record?))))) (cond ((or *executing-keyboard-macro?* *command-argument*) - (set! *non-undo-count* 0) - (apply procedure (interactive-arguments command record?))) - ((window-needs-redisplay? window) (normal)) ((and (char? *command-key*) (or (eq? command (ref-command-object self-insert-command)) (and (eq? command (ref-command-object &auto-fill-space)) (not (auto-fill-break? point))) (command-argument-self-insert? command))) - (let ((key *command-key*)) - (if (let ((buffer (window-buffer window))) - (and (buffer-auto-save-modified? buffer) - (null? (cdr (buffer-windows buffer))) - (line-end? point) - (char-graphic? key) - (fix:< point-x (fix:- (window-x-size window) 1)))) + (let ((non-undo-count *non-undo-count*)) + (if (or (fix:= non-undo-count 0) + (fix:>= non-undo-count 20)) (begin - (if (fix:< *non-undo-count* 20) - (set! *non-undo-count* (fix:+ *non-undo-count* 1)) - (begin - (set! *non-undo-count* 1) - (undo-boundary! point))) - (window-direct-output-insert-char! window key)) - (begin - (set! *non-undo-count* 0) - (undo-boundary! point) - (region-insert-char! point key))))) + (set! *non-undo-count* 1) + (undo-boundary! point)) + (set! *non-undo-count* (fix:+ non-undo-count 1)))) + (let ((key *command-key*)) + (if (and (not (window-needs-redisplay? window)) + (let ((buffer (window-buffer window))) + (and (buffer-auto-save-modified? buffer) + (null? (cdr (buffer-windows buffer))))) + (line-end? point) + (char-graphic? key) + (fix:< point-x (fix:- (window-x-size window) 1))) + (window-direct-output-insert-char! window key) + (region-insert-char! point key)))) ((eq? command (ref-command-object forward-char)) - (if (and (not (group-end? point)) + (if (and (not (window-needs-redisplay? window)) + (not (group-end? point)) (char-graphic? (mark-right-char point)) (fix:< point-x (fix:- (window-x-size window) 2))) (window-direct-output-forward-char! window) (normal))) ((eq? command (ref-command-object backward-char)) - (if (and (not (group-start? point)) + (if (and (not (window-needs-redisplay? window)) + (not (group-start? point)) (char-graphic? (mark-left-char point)) (fix:< 0 point-x) (fix:< point-x (fix:- (window-x-size window) 1))) -- 2.25.1