dockerfile-mode icon indicating copy to clipboard operation
dockerfile-mode copied to clipboard

Messed up indentation

Open rislah opened this issue 6 years ago • 10 comments

Talking about this commit: https://github.com/spotify/dockerfile-mode/commit/9f4381178aa03212cd3400c60c0f48ff306a0994

I'm not sure how its for others but for some reason for me whenever I press RET and type any random character it automatically indents. Had to manually edit that indentation code out of the source and its now all ok.

rislah avatar Oct 25 '18 11:10 rislah

The biggest issue I have with this is the indentation of the comments, e.g

  # This is a comment
ARG FOO=bar

I didn't check the commit yet to see if it's the intended behavior.

EDIT: Sorry it seems that it has been corrected here https://github.com/spotify/dockerfile-mode/pull/46

kode9 avatar Nov 05 '18 18:11 kode9

out

Still an issue.

robbyoconnor avatar Feb 18 '19 22:02 robbyoconnor

Yes, really annoying :(

hlolli avatar Nov 04 '19 11:11 hlolli

fork, edit indentation code out and use straight/quelpa etc to use your fork. this repo is dead and I dont think it will ever be fixed

rislah avatar Nov 04 '19 17:11 rislah

I'd be happy to do a PR this this repository if @MaSven is still around to merge it. Forking and fixing for myself only is a last resort. If someone has forked it and is maintaining it, then why not change the recipe on melpa to the fork? (given that the upstream is really dead).

hlolli avatar Nov 04 '19 17:11 hlolli

I made a workaround for this, not sure what the cause is but I noticed that (get-text-property (point-at-bol) 'face) returned a list of faces for me, and the existing code seemed to expect a single face.

https://github.com/sp3ctum/spacemacs/commit/99e9875f8 update: played around a bit more with this, it seems the existing indentation logic was not compatible with an aggressive-indent-mode that I have in spacemacs. I chose to use sh-indent-line (from shell scripts) instead since it seemed to understand how to indent multi-line commands correctly.

mikavilpas avatar Dec 18 '19 08:12 mikavilpas

I think I did similar and it started to work for me

On 12/18/19 3:02 AM, Mika Vilpas wrote:

I made a workaround for this, not sure what the cause is but I noticed that |(get-text-property (point-at-bol) 'face)| returned a list of faces for me, and the existing code seemed to expect a single face.

sp3ctum/spacemacs@479e938 https://github.com/sp3ctum/spacemacs/commit/479e938bcf3357983ea563a4cb097be2011794bd

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/spotify/dockerfile-mode/issues/47?email_source=notifications&email_token=AAAFUMGQH2RCVP4HVXHBKVLQZHKI7A5CNFSM4F7IJOEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHFITWY#issuecomment-566921691, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAFUMC2LI4OVY62RHVHHRTQZHKI7ANCNFSM4F7IJOEA.

robbyoconnor avatar Dec 18 '19 15:12 robbyoconnor

As an alternative, I removed the broken feature and recompiled. To resolve, comment out https://github.com/spotify/dockerfile-mode/commit/9f4381178aa03212cd3400c60c0f48ff306a0994#r134956599 and recompile your packages ^1 with the following:

M-: (byte-recompile-directory package-user-dir nil 'force)

andersonjwan avatar Dec 14 '23 04:12 andersonjwan

I presume this was fixed and should be closed? Following what OP mentions and this gif in a comment, I can't reproduce the problem. The commit that incorrectly assigned indent-line-function had also had follow up fixes.

So everything seems okay.

Hi-Angel avatar Feb 26 '24 05:02 Hi-Angel

@rislah can you comment on that?

Hi-Angel avatar Feb 26 '24 07:02 Hi-Angel

I still experience this on version 20240324.1010, but only when LSP-mode is active. It may just be an lsp-mode issue or perhaps these two modes interact with each other somehow. I do not have time to dig in but perhaps this will help someone reproduce if they choose to investigate this.

eval-on-point avatar Jun 18 '24 20:06 eval-on-point

I still experience this on version 20240324.1010, but only when LSP-mode is active. It may just be an lsp-mode issue or perhaps these two modes interact with each other somehow. I do not have time to dig in but perhaps this will help someone reproduce if they choose to investigate this.

Step to reproduce are needed.

That said, I think it is better to report this as a separate bug as it's clearly caused by something different compared to the one here.

This one I think should be closed. Since the OP has gone radio silent, perhaps @drewcsillag…?

Hi-Angel avatar Jun 18 '24 21:06 Hi-Angel

@Hi-Angel i think that makes sense

drewcsillag avatar Jun 18 '24 21:06 drewcsillag