Transform from:
(defun lispy--occur-action (x)
"Goto line X for `lispy-occur'."
(goto-char lispy--occur-beg)
(if (string= helm-input "")
(progn
(forward-line x)
(back-to-indentation)
(when (re-search-forward lispy-left (line-end-position) t)
(goto-char (match-beginning 0))))
(forward-line (1- x))
(re-search-forward (lispy--occur-regex)
(line-end-position)
t)
(let ((str-or-comment (lispy--in-string-or-comment-p)))
(if str-or-comment
(goto-char str-or-comment)
(let ((pt (point)))
(cond ((re-search-backward lispy-left (line-beginning-position) t)
(goto-char (match-beginning 0)))
((re-search-forward lispy-left (line-end-position) t)
(goto-char (match-beginning 0)))
(t
(back-to-indentation))))))))
to:
(defun lispy--occur-action (x)
"Goto line X for `lispy-occur'."
(goto-char lispy--occur-beg)
(let (str-or-comment)
(cond ((string= helm-input "")
(forward-line x)
(back-to-indentation)
(when (re-search-forward lispy-left (line-end-position) t)
(goto-char (match-beginning 0))))
((setq str-or-comment
(progn
(forward-line (1- x))
(re-search-forward (lispy--occur-regex)
(line-end-position)
t)
(lispy--in-string-or-comment-p)))
(goto-char str-or-comment))
((re-search-backward lispy-left (line-beginning-position) t)
(goto-char (match-beginning 0)))
((re-search-forward lispy-left (line-end-position) t)
(goto-char (match-beginning 0)))
(t
(back-to-indentation)))))