Skip to content

Commit

Permalink
Bugfix: backend was taking over completion in all modes
Browse files Browse the repository at this point in the history
  • Loading branch information
Phenguin committed Feb 15, 2016
1 parent 8514426 commit f412830
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions company-nixos-options.el
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,16 @@
(buffer-substring (point) (save-excursion (skip-syntax-backward "w_.")
(point))))

(defun company-nixos--in-nix-context-p ()
(or (eq major-mode 'nix-mode)
(equal "nix" (file-name-extension
(buffer-file-name (current-buffer))))))

(defun company-nixos-options--prefix ()
"Grab prefix at point."
(or (company-nixos--grab-symbol)
'stop))
(and (company-nixos--in-nix-context-p)
(or (company-nixos--grab-symbol)
'stop)))

;;;###autoload
(defun company-nixos-options (command &optional arg &rest ignored)
Expand Down

0 comments on commit f412830

Please sign in to comment.