Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
Default to using hard tabs in Makefile files
Browse files Browse the repository at this point in the history
This is a temporary solution until scoped settings supports this
type of restriction.

Closes atom/language-make#3
  • Loading branch information
kevinsawicki committed Nov 12, 2014
1 parent 4141b45 commit 7abfd45
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/text-editor-spec.coffee
Expand Up @@ -3470,6 +3470,19 @@ describe "TextEditor", ->
runs ->
expect(editor.softTabs).toBe false

it "uses hard tabs in Makefile files", ->
# FIXME remove once this is handled by a scoped setting in the
# language-make package

waitsForPromise ->
atom.packages.activatePackage('language-make')

waitsForPromise ->
atom.project.open('Makefile').then (o) -> editor = o

runs ->
expect(editor.softTabs).toBe false

describe ".destroy()", ->
it "destroys all markers associated with the edit session", ->
expect(buffer.getMarkerCount()).toBeGreaterThan 0
Expand Down
4 changes: 4 additions & 0 deletions src/text-editor.coffee
Expand Up @@ -2243,6 +2243,10 @@ class TextEditor extends Model
# Returns a {Boolean} or undefined if no non-comment lines had leading
# whitespace.
usesSoftTabs: ->
# FIXME Remove once this can be specified as a scoped setting in the
# language-make package
return false if @getGrammar().scopeName is 'source.makefile'

This comment has been minimized.

Copy link
@parabuzzle

parabuzzle Nov 12, 2014

👍


for bufferRow in [0..@buffer.getLastRow()]
continue if @displayBuffer.tokenizedBuffer.tokenizedLineForRow(bufferRow).isComment()

Expand Down

0 comments on commit 7abfd45

Please sign in to comment.