[vim/vim] ignorecase gets set globally when editing ada file (Issue #15772)

39 views
Skip to first unread message

mmalcomson

unread,
Sep 30, 2024, 12:41:59 PM9/30/24
to vim/vim, Subscribed

Steps to reproduce

:setglobal ignorecase?
:edit test.ada
:setglobal ignorecase?

Expected behaviour

Global ignorecase should be unaffected by opening the file.

Version of Vim

9.1 With patches 1-16, 647, 678

Environment

Ubuntu, xterm, TERM=xterm-256color.
Don't believe this matters.

Logs and stack traces

I think this is simply a misconfiguration in the `ada` ftplugin.
Looks like the same problem is in the `hamster` ftplugin as well, while the `baan` ftplugin has a comment specifically about why it's not doing the same thing.

vim [17:39:13] % grep -A8 "\*'ignorecase'" runtime/doc/options.txt
                        *'ignorecase'* *'ic'* *'noignorecase'* *'noic'*
'ignorecase' 'ic'       boolean (default off)
                        global
        Ignore case in search patterns, |cmdline-completion|, when
        searching in the tags file, and non-|Vim9| |expr-==|.
        Also see 'smartcase' and 'tagcase'.
        Can be overruled by using "\c" or "\C" in the pattern, see
        |/ignorecase|.

vim [17:39:18] % git grep -n 'setlocal.*ignorecase'
runtime/ftplugin/ada.vim:52:setlocal ignorecase
runtime/ftplugin/hamster.vim:60:setlocal ignorecase
runtime/syntax/baan.vim:15:"setlocal ignorecase         "This is not a local yet ;-(
vim [17:39:28] %


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15772@github.com>

Christian Brabandt

unread,
Sep 30, 2024, 4:36:39 PM9/30/24
to vim/vim, Subscribed

Seems both ada.vim and hamster.vim also do not correctly setup b:undo_ftplugin. we can ignore syntax/baan.vim as this one is commented out.

ping the maintainers: @dfishburn and @krischik


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15772/2384099168@github.com>

matveyt

unread,
Oct 1, 2024, 3:58:46 AM10/1/24
to vim/vim, Subscribed

Seems both ada.vim and hamster.vim also do not correctly setup b:undo_ftplugin

Both ignorecase and smartcase are global. ftplugin should not touch them in the first place.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15772/2385056392@github.com>

Christian Brabandt

unread,
Oct 1, 2024, 1:38:27 PM10/1/24
to vim/vim, Subscribed

Both ignorecase and smartcase are global. ftplugin should not touch them in the first place.

Yes thanks, I was just noting an additional problem here.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15772/2386588109@github.com>

Martin Krischik

unread,
Oct 3, 2024, 2:23:26 PM10/3/24
to vim/vim, Subscribed

Are we talking about the current version (https://github.com/krischik/vim-ada) or the 15 year old version bundled with the vim?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15772/2392047319@github.com>

Christian Brabandt

unread,
Oct 3, 2024, 2:28:39 PM10/3/24
to vim/vim, Subscribed

The one bundled with Vim. I am not sure why you created a PR against vim-scripts repository. That has nothing to do with our project and used to be just a scraper for the scripts distributed at www.vim.org/scripts


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15772/2392057896@github.com>

Martin Krischik

unread,
Oct 3, 2024, 2:30:14 PM10/3/24
to vim/vim, Subscribed

Problem is that long ago I managed to get an updated accepted but that was a one off. So while I continued to work on the ada support I never managed to get another update through. So the one bundled with vim is outdated by 15 years.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15772/2392061299@github.com>

Christian Brabandt

unread,
Oct 3, 2024, 2:30:17 PM10/3/24
to vim/vim, Subscribed

BTW it seems your current version has the same problem (setting ignorecase, which should be a user setting)


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15772/2392061566@github.com>

Christian Brabandt

unread,
Oct 3, 2024, 2:30:39 PM10/3/24
to vim/vim, Subscribed

How about to create a PR then here with your maintained version?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15772/2392062290@github.com>

Martin Krischik

unread,
Oct 3, 2024, 4:18:52 PM10/3/24
to vim/vim, Subscribed

BTW it seems your current version has the same problem (setting ignorecase, which should be a user setting)

But Ada is an ignore case language so that would be annoying for ada programmer. It would be helpful, especially for those who use multiple languages, if it was possible to set the ignore case depending on language.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15772/2392256563@github.com>

Christian Brabandt

unread,
Oct 3, 2024, 4:38:17 PM10/3/24
to vim/vim, Subscribed

Then it should be put behind a configuration switch


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15772/2392288590@github.com>

Gary Johnson

unread,
Oct 3, 2024, 5:17:30 PM10/3/24
to reply+ACY5DGAVLSY4S7P45Y...@reply.github.com, vim...@googlegroups.com
On 2024-10-03, Martin Krischik wrote:
> BTW it seems your current version has the same problem (setting ignorecase,
> which should be a user setting)
>
> But Ada is an ignore case language so that would be annoying for ada
> programmer. It would be helpful, especially for those who use multiple
> languages, if it was possible to set the ignore case depending on language.

How about using BufEnter and BufLeave autocommands to control
'ignorecase'?

BufEnter would check the 'filetype' and if "ada", then save the
current value of 'ignorecase' and set 'ignorecase'.

BufLeave would check the 'filetype' and if "ada", then restore the
saved value of 'ignorecase'.

Regards,
Gary

vim-dev ML

unread,
Oct 3, 2024, 5:18:01 PM10/3/24
to vim/vim, vim-dev ML, Your activity


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15772/2392354572@github.com>

matveyt

unread,
Oct 3, 2024, 5:28:55 PM10/3/24
to vim/vim, vim-dev ML, Comment

ignorecase is basically for command-line stuff/searching. This is why it is global. Programming language syntax is a different thing. It should never rely on ignorecase setting.


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/issues/15772/2392370178@github.com>

Martin Krischik

unread,
Jan 3, 2025, 4:45:45 AMJan 3
to vim/vim, vim-dev ML, Comment

@matveyt

ignorecase is basically for command-line stuff/searching. This is why it is global. Programming language syntax is a different thing. It should never rely on ignorecase setting.

I found some time to look at it and this is problem “If the option does not have a local value the global value is set.”. Implicit operations like this are always bad. Of course when using setlocal I expected that only the current buffer is affected. I have a lot of setlocal in the ftplugin for Ada — how do I know which are actually local as desired and which I have to remove or make optional because they are secretly global?

Also, please print a waning for every setlocal which is actually global.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: <vim/vim/issues/15772/2568953435@github.com>

matveyt

unread,
Jan 3, 2025, 4:53:18 AMJan 3
to vim/vim, vim-dev ML, Comment

@krischik "How do I know..." Read the help for each option you set. Caps on. Always read help. Caps off.

Vim never complains in runtime for setlocal/setglobal mismatched. It simply chooses "the lesser evil" silently.


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/issues/15772/2568962583@github.com>

Martin Krischik

unread,
Jan 3, 2025, 12:01:35 PMJan 3
to vim/vim, vim-dev ML, Comment

@krischik "How do I know..." Read the help for each option you set. Caps on. Always read help. Caps off.

I did read manual. I checked the ingnorecase option. I could not find it. If it's there it's well hidden. Well, figured it out anyway and I found three of setlocal which where setglobal in disguise. Fixed it.

However: I'm don't really want to send the fix upstream any more. I was unsure about this before because it would be quite a large pull request including the update to Ada 2022, the Alire package manager and a lot of other improvements from more helpful vim users. Only today I merged in 4 pull requests.

Preparing a pull request that size will be a lot of work and if you are that unhelpful and smug on a simple question I don't want to deal with you with pull request several hundred lines large.

Vim never complains in runtime for setlocal/setglobal mismatched. It simply chooses "the lesser evil" silently.

As mentioned: I consider that bad. I consider choosing silently a bad idea. Ada, for example, doesn't do that.


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/issues/15772/2569544251@github.com>

Christian Brabandt

unread,
Jan 4, 2025, 11:33:16 AMJan 4
to vim/vim, vim-dev ML, Comment

You can see it here:

:h 'ignorecase'

https://github.com/vim/vim/blob/e15cbc1af47e9dea90448c714eb4908e5d4302fc/runtime/doc/options.txt#L4527

Note it says global, while e.g. for buffer-local options, it say (example for 'fileencoding'):
https://github.com/vim/vim/blob/e15cbc1af47e9dea90448c714eb4908e5d4302fc/runtime/doc/options.txt#L3297

I can understand your frustration. I'd still suggest to prepare a PR which supports the minimum needed required to fix this issue and perhaps includes the Ada 2022 features? So that all Vim users benefit from it. And for a more feature-rich solution, people can continue to use your ada-script plugin?

Thanks,


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/issues/15772/2571349560@github.com>

masar3141

unread,
Sep 5, 2025, 1:05:07 PMSep 5
to vim/vim, vim-dev ML, Comment
masar3141 left a comment (vim/vim#15772)

Can someone explain to me how to make sure ada.vim never loads? In addition to this issue, this script defines insert mode bindings making vim unusable if your leader key is space. Author is very opinionated, against standards and is not willing to change any of that.
If it's not possible to prevent it from loading, I'm in great favor of stopping to ship it with vim. No one will complain. Users can still put it in their vimrc; how it should've been from the beginning.
See #1347.


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/issues/15772/3259152852@github.com>

Christian Brabandt

unread,
Sep 5, 2025, 2:55:51 PMSep 5
to vim/vim, vim-dev ML, Comment
chrisbra left a comment (vim/vim#15772)

What mappings are those? If I read ftplugin/ada.vim correctly, it should those should only be set, when g:ada_extended_completion is set.


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/issues/15772/3259425977@github.com>

Christian Brabandt

unread,
Sep 5, 2025, 3:15:23 PMSep 5
to vim/vim, vim-dev ML, Comment
chrisbra left a comment (vim/vim#15772)

fixed as of dfcd9ac


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/issues/15772/3259469288@github.com>

Reply all
Reply to author
Forward
0 new messages