editorconfig / editorconfig-vim

EditorConfig plugin for Vim
http://editorconfig.org
Other
3.13k stars 137 forks source link

Fix conditional definition of `b:editorconfig_applied` for external cores #193

Open cxw42 opened 2 years ago

cxw42 commented 2 years ago

After f305bc77faef4b418aee65682d7d147f64cfd5a9 (#142), we have:

       if s:UseConfigFiles_VimCore() == 0
            let b:editorconfig_applied = 1
        endif
    elseif s:editorconfig_core_mode ==? 'external_command'
        call s:UseConfigFiles_ExternalCommand()
        let b:editorconfig_applied = 1

I believe that should be

       if s:UseConfigFiles_VimCore() == 0
            let b:editorconfig_applied = 1
        endif
    elseif s:editorconfig_core_mode ==? 'external_command'
        if s:UseConfigFiles_ExternalCommand() == 0   " <====
          let b:editorconfig_applied = 1
        endif   " <====

plus changes to s:UseConfigFiles_ExternalCommand() to return nonzero on shell-exit != 0.

CC @dbarnett

dbarnett commented 2 years ago

Thanks for the heads up! Looks reasonable.