parent
e40ef9f6c5
commit
78e9854bae
4 changed files with 15 additions and 5 deletions
|
@ -126,7 +126,7 @@
|
|||
|
||||
(defun company-lean--findg-candidates (prefix)
|
||||
(let ((line-number (line-number-at-pos))
|
||||
(column-number (current-column))
|
||||
(column-number (lean-line-offset))
|
||||
pattern)
|
||||
(lean-server-send-cmd-sync (lean-cmd-wait) '(lambda () ()))
|
||||
(setq pattern (if current-prefix-arg
|
||||
|
@ -203,7 +203,6 @@ triggers a completion immediately."
|
|||
|
||||
(defun company-lean--findp-candidates (prefix)
|
||||
(let ((line-number (line-number-at-pos))
|
||||
(column-number (current-column))
|
||||
pattern)
|
||||
(lean-server-send-cmd-sync (lean-cmd-wait) '(lambda () ()))
|
||||
(lean-server-send-cmd-sync (lean-cmd-findp line-number prefix)
|
||||
|
|
|
@ -456,13 +456,13 @@ Take out \"BEGININFO\" and \"ENDINFO\" and Use \"ACK\" as a delim."
|
|||
(save-excursion
|
||||
(forward-char 1)
|
||||
(backward-list 1)
|
||||
`(,(line-number-at-pos) . ,(current-column))))
|
||||
`(,(line-number-at-pos) . ,(lean-line-offset))))
|
||||
|
||||
(defun lean-get-info-record-at-point (cont)
|
||||
"Get info-record at the current point"
|
||||
(let* ((file-name (buffer-file-name))
|
||||
(line-number (line-number-at-pos))
|
||||
(column-number (current-column))
|
||||
(column-number (lean-line-offset))
|
||||
(cmd (cond ((looking-at "(")
|
||||
(lean-cmd-info line-number column-number))
|
||||
;; TODO(soonhok): give information on '('
|
||||
|
|
|
@ -480,7 +480,7 @@ If it's not the same with file-name (default: buffer-file-name), send VISIT cmd.
|
|||
|
||||
(defun lean-server-get-info-record-at-pos (body)
|
||||
(let* ((file-name (buffer-file-name))
|
||||
(column (current-column)))
|
||||
(column (lean-line-offset)))
|
||||
(when (and (or (looking-at (rx (or white "," ")" "}" "]")))
|
||||
(eolp))
|
||||
(> column 1))
|
||||
|
|
|
@ -166,4 +166,15 @@
|
|||
(when id-beg
|
||||
(buffer-substring id-beg cur-pos))))))
|
||||
|
||||
(defun lean-line-offset ()
|
||||
"Return the byte-offset of current position, counting from the
|
||||
beginning of the line"
|
||||
(interactive)
|
||||
(let ((bol-pos
|
||||
(save-excursion
|
||||
(beginning-of-line)
|
||||
(point)))
|
||||
(pos (point)))
|
||||
(- pos bol-pos)))
|
||||
|
||||
(provide 'lean-util)
|
||||
|
|
Loading…
Reference in a new issue