Skip to content

Commit 1c5fabb

Browse files
committed
Use safe look back.
1 parent 483a405 commit 1c5fabb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docstr.el

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ See function `docstr--get-search-string' description for argument TYPE."
278278

279279
(defun docstr-trigger-csharp (&rest _)
280280
"Trigger document string inside C#."
281-
(when (and (docstr--doc-valid-p) (looking-back "///" 3))
281+
(when (and (docstr--doc-valid-p) (docstr-util-looking-back "///" 3))
282282
(save-excursion
283283
(insert " <summary>\n")
284284
(insert "/// \n")
@@ -289,12 +289,12 @@ See function `docstr--get-search-string' description for argument TYPE."
289289

290290
(defun docstr-trigger-golang (&rest _)
291291
"Trigger document string inside Golang."
292-
(when (and (docstr--doc-valid-p) (looking-back "//" 2))
292+
(when (and (docstr--doc-valid-p) (docstr-util-looking-back "//" 2))
293293
(docstr--insert-doc-string (docstr--c-style-search-string 1))))
294294

295295
(defun docstr-trigger-lua (&rest _)
296296
"Trigger document string inside Lua."
297-
(when (and (docstr--doc-valid-p) (looking-back "---" 3))
297+
(when (and (docstr--doc-valid-p) (docstr-util-looking-back "---" 3))
298298
(backward-delete-char 3)
299299
(save-excursion
300300
(insert (format "%s\n" docstr-lua-splitter))
@@ -307,7 +307,7 @@ See function `docstr--get-search-string' description for argument TYPE."
307307
(defun docstr-trigger-python (&rest _)
308308
"Trigger document string inside Python."
309309
;; TODO: For some reason, '(nth 4 (syntax-ppss))' doesn't work.
310-
(when (and docstr-mode (looking-back "\"\"\"" 3))
310+
(when (and docstr-mode (docstr-util-looking-back "\"\"\"" 3))
311311
(if (looking-at-p "\"\"\"")
312312
(delete-char 3)
313313
(save-excursion (insert "\"\"\""))

0 commit comments

Comments
 (0)