[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 18e35dd 069/271: Shift token properties.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master 18e35dd 069/271: Shift token properties. |
Date: |
Thu, 05 Feb 2015 18:29:51 +0000 |
branch: master
commit 18e35dd4f4e18a7f4283aae42996e9f753a8b939
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Shift token properties.
---
context-coloring.el | 13 +++++++------
scopifier.js | 16 ++++++++--------
2 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/context-coloring.el b/context-coloring.el
index 018a94e..18bf436 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -169,9 +169,10 @@ For example: \"context-coloring-depth-1-face\"."
;;; Tokenization functions
;; Tokens are vectors with the following form:
-;; 0: Level
-;; 1: Start
-;; 2: End
+;; 0: Start
+;; 1: End
+;; 2: Level
+;; 3: Style
(defun context-coloring-apply-tokens (tokens)
"Processes TOKENS to apply context-based coloring to the current buffer."
(with-silent-modifications
@@ -181,9 +182,9 @@ For example: \"context-coloring-depth-1-face\"."
(len (length tokens)))
(while (< i len)
(let ((token (elt tokens i)))
- (let ((face (context-coloring-level-face (elt token 0) (elt token
3)))
- (start (elt token 1))
- (end (elt token 2)))
+ (let ((start (elt token 0))
+ (end (elt token 1))
+ (face (context-coloring-level-face (elt token 2) (elt token
3))))
(add-text-properties start end `(face ,face rear-nonsticky t))))
(setq i (+ i 1))))))
diff --git a/scopifier.js b/scopifier.js
index 7e4c64e..26501e4 100644
--- a/scopifier.js
+++ b/scopifier.js
@@ -9,8 +9,8 @@ var escope = require('escope'),
isDefined = function (definitions, range) {
return definitions.some(function (definition) {
// Check for identical definitions.
- return definition[1] === range[0] &&
- definition[2] === range[1];
+ return definition[0] === range[0] &&
+ definition[1] === range[1];
});
},
@@ -63,18 +63,18 @@ module.exports = function (code) {
return;
}
scopes = scopes.concat([[
- scope.level,
scope.block.range[0],
scope.block.range[1],
+ scope.level,
normal
]]);
definitions = scope.variables.reduce(function (definitions, variable) {
var mappedDefinitions = variable.defs.map(function (definition) {
var range = definition.name.range;
return [
- scope.level,
range[0],
range[1],
+ scope.level,
bold
];
});
@@ -87,9 +87,9 @@ module.exports = function (code) {
}
return references.concat([[
// Handle global references too.
- reference.resolved ? reference.resolved.scope.level : 0,
range[0],
range[1],
+ reference.resolved ? reference.resolved.scope.level : 0,
normal
]]);
}, []);
@@ -100,9 +100,9 @@ module.exports = function (code) {
.map(function (comment) {
var range = comment.range;
return [
- -1,
range[0],
range[1],
+ -1,
normal
];
});
@@ -113,9 +113,9 @@ module.exports = function (code) {
.map(function (token) {
// Emacs starts counting from 1.
return [
- token[0],
+ token[0] + 1,
token[1] + 1,
- token[2] + 1,
+ token[2],
token[3]
];
});
- [elpa] master 7a49f9f 067/271: Make comments italic., (continued)
- [elpa] master 7a49f9f 067/271: Make comments italic., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 07fe42c 078/271: Vconcat., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 28667b8 075/271: Move microoptimized scopifier into the limelight., Jackson Ray Hamilton, 2015/02/05
- [elpa] master c1f9f11 063/271: Switch to concat., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 183ac4e 081/271: Add emacs benchmark., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 59b1c99 074/271: Documentation and cleanup., Jackson Ray Hamilton, 2015/02/05
- [elpa] master c81c3fd 068/271: Make declarations bold., Jackson Ray Hamilton, 2015/02/05
- [elpa] master f9eb4a1 080/271: Revert "Use alist of faces.", Jackson Ray Hamilton, 2015/02/05
- [elpa] master ea3fd79 071/271: Make implicit global variables bold., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 1039a74 073/271: Update microoptimized version., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 18e35dd 069/271: Shift token properties.,
Jackson Ray Hamilton <=
- [elpa] master 49f5e3e 079/271: Use alist of faces., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 8615688 089/271: Create tests., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 10d7726 077/271: Use custom JSON parser., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 099f434 082/271: Add optimizations for byte-compilation., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 0bfdbcd 085/271: Remove naive timers., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 4874e1e 086/271: Improve documentation and Makefile., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 43d2ca0 090/271: Remove unused monad., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 820becb 084/271: Fix test., Jackson Ray Hamilton, 2015/02/05
- [elpa] master fb57258 088/271: Reorder readme., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 426a7cd 083/271: Fix regression where existent definitions were missed., Jackson Ray Hamilton, 2015/02/05