vim-nix icon indicating copy to clipboard operation
vim-nix copied to clipboard

Lines starting with `#` break indentation

Open ppom0 opened this issue 2 years ago • 4 comments

It seems like lines starting with # (either a nix comment or in a ''double apostrophe'' string, like a shebang for example) reset previous indentation.

{
    # bad indentation on this comment will propagate
    # to the next lines if typing `=i{`
  programs.fish.enable = true;
}

↓ (after typing =i{)

{
    # bad indentation on this comment will propagate
    # to the next lines if typing `=i{`
    programs.fish.enable = true;
  }

This makes it hard to apply the new indentation of a block, when surrounded by new {} for example.

ppom0 avatar Jan 05 '23 20:01 ppom0

same issue

qixiang-mft avatar May 25 '23 04:05 qixiang-mft

I found it was effect by this code;

  " Skip indentation for single line comments explicitly, in case a
   " comment was just inserted (eg. visual block mode)
   if getline(v:lnum) =~ '^\s*#'
     return indent(v:lnum)
   endif

I 've commented that code , it seems works https://github.com/hitsmaxft/vim-nix/commit/7c5a324c76ce85e1501861adb68756f7966a57f7

hitsmaxft avatar May 25 '23 04:05 hitsmaxft

Any updates here? Has the fix been merged? I've installed the plugin directly from nix but I have the same problem.

AgrYpn1a avatar Oct 19 '23 11:10 AgrYpn1a

Ping?

bam80 avatar Apr 25 '24 14:04 bam80