diff options
author | Bram Moolenaar <Bram@vim.org> | 2012-02-04 21:59:01 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2012-02-04 21:59:01 +0100 |
commit | b8ff1fb5eb60511f21c425e09c473105ffff02cb (patch) | |
tree | 5af8b9f0ccc3a2147ef884c4d8d9f7149833bbe8 /runtime | |
parent | 7f85d297dc80666946f7940bc06e45cc2aa79b5d (diff) |
updated for version 7.3.423v7.3.423
Problem: Small mistakes in comments, proto and indent.
Solution: Fix the mistakes.
Also update runtime files
Diffstat (limited to 'runtime')
38 files changed, 816 insertions, 341 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index abf9c908eb..0b7a3ed8f3 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.3. Last change: 2012 Jan 04 +*eval.txt* For Vim version 7.3. Last change: 2012 Jan 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -4814,6 +4814,10 @@ search({pattern} [, {flags} [, {stopline} [, {timeout}]]]) *search()* Search for regexp pattern {pattern}. The search starts at the cursor position (you can use |cursor()| to set it). + If there is no match a 0 is returned and the cursor doesn't + move. No error message is given. + When a match has been found its line number is returned. + {flags} is a String, which can contain these character flags: 'b' search backward instead of forward 'c' accept a match at the cursor position @@ -4847,9 +4851,6 @@ search({pattern} [, {flags} [, {stopline} [, {timeout}]]]) *search()* giving the argument. {only available when compiled with the |+reltime| feature} - If there is no match a 0 is returned and the cursor doesn't - move. No error message is given. - When a match has been found its line number is returned. *search()-sub-match* With the 'p' flag the returned value is one more than the first sub-match in \(\). One if none of them matched but the @@ -5068,7 +5069,8 @@ setcmdpos({pos}) *setcmdpos()* line. setline({lnum}, {text}) *setline()* - Set line {lnum} of the current buffer to {text}. + Set line {lnum} of the current buffer to {text}. To insert + lines use |append()|. {lnum} is used like with |getline()|. When {lnum} is just below the last line the {text} will be added as a new line. diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt index 03d24a5b86..e542a04f51 100644 --- a/runtime/doc/if_pyth.txt +++ b/runtime/doc/if_pyth.txt @@ -1,4 +1,4 @@ -*if_pyth.txt* For Vim version 7.3. Last change: 2011 Aug 19 +*if_pyth.txt* For Vim version 7.3. Last change: 2012 Feb 04 VIM REFERENCE MANUAL by Paul Moore @@ -222,8 +222,9 @@ Buffer objects represent vim buffers. You can obtain them in a number of ways: - from indexing vim.buffers (|python-buffers|) - from the "buffer" attribute of a window (|python-window|) -Buffer objects have one read-only attribute - name - the full file name for -the buffer. They also have three methods (append, mark, and range; see below). +Buffer objects have two read-only attributes - name - the full file name for +the buffer, and number - the buffer number. They also have three methods +(append, mark, and range; see below). You can also treat buffer objects as sequence objects. In this context, they act as if they were lists (yes, they are mutable) of strings, with each diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index 24a17d5240..924e8a458e 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -1,4 +1,4 @@ -*insert.txt* For Vim version 7.3. Last change: 2011 Sep 14 +*insert.txt* For Vim version 7.3. Last change: 2012 Jan 26 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1010,7 +1010,8 @@ number between zero and the cursor column "col('.')". This involves looking at the characters just before the cursor and including those characters that could be part of the completed item. The text between this column and the cursor column will be replaced with the matches. Return -1 if no completion -can be done. +can be done, the completion will be cancelled with an error message. Return +-2 to cancel silently. On the second invocation the arguments are: a:findstart 0 diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index 73b79f23dd..f117f6fb39 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -1,4 +1,4 @@ -*map.txt* For Vim version 7.3. Last change: 2011 Oct 22 +*map.txt* For Vim version 7.3. Last change: 2012 Feb 02 VIM REFERENCE MANUAL by Bram Moolenaar @@ -527,7 +527,7 @@ mappings. <LocalLeader> is just like <Leader>, except that it uses "maplocalleader" instead of "mapleader". <LocalLeader> is to be used for mappings which are local to a buffer. Example: > - :map <LocalLeader>q \DoItNow + :map <buffer> <LocalLeader>A oanother line<Esc> < In a global plugin <Leader> should be used and in a filetype plugin <LocalLeader>. "mapleader" and "maplocalleader" can be equal. Although, if diff --git a/runtime/doc/netbeans.txt b/runtime/doc/netbeans.txt index b7614e7f0d..abb88683ee 100644 --- a/runtime/doc/netbeans.txt +++ b/runtime/doc/netbeans.txt @@ -1,4 +1,4 @@ -*netbeans.txt* For Vim version 7.3. Last change: 2011 Oct 20 +*netbeans.txt* For Vim version 7.3. Last change: 2012 Jan 26 VIM REFERENCE MANUAL by Gordon Prieur et al. @@ -266,7 +266,7 @@ mechanism. Netbeans messages are processed when Vim is idle, waiting for user input. When Vim is run in non-interactive mode, for example when running an automated test case that sources a Vim script, the idle loop may not be called often -enough. In that case, insert |sleep| commands in the Vim script. The |sleep| +enough. In that case, insert |:sleep| commands in the Vim script. The |:sleep| command does invoke Netbeans messages processing. 6.1 Kinds of messages |nb-messages| diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index 4b74d1f563..1d4a09f3dc 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -1,4 +1,4 @@ -*pi_netrw.txt* For Vim version 7.3. Last change: 2011 Sep 26 +*pi_netrw.txt* For Vim version 7.3. Last change: 2012 Jan 26 ----------------------------------------------------- NETRW REFERENCE MANUAL by Charles E. Campbell, Jr. @@ -43,7 +43,7 @@ Copyright: Copyright (C) 1999-2011 Charles E Campbell, Jr *netrw-copyright* 5. Activation...........................................|netrw-activate| 6. Transparent Remote File Editing......................|netrw-transparent| 7. Ex Commands..........................................|netrw-ex| -8. Variables and Options................................|netrw-var| +8. Variables and Options................................|netrw-settings| 9. Browsing.............................................|netrw-browse| Introduction To Browsing...........................|netrw-intro-browse| Quick Reference: Maps..............................|netrw-browse-maps| @@ -309,7 +309,7 @@ CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass* {{{2 :call NetUserPass("uid","password") -- sets global uid and password NETRW VARIABLES AND SETTINGS *netrw-variables* {{{2 -(also see: |netrw-browser-var| |netrw-protocol| |netrw-settings| |netrw-var|) +(also see: |netrw-browser-var| |netrw-protocol| |netrw-settings|) Netrw provides a lot of variables which allow you to customize netrw to your preferences. One way to look at them is via the command :NetrwSettings (see @@ -2354,7 +2354,7 @@ settings. You may change any of their values; when you save the file, the settings therein will be used. One may also press "?" on any of the lines for help on what each of the variables do. -(also see: |netrw-browser-var| |netrw-protocol| |netrw-var| |netrw-variables|) +(also see: |netrw-browser-var| |netrw-protocol| |netrw-settings| |netrw-variables|) ============================================================================== diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 4d343ccf35..c108ceef29 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.3. Last change: 2012 Jan 20 +*todo.txt* For Vim version 7.3. Last change: 2012 Feb 04 VIM REFERENCE MANUAL by Bram Moolenaar @@ -41,18 +41,27 @@ Discussion about canonicalization of Hebrew. (Ron Aaron, 2011 April 10) Once syntax and other runtime files have been fixed: add "set cp" to check.vim. Use a function to run both with 'cp' and 'nocp'. -Win32: When the taskbar is at the top of the screen creating the tabbar causes -the window to move unnecessarily. (William E. Skeith III, 2012 Jan 12) -Patch: 2012 Jan 13 - -Patch for using DBCS encoding in user command. (Yasuhiro Matsumoto, 2012 Jan -15) Update Jan 17. - Repeating search history entries. (Edwin Steiner, 2012 Jan 17) Jan 18: Caused by patch 7.3.265? +Patch for '$' not being displayed for a change when 'cpoptions' contains "$". +(Yasuhiro Matsumoto, 2012 Jan 28, patch by Hideki EIRAKU and Hirohito Higashi) + +Patch to speed up readfile(). (John Little, 2012 Feb 1) +Adjustment by Charles Peacech, Feb 3. +8 When editing a file with extremely long lines (e.g., an executable), the + "linerest" in readfile() is allocated twice to be able to copy what was + read so far. Use realloc() instead? Or split the line when allocating + memory fails and "linerest" is big (> 100000)? + +Patch to fix a crash when an xpm file is invalid. (Dave Bodenstab, 2012 Jan +27) + Hang in using VimEnter. (Alex Efros, 2012 Jan 14) +Patch for behavior of "." in compatible mode. (Yasuhiro Matsumoto, patch by +Hideki EIRAKU, 2012 Jan 28) + ":cd" doesn't work when current directory path contains wildcards. finddir() has the same problem. (Yukihiro Nakadaira, 2012 Jan 10) @@ -70,8 +79,9 @@ Another one from Taro Muraoka, 2012 Jan 12. ":doau" says it triggers modeline. Should this only happen for events used when loading a buffer? (Kana Natsuno, 2011 Nov 7) -Patch to fix "it" and "at" when there is a dash in the tag name. -(Christian Brabandt, 2011 Nov 20) +Patch for compiler warnings in if_perl. (James McCoy, 2011 Jan 30) + +Patch for X selection conversion. (Alex Efros, 2012 Jan 24) Patch to make 'shcf' default work better. (Benjamin Fritz, 2011 Nov 18) Win32: When 'shell' is cmd.exe this command fails: @@ -83,6 +93,15 @@ Patch to make 'shcf' default work better. (Benjamin Fritz, 2011 Nov 18) Other way to start Mzscheme. Tim Brown, 2011 Oct 5: change main call. Later patch by Sergey Khorev, 2011 Oct 9. +Patch to allow ! for :all and :sall, as documented. (Hirohito Higashi, 2012 +Jan 30) + +Patch for "tab drop hoge" moving current window. (Higashi, 2012 Jan 31) +":tab drop buffer.c" always opens a new tab, also if buffer.c is already in an +open window. (Herb Sitz, 2011 Nov 17) +":tab drop filename" doesn't work nicely when "filename" is open in a window +in another tab. (Tony Mechelynck, 2009 Feb 13) + Patch to make InsertCharPre work better. (Yasuhiro Matsumoto, 2011 Oct 21) Patch to fix closed folds with "loadview". (Xavier de Gaye, 2011 Nov 25) @@ -93,9 +112,24 @@ Or use expand('<sid>')? Patch for glob() returning a list. (Christian Brabandt, 2011 Aug 24, second one) +Win32: When the taskbar is at the top of the screen creating the tabbar causes +the window to move unnecessarily. (William E. Skeith III, 2012 Jan 12) +Patch: 2012 Jan 13 Needs more work (2012 Feb 2) + Patch to highlight cursor line number. (Howard Buchholz (lhb), 2011 Oct 18) -Patch for urxvt mouse support after shell command. (Issue 31) +URXVT: +- will get stuck if byte sequence does not containe expected semicolon. +- Patch for urxvt mouse support after shell command. (Issue 31) +- Use urxvt mouse support also in xterm. Explanations: + http://www.midnight-commander.org/ticket/2662 + +Patch for using QuickFixCmdPre for more commands. (Marcin Szamotulski, 2012 +Feb 1, update Feb 2) + +When running Vim in silent ex mode, an existing swapfile causes Vim to wait +for a user action without a prompt. (Maarten Billemont, 2012 Feb 3) +Do give the prompt? Quit with an error? When exiting with unsaved changes, selecting an existing file in the file dialog, there is no dialog to ask whether the existing file should be @@ -128,13 +162,15 @@ Patch for: (Christian Brabandt, 2011 Aug 24, updated patch) buffer={bufnr}". So one can remove all signs for one file/buffer. Patch to add "onselected" callback for completion. (Taro Muraoka, 2011 Sep 24) +Another for CompleteFuncOk. (Florian Klein, 2012 Jan 31) +Name it "CompleteFuncDone". + +Patch for Make_mvc.mak and Make_ming.mak for Ruby support. (Yasuhiro +Matsumoto, 2012 Jan 30) Use a count before "v" and "V" to select that many characters or lines? (Kikyous) -":tab drop buffer.c" always opens a new tab, also if buffer.c is already in an -open window. (Herb Sitz, 2011 Nov 17) - Problem with winfixheight and resizing. (Yukihiro Nakadaira, 2011 Sep 17) Patch Sep 18. @@ -289,6 +325,8 @@ Patch to support sorting on floating point number. (Alex Jakushev, 2010 Oct Patch to addd TextDeletePost and TextYankPost events. (Philippe Vaucher, 2011 May 24) Update May 26. +Patch for :tabrecently. (Hirokazu Yoshida, 2012 Jan 30) + When a script contains "redir => s:foo" but doesn't end redirection, a following "redir" command gives an error for not being able to access s:foo. (ZyX, 2011 Mar 27) @@ -949,9 +987,6 @@ try/catch not working when inside a for loop. (ZyX, 2011 Jan 25) ":tab help" always opens a new tab, while ":help" re-uses an existing window. Would be more consistent when an existing tab is re-used. (Tony Mechelynck) -":tab drop filename" doesn't work nicely when "filename" is open in a window -in another tab. (Tony Mechelynck, 2009 Feb 13) - Add ":nofold". Range will apply without expanding to closed fold. Including NFA regexp code: @@ -3228,10 +3263,6 @@ Performance: Add command to compile a vim script and add it to the file in-place. Split Ex command executing into a parsing and executing phase. Use compiled code for functions, while loops, etc. -8 When editing a file with extremely long lines (e.g., an executable), the - "linerest" in readfile() is allocated twice to be able to copy what was - read so far. Use realloc() instead? Or split the line when allocating - memory fails and "linerest" is big (> 100000)? 8 When defining autocommands (e.g., from $VIMRUNTIME/filetype.vim), need to compare each pattern with all existing patterns. Use a hash code to avoid using strcmp() too often? diff --git a/runtime/doc/undo.txt b/runtime/doc/undo.txt index e9ed1b2cb5..b1652374cc 100644 --- a/runtime/doc/undo.txt +++ b/runtime/doc/undo.txt @@ -1,4 +1,4 @@ -*undo.txt* For Vim version 7.3. Last change: 2011 Aug 02 +*undo.txt* For Vim version 7.3. Last change: 2012 Jan 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -267,7 +267,12 @@ respectively: (the magic number at the start of the file is wrong), then this fails, unless the ! was added. If it exists and does look like an undo file it is - overwritten. + overwritten. If there is no undo-history, nothing will be + written. + Implementation detail: Overwriting happens by first deleting + the existing file and then creating a new file with the same + name. So it is not possible to overwrite an existing undofile + in a write-protected directory. {not in Vi} :rundo {file} Read undo history from {file}. diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 17cd03424f..26a435b480 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2012 Jan 04 +" Last Change: 2012 Feb 03 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -1264,7 +1264,7 @@ au BufNewFile,BufRead *.nqc setf nqc au BufNewFile,BufRead *.nsi setf nsis " OCAML -au BufNewFile,BufRead *.ml,*.mli,*.mll,*.mly setf ocaml +au BufNewFile,BufRead *.ml,*.mli,*.mll,*.mly,.ocamlinit setf ocaml " Occam au BufNewFile,BufRead *.occ setf occam diff --git a/runtime/ftplugin/debchangelog.vim b/runtime/ftplugin/debchangelog.vim index 80ff8efe42..c74284fd41 100644 --- a/runtime/ftplugin/debchangelog.vim +++ b/runtime/ftplugin/debchangelog.vim @@ -3,8 +3,8 @@ " Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> " Former Maintainers: Michael Piefel <piefel@informatik.hu-berlin.de> " Stefano Zacchiroli <zack@debian.org> -" Last Change: 2010-07-11 -" License: GNU GPL, version 2.0 or later +" Last Change: 2012-01-31 +" License: Vim License " URL: http://hg.debian.org/hg/pkg-vim/vim/file/unstable/runtime/ftplugin/debchangelog.vim " Bug completion requires apt-listbugs installed for Debian packages or diff --git a/runtime/ftplugin/ocaml.vim b/runtime/ftplugin/ocaml.vim index de3e41bcd7..c379f53405 100644 --- a/runtime/ftplugin/ocaml.vim +++ b/runtime/ftplugin/ocaml.vim @@ -2,17 +2,18 @@ " Maintainer: David Baelde <firstname.name@ens-lyon.org> " Mike Leary <leary@nwlink.com> " Markus Mottl <markus.mottl@gmail.com> +" Pierre Vittet <pierre-vittet@pvittet.com> " Stefano Zacchiroli <zack@bononia.it> " Vincent Aravantinos <firstname.name@imag.fr> " URL: http://www.ocaml.info/vim/ftplugin/ocaml.vim -" Last Change: 2010 Jul 10 - Bugfix, thanks to Pat Rondon +" Last Change: +" 2012 Jan 15 - Bugfix :reloading .annot file does not close +" splitted view (Pierre Vittet) +" 2011 Nov 28 - Bugfix + support of multiple ml annotation file +" (Pierre Vittet) +" 2010 Jul 10 - Bugfix, thanks to Pat Rondon " 2008 Jul 17 - Bugfix related to fnameescape (VA) -" 2007 Sep 09 - Added .annot support for ocamlbuild, python not -" needed anymore (VA) -" 2006 May 01 - Added .annot support for file.whateverext (SZ) -" 2006 Apr 11 - Fixed an initialization bug; fixed ASS abbrev (MM) -" 2005 Oct 13 - removed GPL; better matchit support (MM, SZ) -" + if exists("b:did_ftplugin") finish endif @@ -287,24 +288,27 @@ endfunction endfun " After call: - " - b:annot_file_path : + " + " Following information have been put in s:annot_file_list, using + " annot_file_name name as key: + " - annot_file_path : " path to the .annot file corresponding to the " source file (dealing with ocamlbuild stuff) - " - b:_build_path: + " - _build_path: " path to the build directory even if this one is " not named '_build' + " - date_of_last annot: + " Set to 0 until we load the file. It contains the + " date at which the file has been loaded. function! s:Locate_annotation() - if !b:annotation_file_located - + let annot_file_name = s:Fnameescape(expand('%:t:r')).'.annot' + if !exists ("s:annot_file_list[annot_file_name]") silent exe 'cd' s:Fnameescape(expand('%:p:h')) - - let annot_file_name = s:Fnameescape(expand('%:r')).'.annot' - " 1st case : the annot file is in the same directory as the buffer (no ocamlbuild) - let b:annot_file_path = findfile(annot_file_name,'.') - if b:annot_file_path != '' - let b:annot_file_path = getcwd().'/'.b:annot_file_path - let b:_build_path = '' + let annot_file_path = findfile(annot_file_name,'.') + if annot_file_path != '' + let annot_file_path = getcwd().'/'.annot_file_path + let _build_path = '' else " 2nd case : the buffer and the _build directory are in the same directory " .. @@ -312,12 +316,12 @@ endfunction " / \ " _build .ml " - let b:_build_path = finddir('_build','.') - if b:_build_path != '' - let b:_build_path = getcwd().'/'.b:_build_path - let b:annot_file_path = findfile(annot_file_name,'_build') - if b:annot_file_path != '' - let b:annot_file_path = getcwd().'/'.b:annot_file_path + let _build_path = finddir('_build','.') + if _build_path != '' + let _build_path = getcwd().'/'._build_path + let annot_file_path = findfile(annot_file_name,'_build') + if annot_file_path != '' + let annot_file_path = getcwd().'/'.annot_file_path endif else " 3rd case : the _build directory is in a directory higher in the file hierarchy @@ -330,46 +334,54 @@ endfunction " \ " .ml " - let b:_build_path = finddir('_build',';') - if b:_build_path != '' - let project_path = substitute(b:_build_path,'/_build$','','') + let _build_path = finddir('_build',';') + if _build_path != '' + let project_path = substitute(_build_path,'/_build$','','') let path_relative_to_project = s:Fnameescape(substitute(expand('%:p:h'),project_path.'/','','')) - let b:annot_file_path = findfile(annot_file_name,project_path.'/_build/'.path_relative_to_project) + let annot_file_path = findfile(annot_file_name,project_path.'/_build/'.path_relative_to_project) else - let b:annot_file_path = findfile(annot_file_name,'**') + let annot_file_path = findfile(annot_file_name,'**') "4th case : what if the user decided to change the name of the _build directory ? " -> we relax the constraints, it should work in most cases - if b:annot_file_path != '' + if annot_file_path != '' " 4a. we suppose the renamed _build directory is in the current directory - let b:_build_path = matchstr(b:annot_file_path,'^[^/]*') - if b:annot_file_path != '' - let b:annot_file_path = getcwd().'/'.b:annot_file_path - let b:_build_path = getcwd().'/'.b:_build_path + let _build_path = matchstr(annot_file_path,'^[^/]*') + if annot_file_path != '' + let annot_file_path = getcwd().'/'.annot_file_path + let _build_path = getcwd().'/'._build_path endif else + let annot_file_name = '' + "(Pierre Vittet: I have commented 4b because this was chrashing + "my vim (it produced infinite loop)) + " " 4b. anarchy : the renamed _build directory may be higher in the hierarchy " this will work if the file for which we are looking annotations has a unique name in the whole project " if this is not the case, it may still work, but no warranty here - let b:annot_file_path = findfile(annot_file_name,'**;') - let project_path = s:Find_common_path(b:annot_file_path,expand('%:p:h')) - let b:_build_path = matchstr(b:annot_file_path,project_path.'/[^/]*') + "let annot_file_path = findfile(annot_file_name,'**;') + "let project_path = s:Find_common_path(annot_file_path,expand('%:p:h')) + "let _build_path = matchstr(annot_file_path,project_path.'/[^/]*') endif endif endif endif - if b:annot_file_path == '' + if annot_file_path == '' throw 'E484: no annotation file found' endif silent exe 'cd' '-' - - let b:annotation_file_located = 1 + let s:annot_file_list[annot_file_name]= [annot_file_path, _build_path, 0] endif endfun - " This in order to locate the .annot file only once - let b:annotation_file_located = 0 + " This variable contain a dictionnary of list. Each element of the dictionnary + " represent an annotation system. An annotation system is a list with : + " - annotation file name as it's key + " - annotation file path as first element of the contained list + " - build path as second element of the contained list + " - annot_file_last_mod (contain the date of .annot file) as third element + let s:annot_file_list = {} " 2. Finding the type information in the annotation file @@ -379,16 +391,17 @@ endfunction " After call: " The current buffer is now the one containing the .annot file. " We manage to keep all this hidden to the user's eye. - function! s:Enter_annotation_buffer() + function! s:Enter_annotation_buffer(annot_file_path) let s:current_pos = getpos('.') let s:current_hidden = &l:hidden set hidden let s:current_buf = bufname('%') - if bufloaded(b:annot_file_path) - silent exe 'keepj keepalt' 'buffer' s:Fnameescape(b:annot_file_path) + if bufloaded(a:annot_file_path) + silent exe 'keepj keepalt' 'buffer' s:Fnameescape(a:annot_file_path) else - silent exe 'keepj keepalt' 'view' s:Fnameescape(b:annot_file_path) + silent exe 'keepj keepalt' 'view' s:Fnameescape(a:annot_file_path) endif + call setpos(".", [0, 0 , 0 , 0]) endfun " After call: @@ -402,21 +415,29 @@ endfunction " After call: " The annot file is loaded and assigned to a buffer. " This also handles the modification date of the .annot file, eg. after a - " compilation. - function! s:Load_annotation() - if bufloaded(b:annot_file_path) && b:annot_file_last_mod < getftime(b:annot_file_path) - call s:Enter_annotation_buffer() - silent exe "bunload" - call s:Exit_annotation_buffer() + " compilation (return an updated annot_file_list). + function! s:Load_annotation(annot_file_name) + let annot = s:annot_file_list[a:annot_file_name] + let annot_file_path = annot[0] + let annot_file_last_mod = 0 + if exists("annot[2]") + let annot_file_last_mod = annot[2] + endif + if bufloaded(annot_file_path) && annot_file_last_mod < getftime(annot_file_path) + " if there is a more recent file + let nr = bufnr(annot_file_path) + silent exe 'keepj keepalt' 'bunload' nr endif - if !bufloaded(b:annot_file_path) - call s:Enter_annotation_buffer() + if !bufloaded(annot_file_path) + call s:Enter_annotation_buffer(annot_file_path) setlocal nobuflisted setlocal bufhidden=hide setlocal noswapfile setlocal buftype=nowrite call s:Exit_annotation_buffer() - let b:annot_file_last_mod = getftime(b:annot_file_path) + let annot[2] = getftime(annot_file_path) + " List updated with the new date + let s:annot_file_list[a:annot_file_name] = annot endif endfun @@ -466,8 +487,9 @@ endfunction "In: the pattern to look for in order to match the block "Out: the type information (calls s:Match_data) " Should be called in the annotation buffer - function! s:Extract_type_data(block_pattern) - call s:Enter_annotation_buffer() + function! s:Extract_type_data(block_pattern, annot_file_name) + let annot_file_path = s:annot_file_list[a:annot_file_name][0] + call s:Enter_annotation_buffer(annot_file_path) try if search(a:block_pattern,'e') == 0 throw "no_annotation" @@ -527,9 +549,9 @@ endfunction "In: the current mode (eg. "visual", "normal", etc.) "Out: the type information (calls s:Extract_type_data) - function! s:Get_type(mode) + function! s:Get_type(mode, annot_file_name) let [lin1,lin2,col1,col2] = s:Match_borders(a:mode) - return s:Extract_type_data(s:Block_pattern(lin1,lin2,col1,col2)) + return s:Extract_type_data(s:Block_pattern(lin1,lin2,col1,col2), a:annot_file_name) endfun "d. main @@ -537,9 +559,10 @@ endfunction "After call: the type information is displayed if !exists("*Ocaml_get_type") function Ocaml_get_type(mode) + let annot_file_name = s:Fnameescape(expand('%:t:r')).'.annot' call s:Locate_annotation() - call s:Load_annotation() - return s:Get_type(a:mode) + call s:Load_annotation(annot_file_name) + return s:Get_type(a:mode, annot_file_name) endfun endif diff --git a/runtime/indent/ocaml.vim b/runtime/indent/ocaml.vim index 5c267af8b1..a84c992edd 100644 --- a/runtime/indent/ocaml.vim +++ b/runtime/indent/ocaml.vim @@ -1,12 +1,12 @@ " Vim indent file " Language: OCaml -" Maintainers: Jean-Francois Yuen <jfyuen@happycoders.org> -" Mike Leary <leary@nwlink.com> -" Markus Mottl <markus.mottl@gmail.com> |