[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master aaf199e 006/271: Fix global wraparound.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master aaf199e 006/271: Fix global wraparound. |
Date: |
Thu, 05 Feb 2015 18:29:22 +0000 |
branch: master
commit aaf199e81ce7c7372a149a12f3c7f9fa5604b9be
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Fix global wraparound.
---
context-coloring.el | 11 ++++++++++-
test/fixtures/depth.js | 23 +++++++++++++++++++++++
2 files changed, 33 insertions(+), 1 deletions(-)
diff --git a/context-coloring.el b/context-coloring.el
index 29eb00e..6fc2545 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -112,7 +112,16 @@ Determines depth at which to cycle through faces again.")
For example: 'context-coloring-depth-1-face'."
(intern-soft
(concat "context-coloring-depth-"
- (number-to-string (mod depth context-coloring-face-count))
+ (number-to-string
+ (or
+ ;; Has a face directly mapping to it.
+ (and (< depth context-coloring-face-count)
+ depth)
+ ;; After the number of available faces are used up, pretend the
0th
+ ;; face doesn't exist.
+ (+ 1
+ (mod (- depth 1)
+ (- context-coloring-face-count 1)))))
"-face")))
(defconst context-coloring-path
diff --git a/test/fixtures/depth.js b/test/fixtures/depth.js
new file mode 100644
index 0000000..107d8ca
--- /dev/null
+++ b/test/fixtures/depth.js
@@ -0,0 +1,23 @@
+function a() {
+ function b() {
+ function c() {
+ function d() {
+ function e() {
+ function f() {
+ function g() {
+ function h() {
+ function i() {
+ function j() {
+ function k() {
+
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
- [elpa] master updated (c8087b9 -> dc9644e), Jackson Ray Hamilton, 2015/02/05
- [elpa] master e3fc05a 011/271: Create bin and scripts directories., Jackson Ray Hamilton, 2015/02/05
- [elpa] master aaf199e 006/271: Fix global wraparound.,
Jackson Ray Hamilton <=
- [elpa] master 809d48b 020/271: Minor tweaks., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 98df7db 010/271: Optimize cli a little bit., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 5fd312b 002/271: More planning and research., Jackson Ray Hamilton, 2015/02/05
- [elpa] master ebc0b99 013/271: Add rollover font lock optimization., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 615ce2c 004/271: Wow, actually works., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 6d79b91 024/271: Idly colorizing after changes working. Cancelling seemingly not working., Jackson Ray Hamilton, 2015/02/05
- [elpa] master fd4b629 007/271: Add mode., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 6e991c4 014/271: Fix off-by-one error., Jackson Ray Hamilton, 2015/02/05
- [elpa] master b35380b 019/271: Vastly improve idle timer strategy., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 7ac8db6 012/271: Fix a bug where strings were matched., Jackson Ray Hamilton, 2015/02/05