mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Make bufferRangeForScopeAtPosition work with last column of scope
This commit is contained in:
@@ -585,6 +585,7 @@ describe "TokenizedBuffer", ->
|
||||
describe "when the selector matches a single token at the position", ->
|
||||
it "returns the range covered by the token", ->
|
||||
expect(tokenizedBuffer.bufferRangeForScopeAtPosition('.storage.modifier.js', [0, 1])).toEqual [[0, 0], [0, 3]]
|
||||
expect(tokenizedBuffer.bufferRangeForScopeAtPosition('.storage.modifier.js', [0, 3])).toEqual [[0, 0], [0, 3]]
|
||||
|
||||
describe "when the selector matches a run of multiple tokens at the position", ->
|
||||
it "returns the range covered by all contigous tokens (within a single line)", ->
|
||||
|
||||
@@ -490,7 +490,7 @@ class TokenizedBuffer extends Model
|
||||
scopes.pop()
|
||||
else
|
||||
endColumn = startColumn + tag
|
||||
if endColumn > position.column
|
||||
if endColumn >= position.column
|
||||
break
|
||||
else
|
||||
startColumn = endColumn
|
||||
|
||||
Reference in New Issue
Block a user