Skip to content

If overwrite-mode is active, point jumps 2 chars forward/backward #101

@lordnik22

Description

@lordnik22

A speed-type session doesn't act the same when overwrite-mode is enabled.

If overwrite-mode is active, point jumps 2 chars forward/backward.

The forward-motion can be fixed (forward when inserting characters). It can be fixed by checking if the mode is active and set point to (1- end) for point-move and (- end 2) for point-stay` .

The backward-motion can not be fixed at the moment (backwards when deleting characters with backspace). For some reason delete-backward-char tries to untabify tabs where no tabs are present. It inserts 2 spaces for no obvious reason which retriggers the speed-type--change-hook. This comapres 2 spaces against the actual buffer content which marks them as error.

I assume this is a bug in the simple-package because there are not tabs to untabify anyway:

simple.el:

;; In Overwrite mode, maybe untabify while deleting
	((null (or (null overwrite-mode)
		   (<= n 0)
		   (memq (char-before) '(?\t ?\n)) <<-- this is the tab detection, which is OR-combined (therefore ignored)
		   (eobp)
		   (eq (char-after) ?\n)))
	 (let ((ocol (current-column)))
           (delete-char (- n) killflag)
	   (save-excursion
	     (insert-char ?\s (- ocol (current-column)) nil)))) ;; <<--- this inserts the 2 spaces for no reason

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions