~ubuntu-branches/ubuntu/maverick/vim/maverick

« back to all changes in this revision

Viewing changes to runtime/ftplugin/debchangelog.vim

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2008-06-26 13:42:18 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20080626134218-703edeyb8k70qpbz
Tags: 1:7.1.314-3ubuntu1
* Resynchronise with Debian. Remaining changes:
  - Enable detection of GNU screen as a mouse-capable terminal.
  - Add NoDisplay=true to gvim.desktop.
  - Drop vim-lesstif package and lesstif2-dev build-dependency.
  - Build-depend on libxt-dev.
  - Enable Python interpreter on basic builds.
  - Create a .pot file for translations.
  - Disable autoindent, line-wrapping, and backup files by default.
* Fixes various vulnerabilities due to improper quoting of 'execute'
  arguments (LP: #240216).
* Drop fixes for upgrade problems from Ubuntu 6.06 LTS; direct upgrades
  from 6.06 to 8.10 will not be supported.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
" License:      GNU GPL, version 2.0 or later
8
8
" URL:          http://git.debian.org/?p=pkg-vim/vim.git;a=blob_plain;f=runtime/ftplugin/debchangelog.vim;hb=debian
9
9
 
 
10
" Bug completion requires apt-listbugs installed for Debian packages or
 
11
" python-launchpad-bugs installed for Ubuntu packages
 
12
 
10
13
if exists("b:did_ftplugin")
11
14
  finish
12
15
endif
116
119
    normal h
117
120
    normal 
118
121
    call setline(1, substitute(getline(1), '-\$\$', '-', ''))
119
 
    normal zo
 
122
    if exists("g:debchangelog_fold_enable")
 
123
        foldopen
 
124
    endif
120
125
    call AddEntry()
121
126
endfunction
122
127
 
279
284
  return '='
280
285
endfunction
281
286
 
282
 
silent! foldopen!   " unfold the entry the cursor is on (usually the first one)
 
287
if exists("g:debchangelog_fold_enable")
 
288
  silent! foldopen!   " unfold the entry the cursor is on (usually the first one)
 
289
endif
283
290
 
284
291
" }}}
285
292
 
312
319
    endwhile
313
320
    return colidx
314
321
  else " return matches:
 
322
    let bug_lines = []
315
323
    if g:debchangelog_complete_mode == 'lp'
316
324
      if ! has('python')
317
325
        echoerr 'vim must be built with Python support to use LP bug completion'
320
328
      let pkgsrc = DebGetPkgSrcName(line('.'))
321
329
      python << EOF
322
330
import vim
323
 
from launchpadbugs import connector
324
 
buglist = connector.ConnectBugList()
325
 
bl = list(buglist('https://bugs.launchpad.net/ubuntu/+source/%s' % vim.eval('pkgsrc')))
326
 
bl.sort(None, int)
327
 
liststr = '['
328
 
for bug in bl:
329
 
    liststr += "'#%d - %s'," % (int(bug), bug.summary.replace('\'', '\'\''))
330
 
liststr += ']'
331
 
vim.command('silent let bug_lines = %s' % liststr)
 
331
try:
 
332
    from launchpadbugs import connector
 
333
    buglist = connector.ConnectBugList()
 
334
    bl = list(buglist('https://bugs.launchpad.net/ubuntu/+source/%s' % vim.eval('pkgsrc')))
 
335
    bl.sort(None, int)
 
336
    liststr = '['
 
337
    for bug in bl:
 
338
        liststr += "'#%d - %s'," % (int(bug), bug.summary.replace('\'', '\'\''))
 
339
    liststr += ']'
 
340
    vim.command('silent let bug_lines = %s' % liststr)
 
341
except ImportError:
 
342
    vim.command('echoerr \'python-launchpad-bugs needs to be installed to use Launchpad bug completion\'')
332
343
EOF
333
344
    else
334
345
      if ! filereadable('/usr/sbin/apt-listbugs')
336
347
        return
337
348
      endif
338
349
      let pkgsrc = DebGetPkgSrcName(line('.'))
339
 
      let listbugs_output = system('apt-listbugs -s ' . g:debchangelog_listbugs_severities . ' list ' . pkgsrc . ' | grep "^ #" 2> /dev/null')
 
350
      let listbugs_output = system('/usr/sbin/apt-listbugs -s ' . g:debchangelog_listbugs_severities . ' list ' . pkgsrc . ' | grep "^ #" 2> /dev/null')
340
351
      let bug_lines = split(listbugs_output, '\n')
341
352
    endif
342
353
    let completions = []