-*todo.txt* For Vim version 7.0aa. Last change: 2005 Jun 14
+*todo.txt* For Vim version 7.0aa. Last change: 2005 Jun 16
VIM REFERENCE MANUAL by Bram Moolenaar
*known-bugs*
-------------------- Known bugs and current work -----------------------
+synID() no longer works.
+
Range(0) should return an empty list (Servatius Brandt).
:let @= 'asdf' gives confusing error message. Make @= writable?
Include new PHP indent script from John Wellesz?
http://www.vim.org/scripts/download_script.php?src_id=4330
+In Vim indenting use synID() to avoid recognizing "|en" in a string as
+"|endif".
+
autoload:
- Add a Vim script in $VIMRUNTIME/tools that takes a file with a list of
script names and a help file and produces a script that can be sourced to
helpfile doc/myscript.txt
For the "helpfile" item ":helptags" is run.
+For List comparing, consider [4] and ['4'] different? (Servatius Brandt)
+Also allows strict comparing for ordinary variables.
+
Patch to alternate fold highlighting. (Anthony Iano-Fletcher, 2005 May 12)
More levels?
- Code for making suggestions:
- Aspell has the "special" character, useful?
- The score is a bit wrong for substituting multi-byte characters.
+ At the head byte remember how may bytes are still to follow, do
+ the scoring at the tail byte. But don't even try when the score
+ plus the minimal penalty (similar char) goes over maximum.
- similar_chars() is too slow.
- - Swapping works with bytes instead of characters.
- - The sound-folding doesn't work for multi-byte characters.
+ use a lookuptable for single-byte
+ use a hashtable for multi-byte
+ support letter appearing in several lists?
+ - When putting map string in .spl file check for duplicate chars.
+ - GUI: Selecting text doesn't work at the prompt.
+ - Should "z?" replacement be redo-able with "."?
+ - The sound-folding doesn't work for multi-byte characters. It's
+ very slow too. Prepare the table (remove alternatives)?
- Also put list of word characters in word list file. Otherwise the
one for Italian may differ from the one used for English.
- Make "en-rare" spell file.
- Put the list of choices right under the place where they would be
inserted.
- Pre-expand abbreviations, show which abbrevs would match?
+ - Completion in .NET framework SharpDevelop: http://www.icsharpcode.net
- UNDO TREE: keep all states of the text, don't delete undo info.
When making a change, instead of clearing any future undo (thus redo)
info, make a new branch.
Win32: Patch for Korean IME. (Yusung, 2005 March 21)
-When "= evaluation results in a list, use it as a sequence of lines.
+When "= evaluation results in a List, use it as a sequence of lines.
Support ":set syntax=cpp.doxygen"? Suggested patch by Michael Geddes (9 Aug
2004). Should also work for 'filetype'.
-" Vim indent file
-" Language: Pascal
-" Maintainer: Neil Carter <n.carter@swansea.ac.uk>
-" Created: 2004 Jul 13
-" Last Change: 2005 Jun 07
-" TODO: Reduce indentation on line after a statement that flowed across
-" two lines (e.g. parameter list closed on second line). Also, increase
-" indent of a becomes-statement that flows onto second line.
-
-" Only load this indent file when no other was loaded.
-if exists("b:did_indent")
- finish
-endif
-let b:did_indent = 1
-
-setlocal indentexpr=GetPascalIndent(v:lnum)
-" Appending an & to an option sets it to its default value.
-setlocal indentkeys&
-setlocal indentkeys+=~end;,=~const,=~type,=~var,=~begin,=~repeat,=~until,=~for
-setlocal indentkeys+=~program,=~function,=~procedure,=~object,=~private
-setlocal indentkeys+=~record,=~if,=~else,=~case
-
-if exists("*GetPascalIndent")
- finish
-endif
-
-
-function s:GetPrevLineNum( line_num )
-
- " Skip over comments and conditional directives
- let SKIP_LINES = '^\s*\((\*\)\|\(\*\ \)\|\(\*)\)\|\({\$\)'
-
- let nline = a:line_num
- while nline > 0
- let nline = prevnonblank(nline-1)
- if getline(nline) !~? SKIP_LINES
- break
- endif
- endwhile
-
-" call input( "nline = ".nline )
-
- return nline
-
-endfunction
-
-
-function! GetPascalIndent( line_num )
- if a:line_num == 0
- return 0
- endif
-
- " If in the middle of a three-part comment
- if getline( a:line_num ) =~ '^\s*\*\ '
- return indent( a:line_num )
- endif
-
- " We have to subtract one to start on the line before the current
- " one. Otherwise, prevnonblank() returns the current line!
- let prev_line_num = s:GetPrevLineNum( a:line_num )
- let prev_line = getline( prev_line_num )
- let indnt = indent( prev_line_num )
-
- let this_line = getline( a:line_num )
-
- " At the start of a block, we have to indent the newly-created line
- " based on the previous line.
- " =~ means matches a regular expression
- " a question mark after =~ means ignore case (# means match case)
- " const, type, var should always appear at the start of a line, but
- " begin can appear anywhere in the line.
- " if one of the following keywords appear in the previous line with
- " nothing before it but optional whitespace, and nothing after it.
- " Has to be end of line at end to show this is not a routine
- " parameter list. Otherwise, you'd end up with cascading vars.
-
- " These words appear alone on a line (apart from whitespace).
- if prev_line =~ '^\s*\(const\|var\|begin\|repeat\|private\)$'
- " Place an & before an option to obtain its value.
- let indnt = indnt + &shiftwidth
- endif
-
- " Words preceded by optional whitespace and followed by anything.
- if prev_line =~ '^\s*\(for\|if\|else\|case\)'
- " Place an & before an option to obtain its value.
- let indnt = indnt + &shiftwidth
- " if this is a multistatement block then we need to align the
- " begin with the previous line.
- if this_line =~ '^\s*begin'
- let indnt = indnt - &shiftwidth
- endif
- endif
- " These words may have text before them on the line (hence the .*).
- if prev_line =~ '^.*\s*\<\(object\|record\)\>$'
- let indnt = indnt + &shiftwidth
- endif
- " If we have opened a bracket and the contents spills over one line,
- " then indent one level beyond the bracket's first line. RE = an
- " opening bracket followed by any amount of anything other than a
- " closing bracket and then the end-of-line. If we didn't include the
- " end of line, this RE would match even closed brackets, since it
- " would match everything up to the closing bracket.
- " This test isn't clever enough to handle brackets inside strings or
- " comments.
- if prev_line =~ '([^*][^)]*$'
- let indnt = indnt + &shiftwidth
- endif
-
- " If we just closed a bracket that started on a previous line, then
- " unindent.
- if prev_line =~ '^[^(]*[^*])'
- let indnt = indnt - &shiftwidth
- endif
-
- " At the end of a block, we have to unindent both the current line
- " (the 'end;' for instance) and the newly-created line.
- if this_line =~ '^\s*\(end;\|until\|else\)'
- let indnt = indnt - &shiftwidth
- endif
-
- " Keywords that always appear at the start of a line.
- " Problem is that function and procedure keywords should be indented
- " if within a class declaration.
- if this_line =~ '^\s*\<type\|uses\|$IFDEF\|$ENDIF\|procedure\|function\>'
- let indnt = 0
- endif
- if prev_line =~ '^\s*\<type\|uses\>'
- let indnt = &shiftwidth
- endif
-
- " Put conditional compile directives on first column.
- if this_line =~ '^\s*{\$'
- let indnt = 0
- endif
-
- return indnt
-endfunction
-
-" TODO: end; should align with the previous (begin/record/object/else).
-" "else begin" is the only case where begin does not appear at the start
-" of the line.
-
-" TODO: Don't align with {$IFDEF}
-
-"Example from vb.vim
-" regular expression match, case insensitive
-"if previous_line =~?
-" start of line, zero or more whitespace
-"'^\s*
-" start of word
-"\<
-"
-"\(
-" begin\|
-" \%(
-" \%(
-" private\|public\|friend
-" \)
-" \s\+
-" \)
-" zero or more of the previous atom
-" \=
-" \%(
-" function\|sub\|property
-" \)
-" \|select\|case\|default\|if
-"\>
-" .\{-}\<then\>\s*$\|else\|elseif\|do\|for\|while\|enum\|with
-"\)
-" end of word
-"\>'
-" let ind = ind + &sw
-"endif
+" Vim indent file\r
+" Language: Pascal\r
+" Maintainer: Neil Carter <n.carter@swansea.ac.uk>\r
+" Created: 2004 Jul 13\r
+" Last Change: 2005 Jun 15\r
+\r
+\r
+if exists("b:did_indent")\r
+ finish\r
+endif\r
+let b:did_indent = 1\r
+\r
+setlocal indentexpr=GetPascalIndent(v:lnum)\r
+setlocal indentkeys&\r
+setlocal indentkeys+==end;,==const,==type,==var,==begin,==repeat,==until,==for\r
+setlocal indentkeys+==program,==function,==procedure,==object,==private\r
+setlocal indentkeys+==record,==if,==else,==case\r
+\r
+if exists("*GetPascalIndent")\r
+ finish\r
+endif\r
+\r
+\r
+function! s:GetPrevNonCommentLineNum( line_num )\r
+\r
+ " Skip lines starting with a comment\r
+ let SKIP_LINES = '^\s*\(\((\*\)\|\(\*\ \)\|\(\*)\)\|{\|}\)'\r
+\r
+ let nline = a:line_num\r
+ while nline > 0\r
+ let nline = prevnonblank(nline-1)\r
+ if getline(nline) !~? SKIP_LINES\r
+ break\r
+ endif\r
+ endwhile\r
+\r
+ return nline\r
+endfunction\r
+\r
+\r
+function! GetPascalIndent( line_num )\r
+ " Line 0 always goes at column 0\r
+ if a:line_num == 0\r
+ return 0\r
+ endif\r
+\r
+ let this_codeline = getline( a:line_num )\r
+\r
+ " If in the middle of a three-part comment\r
+ if this_codeline =~ '^\s*\*'\r
+ return indent( a:line_num )\r
+ endif\r
+\r
+ let prev_codeline_num = s:GetPrevNonCommentLineNum( a:line_num )\r
+ let prev_codeline = getline( prev_codeline_num )\r
+ let indnt = indent( prev_codeline_num )\r
+\r
+ " Compiler directives should always go in column zero.\r
+ if this_codeline =~ '^\s*{\(\$IFDEF\|\$ELSE\|\$ENDIF\)'\r
+ return 0\r
+ endif\r
+\r
+ " These items have nothing before or after (not even a comment), and\r
+ " go on column 0. Make sure that the ^\s* is followed by \( to make\r
+ " ORs work properly, and not include the start of line (this must\r
+ " always appear).\r
+ " The bracketed expression with the underline is a routine\r
+ " separator. This is one case where we do indent comment lines.\r
+ if this_codeline =~ '^\s*\((\*\ _\+\ \*)\|\<\(const\|var\)\>\)$'\r
+ return 0\r
+ endif\r
+\r
+ " These items may have text after them, and go on column 0 (in most\r
+ " cases). The problem is that "function" and "procedure" keywords\r
+ " should be indented if within a class declaration.\r
+ if this_codeline =~ '^\s*\<\(program\|type\|uses\|procedure\|function\)\>'\r
+ return 0\r
+ endif\r
+\r
+ " BEGIN\r
+ " If the begin does not come after "if", "for", or "else", then it\r
+ " goes in column 0\r
+ if this_codeline =~ '^\s*begin\>' && prev_codeline !~ '^\s*\<\(if\|for\|else\)\>'\r
+ return 0\r
+ endif\r
+\r
+ " These keywords are indented once only.\r
+ if this_codeline =~ '^\s*\<\(private\)\>'\r
+ return &shiftwidth\r
+ endif\r
+\r
+ " If the PREVIOUS LINE contained these items, the current line is\r
+ " always indented once.\r
+ if prev_codeline =~ '^\s*\<\(type\|uses\)\>'\r
+ return &shiftwidth\r
+ endif\r
+\r
+ " These keywords are indented once only. Possibly surrounded by\r
+ " other chars.\r
+ if this_codeline =~ '^.\+\<\(object\|record\)\>'\r
+ return &shiftwidth\r
+ endif\r
+\r
+ " If the previous line was indenting...\r
+ if prev_codeline =~ '^\s*\<\(for\|if\|case\|else\|end\ else\)\>'\r
+ " then indent.\r
+ let indnt = indnt + &shiftwidth\r
+ " BUT... if this is the start of a multistatement block then we\r
+ " need to align the begin with the previous line.\r
+ if this_codeline =~ '^\s*begin\>'\r
+ return indnt - &shiftwidth\r
+ endif\r
+\r
+ " We also need to keep the indentation level constant if the\r
+ " whole if-then statement was on one line.\r
+ if prev_codeline =~ '\<then\>.\+'\r
+ let indnt = indnt - &shiftwidth\r
+ endif\r
+ endif\r
+\r
+ " PREVIOUS-LINE BEGIN\r
+ " If the previous line was an indenting keyword then indent once...\r
+ if prev_codeline =~ '^\s*\<\(const\|var\|begin\|repeat\|private\)\>'\r
+ " But only if this is another var in a list.\r
+ if this_codeline !~ '^\s*var\>'\r
+ return indnt + &shiftwidth\r
+ endif\r
+ endif\r
+\r
+ " PREVIOUS-LINE BEGIN\r
+ " Indent code after a case statement begin\r
+ if prev_codeline =~ '\:\ begin\>'\r
+ return indnt + &shiftwidth\r
+ endif\r
+\r
+ " These words may have text before them on the line (hence the .*)\r
+ " but are followed by nothing. Always indent once only.\r
+ if prev_codeline =~ '^\(.*\|\s*\)\<\(object\|record\)\>$'\r
+ return indnt + &shiftwidth\r
+ endif\r
+\r
+ " If we just closed a bracket that started on a previous line, then\r
+ " unindent. But don't return yet -- we need to check for further\r
+ " unindentation (for end/until/else)\r
+ if prev_codeline =~ '^[^(]*[^*])'\r
+ let indnt = indnt - &shiftwidth\r
+ endif\r
+\r
+ " At the end of a block, we have to unindent both the current line\r
+ " (the "end" for instance) and the newly-created line.\r
+ if this_codeline =~ '^\s*\<\(end\|until\|else\)\>'\r
+ return indnt - &shiftwidth\r
+ endif\r
+\r
+ " If we have opened a bracket and it continues over one line,\r
+ " then indent once.\r
+ "\r
+ " RE = an opening bracket followed by any amount of anything other\r
+ " than a closing bracket and then the end-of-line.\r
+ "\r
+ " If we didn't include the end of line, this RE would match even\r
+ " closed brackets, since it would match everything up to the closing\r
+ " bracket.\r
+ "\r
+ " This test isn't clever enough to handle brackets inside strings or\r
+ " comments.\r
+ if prev_codeline =~ '([^*]\=[^)]*$'\r
+ return indnt + &shiftwidth\r
+ endif\r
+\r
+ return indnt\r
+endfunction\r
+\r