aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2020-08-01 15:32:42 +0200
committerOmar Polo <op@omarpolo.com>2020-08-01 15:32:42 +0200
commit0303a37c57dcefec24462a3a402627a8c1f59a22 (patch)
tree3cc799727ec1fbb1b81abff7e1285eec2d92ede7
parentcc81114f52cf2da4e27a18289dbf07d8f0acf2d9 (diff)
downloadsam.el-0303a37c57dcefec24462a3a402627a8c1f59a22.tar.gz
sam.el-0303a37c57dcefec24462a3a402627a8c1f59a22.tar.bz2
(hopefully) make sam-get-line cleaner
-rw-r--r--sam.el16
1 files changed, 8 insertions, 8 deletions
diff --git a/sam.el b/sam.el
index 2230d2a..e2289ef 100644
--- a/sam.el
+++ b/sam.el
@@ -117,14 +117,14 @@
(defun sam-get-line ()
"Returns the string on the current line."
- (copy-region-as-kill
- (+ (if (and (not sam-is-inserting)
- sam-prompt)
- (length sam-prompt)
- 0)
- (point-at-bol))
- (point-at-eol))
- (pop kill-ring))
+ (let ((off (if (and (not sam-is-inserting)
+ sam-prompt)
+ (length sam-prompt)
+ 0)))
+ (copy-region-as-kill
+ (+ off (point-at-bol))
+ (point-at-eol))
+ (pop kill-ring)))
(defun sam-parse-command (cmd)
(cl-loop