summaryrefslogtreecommitdiff
path: root/.emacs.d
diff options
context:
space:
mode:
authorSimeon Simeonov2017-11-30 19:42:17 +0100
committerSimeon Simeonov2017-11-30 19:42:17 +0100
commit2f1a2df667f075ee07b65eff87261ea018a135d8 (patch)
treed2d58b0042df1a1cb19b14a88a8c14268aa4a548 /.emacs.d
parent33b5952ddc7ce1be3561f3a19e5f64aee72eea05 (diff)
Update yasnippet.el
Diffstat (limited to '.emacs.d')
-rw-r--r--.emacs.d/lisp/yasnippet.el20
1 files changed, 15 insertions, 5 deletions
diff --git a/.emacs.d/lisp/yasnippet.el b/.emacs.d/lisp/yasnippet.el
index aa9fe5e..b3c5c90 100644
--- a/.emacs.d/lisp/yasnippet.el
+++ b/.emacs.d/lisp/yasnippet.el
@@ -5,7 +5,7 @@
5;; João Távora <joaotavora@gmail.com>, 5;; João Távora <joaotavora@gmail.com>,
6;; Noam Postavsky <npostavs@gmail.com> 6;; Noam Postavsky <npostavs@gmail.com>
7;; Maintainer: Noam Postavsky <npostavs@gmail.com> 7;; Maintainer: Noam Postavsky <npostavs@gmail.com>
8;; Version: 0.12.1 8;; Version: 0.12.2
9;; X-URL: http://github.com/joaotavora/yasnippet 9;; X-URL: http://github.com/joaotavora/yasnippet
10;; Keywords: convenience, emulation 10;; Keywords: convenience, emulation
11;; URL: http://github.com/joaotavora/yasnippet 11;; URL: http://github.com/joaotavora/yasnippet
@@ -261,7 +261,11 @@ applies)."
261(defcustom yas-also-auto-indent-first-line nil 261(defcustom yas-also-auto-indent-first-line nil
262 "Non-nil means also auto indent first line according to mode. 262 "Non-nil means also auto indent first line according to mode.
263 263
264Naturally this is only valid when `yas-indent-line' is `auto'" 264Naturally this is only valid when `yas-indent-line' is `auto'."
265 :type 'boolean)
266
267(defcustom yas-also-indent-empty-lines nil
268 "Non-nil means also indent empty lines according to mode."
265 :type 'boolean) 269 :type 'boolean)
266 270
267(defcustom yas-snippet-revival t 271(defcustom yas-snippet-revival t
@@ -536,7 +540,7 @@ override bindings from other packages (e.g., `company-mode')."
536 540
537;;; Internal variables 541;;; Internal variables
538 542
539(defconst yas--version "0.12.1") 543(defconst yas--version "0.12.2")
540 544
541(defvar yas--menu-table (make-hash-table) 545(defvar yas--menu-table (make-hash-table)
542 "A hash table of MAJOR-MODE symbols to menu keymaps.") 546 "A hash table of MAJOR-MODE symbols to menu keymaps.")
@@ -2524,6 +2528,10 @@ where snippets of table might exist."
2524 ;; create the .yas-parents file here... 2528 ;; create the .yas-parents file here...
2525 candidate))))) 2529 candidate)))))
2526 2530
2531;; NOTE: Using the traditional "*new snippet*" stops whitespace mode
2532;; from activating (it doesn't like the leading "*").
2533(defconst yas-new-snippet-buffer-name "+new-snippet+")
2534
2527(defun yas-new-snippet (&optional no-template) 2535(defun yas-new-snippet (&optional no-template)
2528 "Pops a new buffer for writing a snippet. 2536 "Pops a new buffer for writing a snippet.
2529 2537
@@ -2536,7 +2544,7 @@ NO-TEMPLATE is non-nil."
2536 (buffer-substring-no-properties 2544 (buffer-substring-no-properties
2537 (region-beginning) (region-end)))))) 2545 (region-beginning) (region-end))))))
2538 2546
2539 (switch-to-buffer "*new snippet*") 2547 (switch-to-buffer yas-new-snippet-buffer-name)
2540 (erase-buffer) 2548 (erase-buffer)
2541 (kill-all-local-variables) 2549 (kill-all-local-variables)
2542 (snippet-mode) 2550 (snippet-mode)
@@ -4227,7 +4235,9 @@ The SNIPPET's markers are preserved."
4227 (goto-char from) 4235 (goto-char from)
4228 (cl-loop for bol = (line-beginning-position) 4236 (cl-loop for bol = (line-beginning-position)
4229 for eol = (line-end-position) 4237 for eol = (line-end-position)
4230 if (/= bol eol) do 4238 if (or yas-also-indent-empty-lines
4239 (/= bol eol))
4240 do
4231 ;; Indent each non-empty line. 4241 ;; Indent each non-empty line.
4232 (let ((remarkers nil)) 4242 (let ((remarkers nil))
4233 (dolist (m snippet-markers) 4243 (dolist (m snippet-markers)