Skip to content

Commit

Permalink
Version 3.0
Browse files Browse the repository at this point in the history
There was a logic error when prompting the user for the options.  Ignore case value was reversed.
  • Loading branch information
dfishburn authored and vim-scripts committed Mar 7, 2012
1 parent 082d620 commit dd37cfc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 218 deletions.
5 changes: 4 additions & 1 deletion README
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ At this point you want to update your Vim syntax file to include all the new met


You cannot run Diff against this, since the lines are completely different, you need to compare the words. You cannot run Diff against this, since the lines are completely different, you need to compare the words.


After running :WhatsMissing, you end up with a split buffer showing: After running :WhatsMissing, you end up with a split buffer showing (in this case), only the words missing. This reduces the work required to determine which syntax elements to add to your file.
*************** ***************
(19 of 24) items missing from: syntax.vim (19 of 24) items missing from: syntax.vim
---------- ----------
Expand All @@ -127,3 +127,6 @@ varexists
WMOptions: WMOptions:
mode=word ignore_case= ignore_whitespace=0 mode=word ignore_case= ignore_whitespace=0
*************** ***************

Of course, the above example is for Vim syntax files, but it can be used for anything.

203 changes: 0 additions & 203 deletions doc/WhatsMissing.txt

This file was deleted.

29 changes: 15 additions & 14 deletions plugin/WhatsMissing.vim
Original file line number Original file line Diff line number Diff line change
@@ -1,15 +1,15 @@
" WhatMissing.vim - Shows what is missing between 2 buffers " WhatMissing.vim - Shows what is missing between 2 buffers
" --------------------------------------------------------------- " ---------------------------------------------------------------
" Version: 1.00 " Version: 3.0
" Authors: David Fishburn <fishburn@ianywhere.com> " Authors: David Fishburn <dfishburn dot vim at gmail dot com>
" Last Modified: Sun Oct 17 2004 10:25:19 PM " Last Modified: 2012 Jan 22
" Homepage: http://vim.sourceforge.net/script.php?script_id=1108 " Homepage: http://vim.sourceforge.net/script.php?script_id=1108
" GetLatestVimScripts: 1108 1 :AutoInstall: WhatsMissing.vim " GetLatestVimScripts: 1108 1 :AutoInstall: WhatsMissing.vim


if exists('g:loaded_whatsmissing') || &cp if exists('g:loaded_whatsmissing') || &cp
finish finish
endif endif
let g:loaded_whatsmissing = 100 let g:loaded_whatsmissing = 20


let s:wm_buffer_lines = 10 let s:wm_buffer_lines = 10
let s:wm_matching_cnt = 0 let s:wm_matching_cnt = 0
Expand Down Expand Up @@ -360,28 +360,29 @@ function! s:WM_SetBufNbr( bufnr )
endfunction endfunction


function! s:WM_SetFileName( filename ) function! s:WM_SetFileName( filename )
if !bufexists(bufnr(a:filename)) let filename = expand(a:filename)
if filereadable(a:filename) if !bufexists(bufnr(filename))
if filereadable(filename)
" load the file into a new buffer " load the file into a new buffer
exec 'view ' . a:filename exec 'view ' . filename
if bufexists(bufnr(a:filename)) if bufexists(bufnr(filename))
let s:wm_find_bufnr = bufnr(a:filename) let s:wm_find_bufnr = bufnr(filename)
else else
call s:WM_WarningMsg( call s:WM_WarningMsg(
\ "Failed to load: " . a:filename \ "Failed to load: " . filename
\ ) \ )
return -1 return -1
endif endif
else else
call s:WM_WarningMsg( call s:WM_WarningMsg(
\ "Cannot find: " . a:filename \ "Cannot find: " . filename
\ ) \ )
return -1 return -1
endif endif
else else
let s:wm_find_bufnr = bufnr(a:filename) let s:wm_find_bufnr = bufnr(filename)
endif endif
let s:wm_filename = a:filename let s:wm_filename = filename


return 1 return 1
endfunction endfunction
Expand Down Expand Up @@ -480,7 +481,7 @@ function! s:WM_PromptOptions()
\ response \ response
\ ) \ )
let s:wm_ignore_case = (response ==# '1' ? '' : let s:wm_ignore_case = (response ==# '1' ? '' :
\ (response ==# '2' ? '\C' : '\c' ) ) \ (response ==# '2' ? '\c' : '\C' ) )


" Ignore whitespace " Ignore whitespace
let response = (s:wm_ignore_whitespace == '' ? '1' : '2' ) let response = (s:wm_ignore_whitespace == '' ? '1' : '2' )
Expand Down

0 comments on commit dd37cfc

Please sign in to comment.