neovimhaskell / haskell-vim

Custom Haskell Vimscripts
BSD 2-Clause "Simplified" License
681 stars 84 forks source link

Disabling indentation via g:haskell_indent_disable=1 still causes haskel-vim's indent script to flag indentation as being set #90

Closed exallium closed 7 years ago

exallium commented 7 years ago

The Problem

I have two plugins:

haskell-vim
vim-indent-plugin

They are in my pathogen bundle directory, and are loaded into the system.

I have g:haskell_indent_disable=1 set in my .vimrc or nanovim equivalent.

What happens?

Since pathogen by default does not make you order plugin resolution, on my machine this means that haskell-vim is resolved before vim-indent-plugin. This causes haskell-vim's intent/haskell.vim script to run, which sets b:did_indent=1. It performs this check before even considering the value of g:haskell_indent_disable.

What then happens is that when vim-indent-plugin is evaluated, it's own indent/haskell.vim script is almost wholly ignored, given it has the same check at the top of it's own file, as I suspect is a commonality among all properly written vim indent scripts.

Utilizing vim-plug and making sure vim-indent-plugin is explicitly resolved before haskell-vim fixes this issue.

Proposed Solution

There are two possible solutions.

  1. Better documentation for this flag, noting that you will still ignore indentation styles from other plugins
  2. Check for the flag's existence and equality to either 1 or a non-zero value (I'm not sure how true/false normally works in vim scripts)

I would be willing to fork and perform necessary script updates and propose a pull request, regardless of which approach you're comfortable with, but I wanted to point this out first and foremost so that there wasn't wasted time.

raichoo commented 7 years ago

Hey, thanks for the detailed report. If you are planning to fix this I'm absolutely in favor of merging your work. I'm fine with whatever approach you are going for as long it does not break anything (which I'm sure is not what you are aiming for ^^).

Kind regards, raichoo