Saturday, August 19, 2023

Re: Vim error message when opening .ini file

On 8/19/23 22:21, Enan Ajmain wrote:
> On Sat, 19 Aug 2023 15:24:29 -0700 (PDT)
> "Melvin Q. Watchpocket" <watchpacket@gmail.com> wrote:
>> <https://vi.stackexchange.com/posts/42840/timeline>
>>
>> Vim shows the following long error message when I open a file with a
>> dot-ini (.ini) file extension:
>> Error detected while processing
>> /usr/share/vim/vimrc[25]../usr/share/vim/vim90/syntax/syntax.vim[44]..BufRead
>> Autocommands for "*~"..BufRead Autocommands for "*.ini"..FileType
>> Autocommands for "*"..Syntax Autocommands for "*"..function
>> <SNR>3_SynSet[25]..script /usr/share/vim/vim90/syntax/dosini.vim: line 28:
>> E10: \ should be followed by /, ? or &
>
> I can't test on Linux right now. On Windows, Vim 9.0.1640 opens ini
> files without error. Could you try opening the file with "--clean"
> argument?
>
> I also see that between my version (9.0.1640) and yours (9.0.1713),
> dosini.vim changed [1]. Maybe try commenting out line 28?
>
> Copying Hong Xu, the developer of dosini syntax file.
>
> --
> Enan
>
> [1]:
> https://github.com/xuhdev/syntax-dosini.vim/commit/e04e6e82b90bdbbe7aef11e767b8ad1e6f5010bf
>
>
>> Following that "\" on line 28 with any one of "/", "?" or "&" resulted in
>> an even longer error message.
>>
>> In my .zshenv:
>> export EDITOR=vim
>> export FCEDIT=vim
>> export SLANG_EDITOR=vim
>>
>> Also:
>> --> vim --version
>> VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Aug 15 2023 20:47:29) Included
>> patches: 1-1713 Modified by team+vim@tracker.debian.org Compiled by
>> team+vim@tracker.debian.org Huge version without GUI. Features included (+)
>> or not (-): +acl +file_in_path +mouse_urxvt -tag_any_white +arabic
>> +find_in_path +mouse_xterm -tcl +autocmd +float +multi_byte +termguicolors
>> +autochdir +folding +multi_lang +terminal -autoservername -footer -mzscheme
>> +terminfo -balloon_eval +fork() +netbeans_intg +termresponse
>> +balloon_eval_term +gettext +num64 +textobjects -browse -hangul_input
>> +packages +textprop ++builtin_terms +iconv +path_extra +timers +byte_offset
>> +insert_expand -perl +title +channel +ipv6 +persistent_undo -toolbar
>> +cindent +job +popupwin +user_commands -clientserver +jumplist +postscript
>> +vartabs -clipboard +keymap +printer +vertsplit +cmdline_compl +lambda
>> +profile +vim9script +cmdline_hist +langmap -python +viminfo +cmdline_info
>> +libcall +python3 +virtualedit +comments +linebreak +quickfix +visual
>> +conceal +lispindent +reltime +visualextra +cryptv +listcmds +rightleft
>> +vreplace +cscope +localmap -ruby +wildignore +cursorbind -lua +scrollbind
>> +wildmenu +cursorshape +menu +signs +windows +dialog_con +mksession
>> +smartindent +writebackup +diff +modify_fname +sodium -X11 +digraphs +mouse
>> -sound -xfontset -dnd -mouseshape +spell -xim -ebcdic +mouse_dec
>> +startuptime -xpm +emacs_tags +mouse_gpm +statusline -xsmp +eval
>> -mouse_jsbterm -sun_workshop -xterm_clipboard +ex_extra +mouse_netterm
>> +syntax -xterm_save +extra_search +mouse_sgr +tag_binary -farsi
>> -mouse_sysmouse -tag_old_static system vimrc file: "$VIM/vimrc" user vimrc
>> file: "$HOME/.vimrc" 2nd user vimrc file: "~/.vim/vimrc" user exrc file:
>> "$HOME/.exrc" defaults file: "$VIMRUNTIME/defaults.vim" fall-back for $VIM:
>> "/usr/share/vim" Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H
>> -Wdate-time -g -O2
>> -ffile-prefix-map=/build/vim-9Zy3tT/vim-9.0.0749+really.v9.0.1713=.
>> -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects
>> -fstack-protector-strong -Wformat -Werror=format-security -D_REENTRANT
>> -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 Linking: gcc -Wl,-Bsymbolic-functions
>> -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -Wl,-z,now
>> -Wl,--as-needed -o vim -lm -ltinfo -lselinux -lsodium -lacl -lattr -lgpm
>> -L/usr/lib/python3.10/config-3.10-x86_64-linux-gnu -lpython3.10 -lcrypt
>> -ldl -lm -lm```
>>
>> :set runtimepath? shows:
>> runtimepath=~/.vim,/var/lib/vim/addons,/etc/vim,/usr/share/vim/vimfiles,/usr/share/vim/vim90/,/usr/share/vim/vimfiles/after,/etc/vim/after,/var/lib/vim/addons/after,~/.vim/after
>>
>>
>> Also, I have vim-plug the vim plugin manager in ~/.vim/autoload/plug.vim
>> but no plugins installed yet.
>>
>> How can I get Vim to open .ini files without any error message(s)?
>>

Hi Enan and Melvin,

I can't reproduce the bug with the latest version of the dosini file. My Vim version is 9.0.1378 but I have installed the latest dosini syntax file.

Would you still be able to reproduce the error if you comment out lines 27 and 28 of `/usr/share/vim/vim90/syntax/dosini.vim`?

Also CCing the patch contributor Lucas.

Hong

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/466b6889-d650-1969-5c75-1033c536c8f7%40topbug.net.

No comments: