Permalink
Browse files

Merge pull request #467 from jpkotta/master

ignore non-decimal numerals in ac-prefix-default
  • Loading branch information...
2 parents 297e2f7 + 915f575 commit 2e83566ddfa758c69afe50b8a1c62a66f47471e3 @syohex syohex committed Jan 25, 2017
Showing with 6 additions and 7 deletions.
  1. +6 −7 auto-complete.el
View
@@ -701,13 +701,12 @@ If there is no common part, this will be nil.")
(defun ac-prefix-default ()
"Same as `ac-prefix-symbol' but ignore a number prefix."
- (let ((start (ac-prefix-symbol)))
- (when start
- (cl-loop with end = (point)
- for pos from start below end
- for c = (char-after pos)
- if (not (and (<= ?0 c) (<= c ?9)))
- return start))))
+ (let ((start (ac-prefix-symbol))
+ (case-fold-search t))
+ (when (and start
+ (not (string-match-p "\\`\\(?:0[xbo][0-9a-f]+\\|[0-9]+\\)"
+ (buffer-substring-no-properties start (point)))))
+ start)))
(defun ac-prefix-symbol ()
"Default prefix definition function."

0 comments on commit 2e83566

Please sign in to comment.