Browse Source

Tweak condition for src buffer to inherit active region.

* lisp/org-src.el (org-edit-src-code): Allow region to be inherited by
edit buffer when mark is one character beyond end of src block.

Thanks to Jambunathan K. for the bug report:

 C-c C-v C-M-h and C-c C-v C-x interaction

   In the block below do

   1. C-c C-v C-M-h, C-c C-v C-x C-M-\
   2. Mark (just) the code-block with C-SPC etc etc. C-c C-v C-x C-M-\

   See the difference in behaviour.

<text:p text:style-name="Standard">This is a xref to
<text:bookmark-ref text:reference-format="text"
text:ref-name="__RefHeading__1669_1684552201">Heading8
</text:bookmark-ref>.</text:p>

I have transient mark mode on.
Dan Davison 10 years ago
parent
commit
9db0d7e20b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      lisp/org-src.el

+ 2 - 2
lisp/org-src.el

@@ -240,8 +240,8 @@ buffer."
 	    block-nindent (nth 5 info)
 	    lang-f (intern (concat lang "-mode"))
 	    begline (save-excursion (goto-char beg) (org-current-line)))
-      (if (and mark (>= mark beg) (<= mark end))
-	  (save-excursion (goto-char mark)
+      (if (and mark (>= mark beg) (<= mark (1+ end)))
+	  (save-excursion (goto-char (min mark end))
 			  (setq markline (org-current-line)
 				markcol (current-column))))
       (if (equal lang-f 'table.el-mode)