Automatically use hard tabs for Makefile buffers #3
Comments
+1 |
👍 This was the first thing that forced me to switch back to Sublime Text!! |
👍 just ran into this problem now. |
+1
OMG! Pain in the a... please fix this!!! |
+1 |
+1 I will edit it in vim for the time being. |
I ended up just writing this and placing it in my Atom > Init Script path = require 'path'
# Set Makefile[.any extension] and '.mk' files to always use hard tabs
atom.workspaceView.eachEditorView (editorView) ->
editor = editorView.getEditor()
if path.basename(editor.getPath()) is 'Makefile'
editor.setSoftTabs(false)
if path.extname(editor.getPath()) is '.mk'
editor.setSoftTabs(false)
Seems to be working so far |
I'll look into creating a pull request for a fix for this |
+1 |
I wonder if anyone is going to review my pull request... 😕 |
@parabuzzle Have you started the PR? This bug is super annoying. |
@yoshuawuyts the pull request has been open since May -> #8 |
@yoshuawuyts according to the PR referenced here for the core Atom code (atom/atom#2917) It appears that languages can specify hard tabs as an option. I'll look into it today. If that's the case, I'll submit a new PR using this new option. |
+1 |
+1 |
+1 |
1 similar comment
+1 |
Seems it is fixed in 0.127, working for me now |
@kelvich really? It doesn't seem to work for me and I don't see it in the release notes here: https://github.com/atom/atom/releases/tag/v0.127.0 Are you using the hack that @brannonlucas provided earlier on this thread? |
Using version 0.130 and this still hasn't been fixed. |
+1 |
1 similar comment
+1 |
+1 |
so I count 16 +1's so far ... |
why isn't anyone merging #8? what's bad about it? |
+1 and it's back to LightTable for me... |
I just want to apologize for the long delay in getting this issue addressed. It got held up in trying to fix it the "right way" when it should have been addressed immediately while that right way is figured out and implemented. The "right way" in this case was having this be a scoped setting that any language package can use. I've added a workaround for now that hard codes this grammar's scope name in core and uses hard tabs as the default. Again, apologies for the long delay in getting this addressed, it will be fixed in Atom 0.146 which should be out shortly. |
nice @kevinsawicki! thanks! |
🎉 thanks! |
0.146 is now released with this fix included in it, apologies again for how long this took to get fixed. |
thanks! |
Thanks @kevinsawicki - appreciate it :) |
@parabuzzle is this a subtle advertisement for using rake instead? 😀 |
Could my own settings be overriding this somehow? I'm still ending up with spaces by default. |
@rgbkrk The language settings should win, and in the case of language-make, the tab type is set @atom/feedback Can any of you repro this? |
I believe it's because Make 0.18.0 (which added the scoped setting) isn't installed on Atom 1.0.19. |
@50Wliu I installed the language-make 0.19.0 with Console output:
|
I've been struggling like a nutbag with this in Atom 1.4.1. I've tried every possible setting of "Soft Tabs" and "Tab Type". I've tried to convert spaces to tabs. Whatever I do; when the Checking "Show invisibles" reveals that I do get tabs when I press the tab key (represented by I finally figured out what it was. The tabs to spaces package has a configuration that I obviously must have turned on at some point: "tabs-to-spaces":
"onSave": "untabify" This was being applied even when the package was disabled. Perhaps I need to restart Atom for the package's config to be ignored when the package is disabled? I don't know. I've tried to change the package's configuration to this: "*":
"tabs-to-spaces":
"onSave": "untabify"
"Makefile":
"tabs-to-spaces":
"onSave": "tabify" But it doesn't help. I know this is beyond the scope of this issue, but I just wanted to mention it, for anyone else who stumble on to this with the same problem as I. |
@asbjornu Are you able to reproduce the behavior in safe mode? |
@thomasjo You're right. As I've updated my comment above, tabs-to-spaces and its |
For anyone who ends up here from Google and sees @asbjornu's configuration, it needs to look like this: "*":
"tabs-to-spaces":
"onSave": "untabify"
".source.makefile":
"tabs-to-spaces":
"onSave": "tabify" This was addressed in: lee-dohm/tabs-to-spaces#42 |
@sunjay, ace! I couldnt figure out what the scope key name was for makefiles. |
I am still having this issue, but not sure what package is causing it as I do not have tabs-to-spaces installed. I have tabs in my Makefile, but on save, I get 8 spaces instead. |
I may be dense, but where do I set those settings to make it work? |
How do I tell Atom which files are makefiles? I have some files like makefile.dev, makefile.inc, |
@dcburleigh you can use the Grammar Selector (Ctrl+Shift+L on Windows/Linux, cmd-shift-L on macOS), or follow the instructions at https://discuss.atom.io/t/how-do-i-make-atom-recognize-a-file-with-extension-x-as-language-y/26539. |
I had some joy using
|
Since makefiles require hard tabs, I'd like Atom to automatically use hard tabs whenever I'm editing a Makefile. Atom already detects the buffer type automatically.
Sublime Text accomplishes this via language-specific configuration files. So for example, I can independently specify 2 spaces default for javascript, 4 spaces default for python, and hard tab default for Makefiles. Not sure if this makes sense in Atom land but it seems like a simple way to do it.
The text was updated successfully, but these errors were encountered: