Vim documents non-existent indent plugin options

Bug #479767 reported by James Michael Fultz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
vim (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: vim-runtime

Trying to configure indentation of case statements in shell scripts when using Vim's indent plugin, I consulted the documentation. While in command mode in Vim, enter the following:

:help ft-sh-indent

Attempting to set values for any of the documented dictionary keys results in an undefined variable error message. It seems that the features of the shipped indent plugin for shell scripts does not match the documented behavior.

Description: Ubuntu 9.04
Release: 9.04

vim-runtime:
  Installed: 2:7.2.079-1ubuntu5
  Candidate: 2:7.2.079-1ubuntu5
  Version table:
 *** 2:7.2.079-1ubuntu5 0
        500 http://us.archive.ubuntu.com jaunty/main Packages
        100 /var/lib/dpkg/status

Revision history for this message
Will Gray (graywh) wrote :

How did you attempt to set the variables? And from what script? I think you should be doing the following in ~/.vim/indent/sh.vim

let b:sh_indent_options = { 'default': value, 'continuation-line': value }

where "value" is replaced by the values you want (number of spaces).

Will Gray (graywh)
Changed in vim (Ubuntu):
status: New → Incomplete
Revision history for this message
James Michael Fultz (croooow) wrote :

Effectively, yes that is what I was doing. This is what I have in my '~/.vim/indent/sh.vim' as of now:

if !exists("b:sh_indent_options")
  let b:sh_indent_options = {}
endif

let b:sh_indent_options['case-labels'] = 0

I'd forgotten about this bug report and have since spoken with the Vim developers about the matter. There was a loss of synchronization in the help text and 'indent/sh.vim' script functionality. It has since been remedied in the upstream sources.

Here is a link to relevant message from a vim_use list discussion on issue:
<http://groups.google.com/group/vim_use/msg/d055f98d917a37f1>

Quoting a relevant paragraph from that message:

"The problem is that the latest official release of vim is 7.2 with
no patches. It is up to anyone building a patched version to
download and apply the patches themselves. The patches, however, do
not include any updates to the runtime files, so one has to also
download and install the latest runtime files. That apparently
wasn't done by the folks distributing the vim packages that you and
I have. That, or the new indent/sh.vim didn't make it into the
runtime repository. "

Revision history for this message
James Michael Fultz (croooow) wrote :

Correction to my prior comment where I wrote '~/.vim/indent/sh.vim', I meant to have wrote '~/.vim/after/indent/sh.vim'.

Revision history for this message
Will Gray (graywh) wrote :

If this is fixed or invalid, please mark it as so.

Changed in vim (Ubuntu):
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.