dense-analysis / dense-analysis/ale

Cannot use ALE in MacVim when the file is opened via the right-click context menu or the File > Open dialog in MacVim

Open
#4,758 2 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Vim Script
Stars
14k
Forks
1.5k
Avg merge
17h 49m
Merged PRs (30d)
1

Description

## Information

**VIM version**
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Jan 4 2024 03:08:50)
macOS version - arm64

Operating System: macOS Sonoma 14.4.1

## What went wrong

I'm using MacVim r179 (Vim 9.1.0) and using the latest version of ALE (I updated it today). I'm running macOS Sonoma 14.4.1 and Z shell: zsh 5.9 (x86_64-apple-darwin23.0).

I could not find a solution to this problem on the Internet, so I decided to post it here. When I open a file (say an HTML file) with MacVim by right-clicking on the file and selecting Open With > MacVim *or* using File > Open in MacVim, I am unable to use ALE to lint or fix the file.

However, if I use Terminal Vim (that ships with Mac) or use the Terminal to navigate to the directory where the file is stored and open the file with MacVim, like `mvim file`, ALE works as expected.

Here is my ALE configuration:
```
let g:ale_fixers = { 'html': ['prettier'] }
let g:ale_linters = { 'html': ['stylelint'] }
```

## Reproducing the bug

Open a file in MacVim either by right-clicking on the file and selecting Open With > MacVim *or* using File > Open in MacVim. Then, try to use ALE to lint or fix the file.

## ALEInfo
I opened an HTML file with MacVim from the right-click context menu in Mac, ran `ALEFix`, followed by `ALEInfo`. Here is the output from `ALEInfo`.

```
### :ALEInfo

Expand

Current Filetype: html
Available Linters: ['alex', 'angular', 'cspell', 'eslint', 'fecs', 'htmlhint', 'proselint', 'stylelint', 'tidy', 'vscodehtml', 'writegood']
Linter Aliases:
'angular' -> ['angular-language-server', 'angularls']
'writegood' -> ['write-good']
Enabled Linters: ['stylelint']
Ignored Linters: []
Suggested Fixers:
'fecs' - Apply fecs format to a file.
'html-beautify' - Fix HTML files with html-beautify from js-beautify.
'prettier' - Apply prettier to a file.
'remove_trailing_lines' - Remove all blank lines at the end of a file.
'rustywind' - Sort Tailwind CSS classes
'tidy' - Fix HTML files with tidy.
'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.

Linter Variables:
let g:ale_html_stylelint_executable = 'stylelint'
let g:ale_html_stylelint_options = ''
let g:ale_html_stylelint_use_global = 0

Global Variables:
let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = v:null
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = v:null
let g:ale_disable_lsp = 'auto'
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%code: %%s'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 0
let g:ale_fixers = {'html': ['prettier']}
let g:ale_history_enabled = 1
let g:ale_info_default_mode = 'preview'
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_insert_leave = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'normal'
let g:ale_linter_aliases = {}
let g:ale_linters = {'html': ['stylelint']}
let g:ale_linters_explicit = 0
let g:ale_linters_ignore = {}
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '%code: %%s'
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = -1
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 0
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_root = {}
let g:ale_set_balloons = 1
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = 'E'
let g:ale_sign_info = 'I'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = 'E'
let g:ale_sign_style_warning = 'W'
let g:ale_sign_warning = 'W'
let g:ale_sign_highlight_linenrs = 0
let g:ale_type_map = {}
let g:ale_use_neovim_diagnostics_api = 0
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 'all'
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1

Command History:

(executable check - success) /Users/ribbons/node_modules/.bin/stylelint
(finished - exit code 127) ['/bin/zsh', '-c', '''/Users/ribbons/node_modules/.bin/stylelint'' --stdin-filename ''/Users/ribbons/Downloads/test.html'' < ''/var/folders/gl/bz0xhvl176j6zy6gl6vq2qch0000gp/T/vsIU9Vk/1/test.html''']

<<>>
env: node: No such file or directory
<<>>

(finished - exit code 127) ['/bin/zsh', '-c', '''/Users/ribbons/node_modules/.bin/prettier'' --version']

<<>>
env: node: No such file or directory
<<>>

(finished - exit code 127) ['/bin/zsh', '-c', '''/Users/ribbons/node_modules/.bin/prettier'' ''/var/folders/gl/bz0xhvl176j6zy6gl6vq2qch0000gp/T/vsIU9Vk/2/test.html'' --write']

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.