diff options
author | Dan Davison <dandavison7@gmail.com> | 2010-11-19 23:31:19 +0000 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2010-11-19 23:32:30 +0000 |
commit | 9db0d7e20b5121fad3fecfe1e6c432d6fce73034 (patch) | |
tree | 0fd01cbbe8087aac8b936851ba93c6d127decf72 | |
parent | 967c71f5efa6d7ba12dcfff100ff1dedcb8d30a0 (diff) | |
download | org-mode-9db0d7e20b5121fad3fecfe1e6c432d6fce73034.tar.gz |
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.
-rw-r--r-- | lisp/org-src.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/org-src.el b/lisp/org-src.el index c4f0065..fd827f9 100644 --- a/lisp/org-src.el +++ b/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) |