-
Notifications
You must be signed in to change notification settings - Fork 347
haskell-cabal-add-dependency messes up cabal file if tabs are not turned off. #474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@rabipelais: Is this the same as #376? |
That solution doesn't work for me in this case, because that I will test if changing |
Yes, apparently setting
should I submit a pull request? Or is the change way too small? |
@rabipelais: Change looks good to me and was already discussed in #376. A pull request would be greatly appreciated. |
This prevents the insertion of unwanted tabs in the cabal file when auto-inserting dependencies, regardless of the user value for `indent-tabs-mode` in the default mode (default is fundamental mode). Solves issues haskell#379 and haskell#474.
@rabipelais: Is this working for you now? Can we close? |
Yes, working. It can be closed, thank you. |
@rabipelais: You can close this issue yourself as you are the one reporting it! |
I am attempting to add a dependency automatically to a cabal file. However, after the insertion, the cabal file is completely broken. This happens if
indent-tabs-mode
is set to true, even if it is set to false for haskell-cabal mode.Steps to reproduce
Start with default auto-generated minimal cabal file.
With that file in the current buffer run:
(setq-default indent-tabs-mode t)
(haskell-cabal-add-dependency "foo" "3" nil nil)
Answer
yes
to promptsExpected result
Actual result
Note that the weird indentation and lack of
base
is verbatim copied from my editor. The whitespace betweenbuild-depends:
andfoo
is tabs, not spaces.Notes
As mentioned above, this happens if tabs are turned on, even if they are turned off for all haskell related modes. Adding more dependencies after this only makes the file wonkier.
If I undo the
(haskell-cabal-add-dependency "foo" "3" nil nil)
command, setindent-tabs-mode
tonil
, and re-add the dependency, it is inserted correctly this time.The text was updated successfully, but these errors were encountered: