Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backspace always deletes charactres if region is specified #167

Merged
merged 1 commit into from
Sep 20, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions markdown-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -4298,14 +4298,16 @@ before the current point, then exdent the line one level.
Otherwise, do normal delete by repeating
`backward-delete-char-untabify' ARG times."
(interactive "*p")
(let ((cur-pos (current-column))
(start-of-indention (save-excursion
(back-to-indentation)
(current-column)))
(positions (markdown-calc-indents)))
(if (and (> cur-pos 0) (= cur-pos start-of-indention))
(indent-line-to (markdown-exdent-find-next-position cur-pos positions))
(backward-delete-char-untabify arg))))
(if (use-region-p)
(backward-delete-char-untabify arg)
(let ((cur-pos (current-column))
(start-of-indention (save-excursion
(back-to-indentation)
(current-column)))
(positions (markdown-calc-indents)))
(if (and (> cur-pos 0) (= cur-pos start-of-indention))
(indent-line-to (markdown-exdent-find-next-position cur-pos positions))
(backward-delete-char-untabify arg)))))

(defun markdown-find-leftmost-column (beg end)
"Find the leftmost column in the region from BEG to END."
Expand Down