Skip to content

Commit

Permalink
Fix #60 add an option for uppercase/downcase ANSI SQL candidates
Browse files Browse the repository at this point in the history
  • Loading branch information
stardiviner committed Nov 11, 2018
1 parent 0c48823 commit cc40a0f
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions ejc-autocomplete.el
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
(require 'ejc-doc)
(require 'ejc-format)

(defcustom ejc-candidates-uppercase t
"Use uppercase candidates or downcase.
Uppercase by default, set to nil to use downcase candidates."
:type 'boolean
:safe #'booleanp
:group 'ejc-sql)

(defun ejc-get-prefix-word ()
"Return the word preceding dot before the typing."
(save-excursion
Expand Down Expand Up @@ -95,12 +102,13 @@
nil)))

(defun ejc-get-ansi-sql-words ()
(if (not (or (ejc-return-point) (ejc-get-prefix-word)))
(progn
(unless (or (ejc-return-point) (ejc-get-prefix-word))
(progn
(if ejc-candidates-uppercase
(append (mapcar 'upcase ejc-ansi-sql-words)
(mapcar 'upcase ejc-auxulary-sql-words))
(append ejc-ansi-sql-words
ejc-auxulary-sql-words
(mapcar 'upcase ejc-ansi-sql-words)
(mapcar 'upcase ejc-auxulary-sql-words)))
ejc-auxulary-sql-words)))
nil))

(defun ac-ejc-documentation (symbol-name)
Expand Down

0 comments on commit cc40a0f

Please sign in to comment.