@@ -167,7 +167,8 @@ variable. Argument DESC is the description of VAR."
167167 (lua-mode . (" RET" docstr-trigger-lua-return))
168168 (python-mode . (" \" " docstr-trigger-python))
169169 (ruby-mode . (" #" docstr-trigger-ruby))
170- (rust-mode . (" /" docstr-trigger-rust)))
170+ (rust-mode . (" /" docstr-trigger-rust))
171+ (swift-mode . (" /" docstr-trigger-swift)))
171172 " List of trigger to each `major-mode' .
172173
173174The data is a cons cell form by (mode-name . (key function)). The first
@@ -186,9 +187,8 @@ You should customize this variable to add your own triggeration methods."
186187 (dolist (tri docstr-trigger-alist)
187188 (let* ((mode (car tri)) (data (cdr tri))
188189 (key (nth 0 data)) (fnc (nth 1 data)))
189- (when (eq major-mode mode)
190- (if act (docstr-util-key-advice-add key :after fnc)
191- (docstr-util-key-advice-remove key fnc))))))
190+ (if act (docstr-util-key-advice-add key :after fnc)
191+ (docstr-util-key-advice-remove key fnc)))))
192192
193193(defun docstr--enable ()
194194 " Enable `docstr' in current buffer."
@@ -231,7 +231,7 @@ You should customize this variable to add your own triggeration methods."
231231 '(lua)
232232 '(php python)
233233 '(ruby rust)
234- '(scala)
234+ '(scala swift )
235235 '(typescript))
236236 " List of supported languages." )
237237
@@ -352,6 +352,7 @@ See function `docstr--get-search-string' description for argument TYPE."
352352 (ruby-mode . docstr-ruby-prefix)
353353 (rust-mode . docstr-rust-prefix)
354354 (scala-mode . docstr-scala-prefix)
355+ (swift-mode . docstr-swift-prefix)
355356 (typescript-mode . docstr-typescript-prefix)
356357 (web-mode . docstr-php-prefix))
357358 " Assocaition list for (major-mode . name).
0 commit comments