Commits

camlspotter  committed e9e5a83

better pointer movement

  • Participants
  • Parent commits 70ef387

Comments (0)

Files changed (1)

File offside-trap.el

 ;; if the lines match with the following regexp, they are skipped
 ;; in the sticky check.
 ;; CR: It is not perfect. ex: {- "{-" -}. But who cares?
+;; CR: it may loop infinitely!!!
 (defconst offside-trap-sticky-skip-lines-regexp
   (let ((empty-or-commented "[ \t]*\\(--.*\\)?\n")
 	(block-comment "[ \t]*{-\\([^-.]\\|-[^}]\\|\n\\)*-}.*\n"))
 ;; starting block indent 
 (defun offside-trap-block-indent ()
   (interactive)
-  (offside-trap-move-to-indent-head)
+  ;; indent-for-tab-command moves the point to the indentation position, if it is left of it.
+  (if (< (current-column) (current-indentation)) (offside-trap-move-to-indent-head))
   (offside-trap-set-sticky-lines)
   (setq overriding-terminal-local-map offside-trap-sticky-mode-map) ;; go into the sticky mode 
   (offside-trap-block-indent-step))