diff options
28 files changed, 425 insertions, 82 deletions
diff --git a/runtime/autoload/pycomplete.vim b/runtime/autoload/pycomplete.vim new file mode 100644 index 0000000000..8cd5a5f6d3 --- /dev/null +++ b/runtime/autoload/pycomplete.vim @@ -0,0 +1,216 @@ +"pycomplete.vim - Omni Completion for python +" Maintainer: Aaron Griffin +" Version: 0.2 +" Last Updated: 5 January 2006 +" +" TODO +" * local variables *inside* class members + +if !has('python') + echo "Error: Required vim compiled with +python" + finish +endif + +function! pycomplete#Complete(findstart, base) + "findstart = 1 when we need to get the text length + if a:findstart + let line = getline('.') + let idx = col('.') + while idx > 0 + let idx -= 1 + let c = line[idx-1] + if c =~ '\w' + continue + elseif ! c =~ '\.' + idx = -1 + break + else + break + endif + endwhile + + return idx + "findstart = 0 when we need to return the list of completions + else + execute "python get_completions('" . a:base . "')" + return g:pycomplete_completions + endif +endfunction + +function! s:DefPython() +python << PYTHONEOF +import vim +import sys +import __builtin__ + +LOCALDEFS = \ + ['LOCALDEFS', 'clean_up','eval_source_code', \ + 'get_completions', '__builtin__', '__builtins__', \ + 'dbg', '__name__', 'vim', 'sys'] +#comment/uncomment one line at a time to enable/disable debugging +def dbg(msg): + pass +# print(msg) + +#it seems that by this point, vim has already stripped the base +# matched in the findstart=1 section, so we will create the +# statement from scratch +def get_completions(base): + stmt = vim.eval('expand("<cWORD>")')+base + dbg("parsed statement => %s" % stmt) + eval_source_code() + try: + dbg("eval: %s" % stmt) + if len(stmt.split('.')) == 1: + all = globals().keys() + dir(__builtin__) + match = stmt + else: + rindex= stmt.rfind('.') + all = dir(eval(stmt[:rindex])) + match = stmt[rindex+1:] + + completions = [] + dbg("match == %s" % match) + for m in all: + #TODO: remove private (_foo) functions? + if m.find('__') != 0 and \ + m.find(match) == 0 and \ + m not in LOCALDEFS: + dbg("matched... %s, %s" % (m, m.find(match))) + completions.append(m) + dbg("all completions: %s" % completions) + vim.command("let g:pycomplete_completions = %s" % completions) + except: + dbg("exception: %s" % sys.exc_info()[1]) + vim.command("let g:pycomplete_completions = []") + clean_up() + +#yes, this is a quasi-functional python lexer +def eval_source_code(): + import tokenize + import keyword + import StringIO + s = StringIO.StringIO('\n'.join(vim.current.buffer[:]) + '\n') + g = tokenize.generate_tokens(s.readline) + + stmts = [] + lineNo = 0 + try: + for type, str, begin, end, line in g: + if begin[0] == lineNo: + continue + #junk + elif type == tokenize.INDENT or \ + type == tokenize.DEDENT or \ + type == tokenize.ERRORTOKEN or \ + type == tokenize.ENDMARKER or \ + type == tokenize.NEWLINE: + continue + #import statement + elif str == 'import': + for type, str, begin, end, line in g: + if str == ';' or type == tokenize.NEWLINE: break + dbg("found [import %s]" % str) + stmts.append("import %s" % str) + #import from statement + elif str == 'from': + type, str, begin, end, line = g.next() + mod = str + + type, str, begin, end, line = g.next() + if str != "import": break + mem = '' + for type, str, begin, end, line in g: + if str == ';' or type == tokenize.NEWLINE: break + mem += (str + ',') + if len(mem) > 0: + dbg("found [from %s import %s]" % (mod, mem[:-1])) + stmts.append("from %s import %s" % (mod, mem[:-1])) + #class declaration + elif str == 'class': + type, str, begin, end, line = g.next() + classname = str + dbg("found [class %s]" % classname) + + level = 0 + members = [] + #we don't care about the meat of the members, + # only the signatures, so we'll replace the bodies + # with 'pass' for evaluation + for type, str, begin, end, line in g: + if type == tokenize.INDENT: + level += 1 + elif type == tokenize.DEDENT: + level -= 1 + if level == 0: break; + elif str == 'def': + #TODO: if name begins with '_', keep private + memberstr = '' + for type, str, begin, end, line in g: + if str == ':': break + memberstr += str + dbg(" member [%s]" % memberstr) + members.append(memberstr) + #TODO parse self.blah = something lines + #elif str == "self" && next && str == "." ...blah... + classstr = 'class %s:' % classname + for m in members: + classstr += ("\n def %s:\n pass" % m) + stmts.append("%s\n" % classstr) + elif keyword.iskeyword(str) or str in globals(): + dbg("keyword = %s" % str) + lineNo = begin[0] + else: + if line.find("=") == -1: continue + var = str + type, str, begin, end, line = g.next() + dbg('next = %s' % str) + if str != '=': continue + + type, str, begin, end, line = g.next() + if type == tokenize.NEWLINE: + continue + elif type == tokenize.STRING or str == 'str': + stmts.append('%s = str' % var) + elif str == '[' or str == 'list': + stmts.append('%s= list' % var) + elif str == '{' or str == 'dict': + stmts.append('%s = dict' % var) + elif type == tokenize.NUMBER: + continue + elif str == 'Set': + stmts.append('%s = Set' % var) + elif str == 'open' or str == 'file': + stmts.append('%s = file' % var) + else: + inst = str + for type, str, begin, end, line in g: + if type == tokenize.NEWLINE: + break + inst += str + if len(inst) > 0: + dbg("found [%s = %s]" % (var, inst)) + stmts.append('%s = %s' % (var, inst)) + lineNo = begin[0] + for s in stmts: + try: + dbg("evaluating: %s\n" % s) + exec(s) in globals() + except: + pass + except: + dbg("exception: %s" % sys.exc_info()[1]) + +def clean_up(): + for o in globals().keys(): + if o not in LOCALDEFS: + try: + exec('del %s' % o) in globals() + except: pass + +sys.path.extend(['.','..']) +PYTHONEOF +endfunction + +call s:DefPython() +" vim: set et ts=4: diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 4c527e1a12..dfab7c9075 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.0aa. Last change: 2006 Jan 09 +*eval.txt* For Vim version 7.0aa. Last change: 2006 Jan 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -3273,6 +3273,10 @@ maparg({name}[, {mode}]) *maparg()* translated like in the output of the ":map" command listing. The mappings local to the current buffer are checked first, then the global mappings. + This function can be used to map a key even when it's already + mapped, and have it do the original mapping too. Sketch: > + exe 'nnoremap <Tab> ==' . maparg('<Tab>', 'n') + mapcheck({name}[, {mode}]) *mapcheck()* Check if there is a mapping that matches with {name} in mode diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index 85155b439d..3f83a252d7 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -1,4 +1,4 @@ -*map.txt* For Vim version 7.0aa. Last change: 2006 Jan 09 +*map.txt* For Vim version 7.0aa. Last change: 2006 Jan 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -191,6 +191,8 @@ already exists which is equal. Example of what will fail: > :map ,w /[#&!]<CR> :map <buffer> <unique> ,w /[.,;]<CR> +If you want to map a key and then have it do what it was originally mapped to, +have a look at |maparg()|. "<buffer>", "<silent>", "<script>" and "<unique>" can be used in any order. They must appear right after the command, before any other arguments. @@ -639,7 +641,7 @@ you must create mapping that first sets the 'operatorfunc' option and then invoke the |g@| operator. After the user types the {motion} command the specified function will be called. - *g@* + *g@* *E774* *E775* g@{motion} Call the function set by the 'operatorfunc' option. The '[ mark is positioned at the start of the text moved over by {motion}, the '] mark on the last diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index 09eccb52e3..f97e634072 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -1,4 +1,4 @@ -*quickfix.txt* For Vim version 7.0aa. Last change: 2006 Jan 11 +*quickfix.txt* For Vim version 7.0aa. Last change: 2006 Jan 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -123,7 +123,7 @@ The following quickfix commands can be used: A range can be specified for the lines to be used. Otherwise all lines in the buffer are used. - *:cex* *:cexpr* + *:cex* *:cexpr* *E777* :cex[pr][!] {expr} Create a quickfix list using the result of {expr} and jump to the first error. If {expr} is a String, then each new-line terminated line in the String is diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt index a2989d7830..56365c7ae0 100644 --- a/runtime/doc/spell.txt +++ b/runtime/doc/spell.txt @@ -1,4 +1,4 @@ -*spell.txt* For Vim version 7.0aa. Last change: 2006 Jan 11 +*spell.txt* For Vim version 7.0aa. Last change: 2006 Jan 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -302,12 +302,12 @@ A spell file might not be available in the current 'encoding'. See |spell-mkspell| about how to create a spell file. Converting a spell file with "iconv" will NOT work! - *spell-sug-file* + *spell-sug-file* *E781* If there is a file with exactly the same name as the ".spl" file but ending in ".sug", that file will be used for giving better suggestions. It isn't loaded before suggestions are made to reduce memory use. - *E758* *E759* + *E758* *E759* *E778* *E779* *E780* *E782* When loading a spell file Vim checks that it is properly formatted. If you get an error the file may be truncated, modified or intended for another Vim version. @@ -1299,7 +1299,7 @@ You can include a space by using an underscore: REP the_the the ~ -SIMILAR CHARACTERS *spell-MAP* +SIMILAR CHARACTERS *spell-MAP* *E783* In the affix file MAP items can be used to define letters that are very much alike. This is mostly used for a letter with different accents. This is used diff --git a/runtime/doc/tags b/runtime/doc/tags index 187a06e1bf..b585a8b498 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -1089,6 +1089,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* +multi_byte_ime various.txt /*+multi_byte_ime* +multi_lang various.txt /*+multi_lang* +mzscheme various.txt /*+mzscheme* ++mzscheme/dyn various.txt /*+mzscheme\/dyn* +netbeans_intg various.txt /*+netbeans_intg* +ole various.txt /*+ole* +osfiletype various.txt /*+osfiletype* @@ -1782,7 +1783,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* :cabbrev map.txt /*:cabbrev* :cabc map.txt /*:cabc* :cabclear map.txt /*:cabclear* -:cadde quickfix.txt /*:cadde* +:cad quickfix.txt /*:cad* :caddexpr quickfix.txt /*:caddexpr* :caddf quickfix.txt /*:caddf* :caddfile quickfix.txt /*:caddfile* @@ -3791,7 +3792,16 @@ E770 spell.txt /*E770* E771 spell.txt /*E771* E772 spell.txt /*E772* E773 recover.txt /*E773* +E774 map.txt /*E774* +E775 map.txt /*E775* +E777 quickfix.txt /*E777* +E778 spell.txt /*E778* +E779 spell.txt /*E779* E78 motion.txt /*E78* +E780 spell.txt /*E780* +E781 spell.txt /*E781* +E782 spell.txt /*E782* +E783 spell.txt /*E783* E79 message.txt /*E79* E80 message.txt /*E80* E800 arabic.txt /*E800* @@ -4683,6 +4693,7 @@ design-not develop.txt /*design-not* design-speed-size develop.txt /*design-speed-size* desktop.vim syntax.txt /*desktop.vim* develop-spell develop.txt /*develop-spell* +develop-spell-suggestions develop.txt /*develop-spell-suggestions* develop.txt develop.txt /*develop.txt* development develop.txt /*development* dh change.txt /*dh* @@ -5081,6 +5092,7 @@ ft-spec-plugin filetype.txt /*ft-spec-plugin* ft-spup-syntax syntax.txt /*ft-spup-syntax* ft-sql-syntax syntax.txt /*ft-sql-syntax* ft-sqlinformix-syntax syntax.txt /*ft-sqlinformix-syntax* +ft-syntax-omni insert.txt /*ft-syntax-omni* ft-tcsh-syntax syntax.txt /*ft-tcsh-syntax* ft-termcap-syntax syntax.txt /*ft-termcap-syntax* ft-tex-syntax syntax.txt /*ft-tex-syntax* @@ -5860,6 +5872,7 @@ mysyntaxfile-replace syntax.txt /*mysyntaxfile-replace* mzscheme if_mzsch.txt /*mzscheme* mzscheme-buffer if_mzsch.txt /*mzscheme-buffer* mzscheme-commands if_mzsch.txt /*mzscheme-commands* +mzscheme-dynamic if_mzsch.txt /*mzscheme-dynamic* mzscheme-examples if_mzsch.txt /*mzscheme-examples* mzscheme-sandbox if_mzsch.txt /*mzscheme-sandbox* mzscheme-threads if_mzsch.txt /*mzscheme-threads* @@ -6174,6 +6187,7 @@ pmbfn-option print.txt /*pmbfn-option* popt-option print.txt /*popt-option* popup-menu gui.txt /*popup-menu* popup-menu-added version5.txt /*popup-menu-added* +popupmenu-completion insert.txt /*popupmenu-completion* ports-5.2 version5.txt /*ports-5.2* ports-6 version6.txt /*ports-6* posix vi_diff.txt /*posix* @@ -6482,35 +6496,73 @@ spec_chglog_release_info pi_spec.txt /*spec_chglog_release_info* special-buffers windows.txt /*special-buffers* speed-up tips.txt /*speed-up* spell spell.txt /*spell* +spell-ACCENT spell.txt /*spell-ACCENT* spell-BAD spell.txt /*spell-BAD* +spell-CHECKCOMPOUNDCASE spell.txt /*spell-CHECKCOMPOUNDCASE* +spell-CHECKCOMPOUNDDUP spell.txt /*spell-CHECKCOMPOUNDDUP* +spell-CHECKCOMPOUNDPATTERN spell.txt /*spell-CHECKCOMPOUNDPATTERN* +spell-CHECKCOMPOUNDREP spell.txt /*spell-CHECKCOMPOUNDREP* +spell-CHECKCOMPOUNDTRIPLE spell.txt /*spell-CHECKCOMPOUNDTRIPLE* +spell-CIRCUMFIX spell.txt /*spell-CIRCUMFIX* spell-CMP spell.txt /*spell-CMP* +spell-COMMON spell.txt /*spell-COMMON* +spell-COMPLEXPREFIXES spell.txt /*spell-COMPLEXPREFIXES* +spell-COMPOUNDBEGIN spell.txt /*spell-COMPOUNDBEGIN* +spell-COMPOUNDEND spell.txt /*spell-COMPOUNDEND* spell-COMPOUNDFLAG spell.txt /*spell-COMPOUNDFLAG* spell-COMPOUNDFLAGS spell.txt /*spell-COMPOUNDFLAGS* +spell-COMPOUNDFORBIDFLAG spell.txt /*spell-COMPOUNDFORBIDFLAG* spell-COMPOUNDMAX spell.txt /*spell-COMPOUNDMAX* +spell-COMPOUNDMIDDLE spell.txt /*spell-COMPOUNDMIDDLE* spell-COMPOUNDMIN spell.txt /*spell-COMPOUNDMIN* +spell-COMPOUNDPERMITFLAG spell.txt /*spell-COMPOUNDPERMITFLAG* +spell-COMPOUNDROOT spell.txt /*spell-COMPOUNDROOT* +spell-COMPOUNDSYLLABLE spell.txt /*spell-COMPOUNDSYLLABLE* spell-COMPOUNDSYLMAX spell.txt /*spell-COMPOUNDSYLMAX* +spell-COMPOUNDWORDMAX spell.txt /*spell-COMPOUNDWORDMAX* spell-FLAG spell.txt /*spell-FLAG* spell-FOL spell.txt /*spell-FOL* -spell-KEP spell.txt /*spell-KEP* +spell-FORBIDDENWORD spell.txt /*spell-FORBIDDENWORD* +spell-HOME spell.txt /*spell-HOME* +spell-KEEPCASE spell.txt /*spell-KEEPCASE* +spell-LANG spell.txt /*spell-LANG* +spell-LEMMA_PRESENT spell.txt /*spell-LEMMA_PRESENT* spell-LOW spell.txt /*spell-LOW* spell-MAP spell.txt /*spell-MAP* +spell-MAXNGRAMSUGS spell.txt /*spell-MAXNGRAMSUGS* +spell-NAME spell.txt /*spell-NAME* spell-NEEDAFFIX spell.txt /*spell-NEEDAFFIX* spell-NEEDCOMPOUND spell.txt /*spell-NEEDCOMPOUND* spell-NOBREAK spell.txt /*spell-NOBREAK* +spell-NOSPLITSUGS spell.txt /*spell-NOSPLITSUGS* +spell-NOSUGFILE spell.txt /*spell-NOSUGFILE* +spell-NOSUGGEST spell.txt /*spell-NOSUGGEST* +spell-ONLYINCOMPOUND spell.txt /*spell-ONLYINCOMPOUND* spell-PFX spell.txt /*spell-PFX* spell-PFXPOSTPONE spell.txt /*spell-PFXPOSTPONE* -spell-RAR spell.txt /*spell-RAR* +spell-PSEUDOROOT spell.txt /*spell-PSEUDOROOT* +spell-RARE spell.txt /*spell-RARE* spell-REP spell.txt /*spell-REP* spell-SAL spell.txt /*spell-SAL* +spell-SET spell.txt /*spell-SET* spell-SFX spell.txt /*spell-SFX* spell-SLASH spell.txt /*spell-SLASH* spell-SOFOFROM spell.txt /*spell-SOFOFROM* spell-SOFOTO spell.txt /*spell-SOFOTO* +spell-SUGSWITHDOTS spell.txt /*spell-SUGSWITHDOTS* spell-SYLLABLE spell.txt /*spell-SYLLABLE* +spell-SYLLABLENUM spell.txt /*spell-SYLLABLENUM* +spell-TRY spell.txt /*spell-TRY* spell-UPP spell.txt /*spell-UPP* +spell-VERSION spell.txt /*spell-VERSION* +spell-WORDCHARS spell.txt /*spell-WORDCHARS* +spell-aff-format spell.txt /*spell-aff-format* spell-affix-chars spell.txt /*spell-affix-chars* +spell-affix-comment spell.txt /*spell-affix-comment* +spell-affix-flags spell.txt /*spell-affix-flags* spell-affix-mbyte spell.txt /*spell-affix-mbyte* spell-affix-nocomp spell.txt /*spell-affix-nocomp* +spell-affix-not-supported spell.txt /*spell-affix-not-supported* spell-affix-rare spell.txt /*spell-affix-rare* spell-affix-vim spell.txt /*spell-affix-vim* spell-compound spell.txt /*spell-compound* @@ -6524,6 +6576,7 @@ spell-mkspell spell.txt /*spell-mkspell* spell-quickstart spell.txt /*spell-quickstart* spell-remarks spell.txt /*spell-remarks* spell-russian spell.txt /*spell-russian* +spell-sug-file spell.txt /*spell-sug-file* spell-syntax spell.txt /*spell-syntax* spell-wordlist-format spell.txt /*spell-wordlist-format* spell-yiddish spell.txt /*spell-yiddish* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 542e6f133e..8aa8299e91 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.0aa. Last change: 2006 Jan 12 +*todo.txt* For Vim version 7.0aa. Last change: 2006 Jan 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -30,18 +30,6 @@ be worked on, but only if you sponsor Vim development. See |sponsor|. *known-bugs* -------------------- Known bugs and current work ----------------------- -Find E999 and hand out numbers. - -Compress list of word numbers: sort them, computer differences, store as utf-8 -bytes. - -Undo bug: Gerald Lai Jan 3. - -Syntax HL: when region start has an offset that happens to be after the end of -the line then strange things happen. (Brett Stahlman Dec 31) - -Add Python complete script (Aaron Griffin) - Evaluating CTRL-R = in the sandbox causes trouble (G. Sumner Hayes). Can the rules for the commandline window be used? @@ -64,6 +52,13 @@ ccomplete: away. How to figure out if it's a pointer or not? - When a typedef or struct is local to a file only use it in that file? - Extra info for each entry to show in a tooltip kind of thing. + Should use a dictionary for each entry. Fields could be: + word the completed word + menu menu text (use word when missing) + info extra info, to be displayed in balloon (e.g., function args) + kind single letter indicating the type of word: + v = variable, f = function/method, c = composite (object, + struct pointer). - Special mappings for when the popup menu is visible? Would allow for making a specific selection (e.g, methods vs variables). - Provide a function to popup the menu, so that an insert mode mapping can @@ -440,7 +435,7 @@ Add gui_mch_browsedir() for Motif, Mac OS/X. Add extra list of file locations. A bit like the quickfix list, but there is one per window. Can be used with: :ltag list of matching tags, like :tselect -Patch from Yegappan Lakshmanan, Jan 9. +Patch from Yegappan Lakshmanan, Jan 13. Commands to use the location list: :lnext next location :lprevious :lNext previous location diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt index 560b7ffa35..36345b4f28 100644 --- a/runtime/doc/version7.txt +++ b/runtime/doc/version7.txt @@ -1,4 +1,4 @@ -*version7.txt* For Vim version 7.0aa. Last change: 2006 Jan 09 +*version7.txt* For Vim version 7.0aa. Last change: 2006 Jan 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1545,4 +1545,17 @@ the dialog then Vim would insert <M-F4> in the text. Now it's ignored. When ":silent! {cmd}" caused the swap file dialog, which isn't displayed, there would still be a hit-enter prompt. +Requesting the termresponse (|t_RV|) early may cause problems with "-c" +arguments that invoke an external command or even "-c quit". Postpone it +until after executing "-c" arguments. + +When typing in Insert mode so that a new line is started, using CTRL-G u to +break undo and start a new change, then joining the lines with <BS> caused +undo info to be missing. Now reset the insertion start point. + +Syntax HL: When a region start match has a matchgroup and an offset that +happens to be after the end of the line then it continued in the next line and +stopped at the region end match, making the region continue after that. +Now check for the column being past the end of the line in syn_add_end_off(). + vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/ftplugin/matlab.vim b/runtime/ftplugin/matlab.vim new file mode 100644 index 0000000000..c75326677d --- /dev/null +++ b/runtime/ftplugin/matlab.vim @@ -0,0 +1,30 @@ +" Vim filetype plugin file +" Language: matlab +" Maintainer: Jake Wasserman <jwasserman at gmail dot com> +" Last Changed: 2006 Jan 12 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:save_cpo = &cpo +set cpo-=C + +if exists("loaded_matchit") + let s:conditionalEnd = '\(([^()]*\)\@!\<end\>\([^()]*)\)\@!' + let b:match_words = '\<if\>\|\<while\>\|\<for\>\|\<switch\>:' . + \ s:conditionalEnd . ',\<if\>:\<elseif\>:\<else\>:' . + \ s:conditionalEnd +endif + +setlocal suffixesadd=.m +setlocal suffixes+=.asv + +let b:undo_ftplugin = "setlocal suffixesadd< suffixes< " + \ . "| unlet! b:match_words" + +let &cpo = s:save_cpo + + + diff --git a/runtime/ftplugin/python.vim b/runtime/ftplugin/python.vim index 4834b40ce4..8e6a03f04e 100644 --- a/runtime/ftplugin/python.vim +++ b/runtime/ftplugin/python.vim @@ -14,6 +14,8 @@ setlocal suffixesadd=.py setlocal comments-=:% setlocal commentstring=#%s +setlocal omnifunc=pycomplete#Complete + set wildignore+=*.pyc nnoremap <silent> <buffer> ]] :call <SID>Python_jump('/^\(class\\|def\)')<cr> diff --git a/runtime/spell/en.ascii.spl b/runtime/spell/en.ascii.spl Binary files differindex 33cb8202a2..876a752414 100644 --- a/runtime/spell/en.ascii.spl +++ b/runtime/spell/en.ascii.spl diff --git a/runtime/spell/en.ascii.sug b/runtime/spell/en.ascii.sug Binary files differindex a254ed27bf..4b57555df7 100644 --- a/runtime/spell/en.ascii.sug +++ b/runtime/spell/en.ascii.sug diff --git a/runtime/spell/en.latin1.spl b/runtime/spell/en.latin1.spl Binary files differindex 68cade0044..23c120029f 100644 --- a/runtime/spell/en.latin1.spl +++ b/runtime/spell/en.latin1.spl diff --git a/runtime/spell/en.latin1.sug b/runtime/spell/en.latin1.sug Binary files differindex 7aa6bb5fcd..bb979a84d3 100644 --- a/runtime/spell/en.latin1.sug +++ b/runtime/spell/en.latin1.sug diff --git a/runtime/spell/en.utf-8.spl b/runtime/spell/en.utf-8.spl Binary files differindex b0dd947eb5..65b812a284 100644 --- a/runtime/spell/en.utf-8.spl +++ b/runtime/spell/en.utf-8.spl diff --git a/runtime/spell/en.utf-8.sug b/runtime/spell/en.utf-8.sug Binary files differindex 62f59e5313..3e09e2b6ef 100644 --- a/runtime/spell/en.utf-8.sug +++ b/runtime/spell/en.utf-8.sug diff --git a/src/Makefile b/src/Makefile index 810dd7b78b..5236e9df25 100644 --- a/src/Makefile +++ b/src/Makefile @@ -541,7 +541,7 @@ LINT_OPTIONS = -beprxzF # MEMORY LEAK DETECTION # Requires installing the ccmalloc library. -# Configuration is in the .ccmalloc file. +# Configuration is in the .ccmalloc or ~/.ccmalloc file. # Doesn't work very well, since memory linked to from global variables # (indirectly) is also marked as leaked memory. #PROFILE_CFLAGS = -DEXITFREE diff --git a/src/edit.c b/src/edit.c index c037d1f961..298ebc3c83 100644 --- a/src/edit.c +++ b/src/edit.c @@ -6527,6 +6527,10 @@ ins_ctrl_g() /* CTRL-G u: start new undoable edit */ case 'u': u_sync(); ins_need_undo = TRUE; + + /* Need to reset Insstart, esp. because a BS that joins + * aline to the previous one must save for undo. */ + Insstart = curwin->w_cursor; break; /* Unknown CTRL-G command, reserved for future expansion. */ diff --git a/src/main.c b/src/main.c index 551e980f9a..fd85ea89d7 100644 --- a/src/main.c +++ b/src/main.c @@ -844,6 +844,12 @@ main no_wait_return = FALSE; starting = 0; +#ifdef FEAT_TERMRESPONSE + /* Requesting the termresponse is postponed until here, so that a "-c q" + * argument doesn't make it appear in the shell Vim was started from. */ + may_req_termresponse(); +#endif + /* start in insert mode */ if (p_im) need_start_insertmode = TRUE; diff --git a/src/message.c b/src/message.c index 465b25e7e7..1cea013d0a 100644 --- a/src/message.c +++ b/src/message.c @@ -2188,7 +2188,6 @@ clear_sb_text() vim_free(last_msgchunk); last_msgchunk = mp; } - last_msgchunk = NULL; } /* diff --git a/src/misc1.c b/src/misc1.c index 08cd20c91d..c459174019 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -3583,6 +3583,8 @@ expand_env_esc(srcp, dst, dstlen, esc, startstr) { struct passwd *pw; + /* Note: memory allocated by getpwnam() is never freed. + * Calling endpwent() apparently doesn't help. */ pw = getpwnam((char *)dst + 1); if (pw != NULL) var = (char_u *)pw->pw_dir; diff --git a/src/misc2.c b/src/misc2.c index f5b13e7629..fb873fb4a2 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -1012,6 +1012,7 @@ free_all_mem() free_cd_dir(); set_expr_line(NULL); diff_clear(); + clear_sb_text(); /* free any scrollback text */ /* Free some global vars. */ vim_free(username); diff --git a/src/proto/term.pro b/src/proto/term.pro index f5bdfc4f90..91bb85c3c3 100644 --- a/src/proto/term.pro +++ b/src/proto/term.pro @@ -33,6 +33,7 @@ void set_shellsize __ARGS((int width, int height, int mustset)); void settmode __ARGS((int tmode)); void starttermcap __ARGS((void)); void stoptermcap __ARGS((void)); +void may_req_termresponse __ARGS((void)); int swapping_screen __ARGS((void)); void setmouse __ARGS((void)); int mouse_has __ARGS((int c)); diff --git a/src/quickfix.c b/src/quickfix.c index f550f116a6..35f278c2d7 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -3001,7 +3001,7 @@ ex_cexpr(eap) qf_jump(0, 0, eap->forceit); /* display first error */ } else - EMSG(_("E999: String or List expected")); + EMSG(_("E777: String or List expected")); free_tv(tv); } } diff --git a/src/spell.c b/src/spell.c index a1ab89c826..9d8f2bf40e 100644 --- a/src/spell.c +++ b/src/spell.c @@ -945,6 +945,10 @@ static char *e_affform = N_("E761: Format error in affix file FOL, LOW or UPP"); static char *e_affrange = N_("E762: Character in FOL, LOW or UPP is out of range"); static char *msg_compressing = N_("Compressing word tree..."); +/* Remember what "z?" replaced. */ +static char_u *repl_from = NULL; +static char_u *repl_to = NULL; + /* * Main spell-checking function. * "ptr" points to a character that could be the start of a word. @@ -1657,8 +1661,8 @@ find_word(mip, mode) } /* - * Return TRUE if "flags" is a valid sequence of compound flags and - * "word[len]" does not have too many syllables. + * Return TRUE if "flags" is a valid sequence of compound flags and "word" + * does not have too many syllables. */ static int can_compound(slang, word, flags) @@ -1884,7 +1888,7 @@ find_prefix(mip, mode) /* * Need to fold at least one more character. Do until next non-word character - * for efficiency. + * for efficiency. Include the non-word character too. * Return the length of the folded chars in bytes. */ static int @@ -1900,8 +1904,7 @@ fold_more(mip) mb_ptr_adv(mip->mi_fend); } while (*mip->mi_fend != NUL && spell_iswordp(mip->mi_fend, mip->mi_buf)); - /* Include the non-word character so that we can check for the - * word end. */ + /* Include the non-word character so that we can check for the word end. */ if (*mip->mi_fend != NUL) mb_ptr_adv(mip->mi_fend); @@ -2201,6 +2204,9 @@ spell_cat_line(buf, li |