mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-11 04:48:44 +03:00
Append anchor characters when placeholder is not added
This commit is contained in:
parent
4c1ecf61df
commit
8aba95191d
@ -337,6 +337,14 @@ describe "TokenizedBuffer", ->
|
||||
afterEach ->
|
||||
editSession.destroy()
|
||||
|
||||
it "correctly parses a long line", ->
|
||||
longLine = tokenizedBuffer.lineForScreenRow(0)
|
||||
expect(longLine.text).toBe "longggggggggggggggggggggggggggggggggggggggggggggggg"
|
||||
{ tokens } = longLine
|
||||
|
||||
expect(tokens[0].value).toBe "longggggggggggggggggggggggggggggggggggggggggggggggg"
|
||||
expect(tokens[0].scopes).toEqual ["text.git-commit", "meta.scope.message.git-commit", "invalid.deprecated.line-too-long.git-commit"]
|
||||
|
||||
it "correctly parses the number sign of the first comment line", ->
|
||||
commentLine = tokenizedBuffer.lineForScreenRow(1)
|
||||
expect(commentLine.text).toBe "# Please enter the commit message for your changes. Lines starting"
|
||||
|
@ -176,8 +176,16 @@ class Pattern
|
||||
for character in @regexSource.split('')
|
||||
if escape
|
||||
switch character
|
||||
when 'A' then escaped.push(placeholder) unless firstLine
|
||||
when 'G' then escaped.push(placeholder) unless offset is anchor
|
||||
when 'A'
|
||||
if firstLine
|
||||
escaped.push("\\#{character}")
|
||||
else
|
||||
escaped.push(placeholder)
|
||||
when 'G'
|
||||
if offset is anchor
|
||||
escaped.push("\\#{character}")
|
||||
else
|
||||
escaped.push(placeholder)
|
||||
when 'z' then escaped.push('$(?!\n)(?<!\n)')
|
||||
else escaped.push("\\#{character}")
|
||||
escape = false
|
||||
|
Loading…
Reference in New Issue
Block a user