One would think that it should work no matter how you enter the insert state. I use Doom Emacs, and for me, sometimes it works sometimes it doesn't. So, how about just commenting out the last line in the function that moves one character back as you come out of the insert state?
(defun evil-move-cursor-back (&optional force)
"Move point one character back within the current line.
Contingent on the variable `evil-move-cursor-back' or the FORCE
argument. Honors field boundaries, i.e., constrains the movement
to the current field as recognized by `line-beginning-position'."
(when (or evil-move-cursor-back force)
(unless (or (= (point) (line-beginning-position))
(and (boundp 'visual-line-mode)
visual-line-mode
(= (point) (save-excursion
(beginning-of-visual-line)
(point))))))))
;; (backward-char))))
Not sure whether this would affect anything else.
Of course you can add conditions and set it only for certain modes instead of just commenting it out altogether.
This was bothering me in Python shell as the cursor on an empty line goes right to the prompt on exit from insert state even when the evil-move-cursor-back
variable was set to nil
.
(setq evil-move-cursor-back-nil-modes
(list 'inferior-python-mode
'inferior-ess-r-mode))
(defun evil-move-cursor-back (&optional force)
"Move point one character back within the current line.
Contingent on the variable `evil-move-cursor-back' or the FORCE
argument. Honors field boundaries, i.e., constrains the movement
to the current field as recognized by `line-beginning-position'."
(when (or evil-move-cursor-back force)
(unless (or (= (point) (line-beginning-position))
;; OVERRIDE: Add conditon to check major mode.
(member major-mode evil-move-cursor-back-nil-modes)
(and (boundp 'visual-line-mode)
visual-line-mode
(= (point) (save-excursion
(beginning-of-visual-line)
(point)))))
(backward-char))))