From aa8425677461befa8afef0f9ef627171eeb1afa5 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Thu, 21 Feb 2013 13:41:05 -0800 Subject: [PATCH 1/2] `-` and `_` are not considered word characters by default. Fixes #297 --- src/app/editor.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/editor.coffee b/src/app/editor.coffee index 5f6772537..c4fcf1bdb 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -19,7 +19,7 @@ class Editor extends View autosave: false autoIndent: true autoIndentOnPaste: false - nonWordCharacters: "./\\()\"'-_:,.;<>~!@#$%^&*|+=[]{}`~?" + nonWordCharacters: "./\\()\"':,.;<>~!@#$%^&*|+=[]{}`~?" @nextEditorId: 1 From dae46eab87c8e70720d1f57b3faa21cc4b089f97 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 21 Feb 2013 16:11:40 -0800 Subject: [PATCH 2/2] Create class array for each whitespace type Previously if the token has both leading and trailing whitespace the classes would bleed across the cases and cause an exception to be thrown. Closes #298 --- src/app/token.coffee | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/token.coffee b/src/app/token.coffee index d11cde460..9c3d50ed8 100644 --- a/src/app/token.coffee +++ b/src/app/token.coffee @@ -71,9 +71,9 @@ class Token .replace(//g, '>') - classes = [] - classes.push('indent-guide') if hasIndentGuide if @isHardTab + classes = [] + classes.push('indent-guide') if hasIndentGuide classes.push('invisible') if invisibles.tab classes.push('hard-tab') classes = classes.join(' ') @@ -82,6 +82,8 @@ class Token "#{match}" else if hasLeadingWhitespace + classes = [] + classes.push('indent-guide') if hasIndentGuide classes.push('invisible') if invisibles.space classes.push('leading-whitespace') classes = classes.join(' ') @@ -89,6 +91,8 @@ class Token match = match.replace(/./g, invisibles.space) if invisibles.space "#{match}" if hasTrailingWhitespace + classes = [] + classes.push('indent-guide') if hasIndentGuide classes.push('invisible') if invisibles.space classes.push('trailing-whitespace') classes = classes.join(' ')