summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2004-10-24 19:23:07 +0000
committerBram Moolenaar <Bram@vim.org>2004-10-24 19:23:07 +0000
commit35a9aaab4a2171821f5a19acaa99015818daba07 (patch)
tree58dddbd986eedf3e523c8ed5285b08c1d61fdada
parent009b2592f7488286f286484b7f389e36fffa4bd9 (diff)
downloadvim-git-35a9aaab4a2171821f5a19acaa99015818daba07.tar.gz
updated for version 7.0020v7.0020
-rw-r--r--runtime/doc/todo.txt37
-rw-r--r--runtime/keymap/bulgarian.vim90
-rw-r--r--runtime/lang/menu_ja.ujis.vim6
-rw-r--r--runtime/syntax/2html.vim194
-rw-r--r--src/eval.c4
-rw-r--r--src/ex_cmds.c4
-rw-r--r--src/ex_cmds.h2
-rw-r--r--src/gui_gtk_x11.c5
-rw-r--r--src/gui_x11.c4
-rw-r--r--src/main.c14
-rw-r--r--src/memline.c8
11 files changed, 244 insertions, 124 deletions
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index b23621402..ad5209aee 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt* For Vim version 7.0aa. Last change: 2004 Oct 12
+*todo.txt* For Vim version 7.0aa. Last change: 2004 Oct 24
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -30,6 +30,14 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
*known-bugs*
-------------------- Known bugs and current work -----------------------
+Include NetBeans patches (Gordon Prieur, Oct 20)
+ See two messages for list of changed files. Additionally:
+ doc/eval.txt
+ Docs for message E680.
+
+Line number not updated when inserting a line in anothe window. (Hitier
+Sylvain, Oct 24)
+
Aborting at the ATTENTION prompt causes trouble:
buffer remains active, nwindows isn't closed (fixed in buffer.c)
alternate buffer gets "read error" flag.
@@ -48,6 +56,8 @@ Solved in os_mswin.c. Add to 6.3?
Patch for Win32 textdomain: NAKADAIRA Yukihiro, Sept 17.
+Handling decimal point on keypad: use MapVirtualKey. (Vince Negri, Oct 20)
+
Valencia: executable("xxd.exe") returns true while "!xxd" doesn't work.
Works fine for me. Only in specific environment?
@@ -77,6 +87,8 @@ When using "set laststatus=2 cmdheight=2" in the .gvimrc you only get one line
for the cmdline. (Christian Robinson) When the Vim window is resized (e.g.,
xterm with many lines) it's OK.
+":e <cfile>" does not expand ~/file, very confusing compared to ":e ~/file".
+
For version 7.0:
@@ -193,11 +205,8 @@ For version 7.0:
Also: when the environment variable exists, use it. If it doesn't
exist, set it. Requires good names: $VIM_USER_VIMRC $VIM_USER_DIR
-xterm title: After setting a title, obtaining the title still may result in
-the old one. Sometimes happens with the test scripts. Setting the title is
-done with an ESC sequence, obtaining the old title with an X library call.
-Invoking XFlush() before getting the title doesn't help.
+- Edit same file on Unix and from MS-Windows: no warning for swap file.
- In the kvim/KDE source files fix the formatting.
- KDE version is called "kvim". Make it "gvim", like the others?
- Better configure check for KDE include files from Dan Sharp.
@@ -233,6 +242,7 @@ Invoking XFlush() before getting the title doesn't help.
- "INTELLISENSE". First cleanup the Insert-mode completion.
http://www.vim.org/scripts/script.php?script_id=747
http://sourceforge.net/projects/insenvim
+ of http://insenvim.sourceforge.net
http://cedet.sourceforge.net/intellisense.shtml (for Emacs)
Ivan Villanueva has something for Java.
Can't call it Intellisense, it is a trademark by Microsoft.
@@ -250,6 +260,7 @@ Invoking XFlush() before getting the title doesn't help.
info, make a new branch.
To navigate through the undo tree number the states of the text
sequentially and make it possible to go through the tree in that order.
+ Use "g+++" to go forward, "g---" to go backward. Can mix - and +.
Could also use timestamps (to show the time and/or jump to a state five
minutes ago). (David Schweikert)
To go from one state to another: backtrack to a common state, then forward
@@ -269,7 +280,8 @@ Invoking XFlush() before getting the title doesn't help.
incompatible change.
7 Support WINDOW TABS. Works like several pages, each with their own
split windows. Patch for GTK 1.2 from Christian Michon, 2004 Jan 6.
- Also for the console!
+ Also for the console! In Emacs these are called frames.
+ Use "1gt" - "99gt" to switch to a tab?
- EMBEDDING: Make it possible to run Vim inside a window of another program.
For Xwindows this can be done with XReparentWindow().
For GTK Neil Bird has a patch to use Vim like a widget.
@@ -299,6 +311,8 @@ Invoking XFlush() before getting the title doesn't help.
"foldcolumn". (Benji Fisher, 2004 Jun 21)
- FileChangedShellPost autocommand event: after (not) reloading a changed
file. Can be used to update statusline oslt.
+- Running a shell command from the GUI still has limitations. Look into how
+ the Vim shell project can help: http://vimshell.wana.at
8 When a file is change outside of Vim and unmodified in Vim there is no
simple way to automatically reload the file. Either add an option for
this or make it simple to have the FileChangedShell invoke the normal
@@ -361,7 +375,7 @@ name. (Charles Campbell)
Add gui_mch_browsedir() for Motif, KDE and Mac OS/X.
-Translated manual pages: Install German one in /usr/local/man/de/man1/vim.1
+Install vim-it.1 manual page in .../man/it/man1/vim.1
Vi incompatibility:
@@ -1014,6 +1028,9 @@ Macintosh:
8 For xterm need to open a connection to the X server to get the window
title, which can be slow. Can also get the title with "<Esc>[21t", no
need to use X11 calls. This returns "<Esc>]l{title}<Esc>\".
+6 When the xterm reports the number of colors, a redraw occurs. This is
+ annoying on a slow connection. Wait for the xterm to report the number of
+ colors before drawing the screen. With a timeout.
8 When the builtin xterm termcap contains codes that are not wanted, need a
way to avoid using the builtin termcap.
8 Xterm sends ^[[H for <Home> and ^[[F for <End> in some mode. Also
@@ -1108,6 +1125,12 @@ I can't reproduce these (if you can, let me know how!):
Problems that will (probably) not be solved:
+- xterm title: The following scenario may occur (esp. when running the Vim
+ test script): Vim 1 sets the title to "file1", then restores the title to
+ "xterm" when exiting with an ESC sequence. Vim 2 obtains the old title
+ with an X library call, this may result in "file1", because the window
+ manager hasn't processed the "xterm" title yet. Can apparently only be
+ worked around with a delay.
- In a terminal with 'mouse' set such that the mouse is active when entering
a command line, after executing a shell command that scrolls up the
display and then pressing ":": Selecting text with the mouse works like
diff --git a/runtime/keymap/bulgarian.vim b/runtime/keymap/bulgarian.vim
new file mode 100644
index 000000000..3c80c9ffe
--- /dev/null
+++ b/runtime/keymap/bulgarian.vim
@@ -0,0 +1,90 @@
+" Vim Keymap file for russian characters, phonetic layout 'yawerty'
+" Useful mainly with utf-8 but may work with other encodings
+
+" Maintainer: Alberto Mardegan <mardy@despammed.com>
+" Last Changed: 2004 Oct 17
+
+" All characters are given literally, conversion to another encoding (e.g.,
+" UTF-8) should work.
+scriptencoding utf-8
+
+let b:keymap_name = "bg"
+
+loadkeymap
+A А CYRILLIC CAPITAL LETTER A
+B Б CYRILLIC CAPITAL LETTER BE
+W В CYRILLIC CAPITAL LETTER VE
+V В CYRILLIC CAPITAL LETTER VE
+G Г CYRILLIC CAPITAL LETTER GHE
+D Д CYRILLIC CAPITAL LETTER DE
+E Е CYRILLIC CAPITAL LETTER IE
+Zh Ж CYRILLIC CAPITAL LETTER ZHE
+ZH Ж CYRILLIC CAPITAL LETTER ZHE
+Z З CYRILLIC CAPITAL LETTER ZE
+I И CYRILLIC CAPITAL LETTER I
+J Й CYRILLIC CAPITAL LETTER SHORT I
+K К CYRILLIC CAPITAL LETTER KA
+L Л CYRILLIC CAPITAL LETTER EL
+M М CYRILLIC CAPITAL LETTER EM
+N Н CYRILLIC CAPITAL LETTER EN
+O О CYRILLIC CAPITAL LETTER O
+P П CYRILLIC CAPITAL LETTER PE
+R Р CYRILLIC CAPITAL LETTER ER
+S С CYRILLIC CAPITAL LETTER ES
+T Т CYRILLIC CAPITAL LETTER TE
+U У CYRILLIC CAPITAL LETTER U
+F Ф CYRILLIC CAPITAL LETTER EF
+H Х CYRILLIC CAPITAL LETTER HA
+C Ц CYRILLIC CAPITAL LETTER TSE
+Ch Ч CYRILLIC CAPITAL LETTER CHE
+CH Ч CYRILLIC CAPITAL LETTER CHE
+Sh Ш CYRILLIC CAPITAL LETTER SHA
+SH Ш CYRILLIC CAPITAL LETTER SHA
+Sht Щ CYRILLIC CAPITAL LETTER SHCHA
+SHt Щ CYRILLIC CAPITAL LETTER SHCHA
+SHT Щ CYRILLIC CAPITAL LETTER SHCHA
+Sj Щ CYRILLIC CAPITAL LETTER SHCHA
+SJ Щ CYRILLIC CAPITAL LETTER SHCHA
+Y Ъ CYRILLIC CAPITAL LETTER HARD SIGN
+X Ь CYRILLIC CAPITAL LETTER SOFT SIGN
+~ Ю CYRILLIC CAPITAL LETTER YU
+Ju Ю CYRILLIC CAPITAL LETTER YU
+JU Ю CYRILLIC CAPITAL LETTER YU
+Q Я CYRILLIC CAPITAL LETTER YA
+Ja Я CYRILLIC CAPITAL LETTER YA
+JA Я CYRILLIC CAPITAL LETTER YA
+a а CYRILLIC SMALL LETTER A
+b б CYRILLIC SMALL LETTER BE
+w в CYRILLIC SMALL LETTER VE
+v в CYRILLIC SMALL LETTER VE
+g г CYRILLIC SMALL LETTER GHE
+d д CYRILLIC SMALL LETTER DE
+e е CYRILLIC SMALL LETTER IE
+zh ж CYRILLIC SMALL LETTER ZHE
+w ж CYRILLIC SMALL LETTER ZHE
+z з CYRILLIC SMALL LETTER ZE
+i и CYRILLIC SMALL LETTER I
+j й CYRILLIC SMALL LETTER SHORT I
+k к CYRILLIC SMALL LETTER KA
+l л CYRILLIC SMALL LETTER EL
+m м CYRILLIC SMALL LETTER EM
+n н CYRILLIC SMALL LETTER EN
+o о CYRILLIC SMALL LETTER O
+p п CYRILLIC SMALL LETTER PE
+r р CYRILLIC SMALL LETTER ER
+s с CYRILLIC SMALL LETTER ES
+t т CYRILLIC SMALL LETTER TE
+u у CYRILLIC SMALL LETTER U
+f ф CYRILLIC SMALL LETTER EF
+h х CYRILLIC SMALL LETTER HA
+c ц CYRILLIC SMALL LETTER TSE
+ch ч CYRILLIC SMALL LETTER CHE
+sh ш CYRILLIC SMALL LETTER SHA
+sht щ CYRILLIC SMALL LETTER SHCHA
+sj щ CYRILLIC SMALL LETTER SHCHA
+y ъ CYRILLIC SMALL LETTER HARD SIGN
+x ь CYRILLIC SMALL LETTER SOFT SIGN
+` ю CYRILLIC SMALL LETTER YU
+ju ю CYRILLIC SMALL LETTER YU
+q я CYRILLIC SMALL LETTER YA
+ja я CYRILLIC SMALL LETTER YA
diff --git a/runtime/lang/menu_ja.ujis.vim b/runtime/lang/menu_ja.ujis.vim
new file mode 100644
index 000000000..49248fc74
--- /dev/null
+++ b/runtime/lang/menu_ja.ujis.vim
@@ -0,0 +1,6 @@
+" Menu Translations: Japanese (for UNIX)
+" Translated By: Muraoka Taro <koron@tka.att.ne.jp>
+" Last Change: 08:50:47 25-Mar-2001.
+
+" ujis is the same as euc-jp. Source the other one from here.
+source <sfile>:p:h/menu_ja_jp.euc-jp.vim
diff --git a/runtime/syntax/2html.vim b/runtime/syntax/2html.vim
index ea1e6e7bb..008221400 100644
--- a/runtime/syntax/2html.vim
+++ b/runtime/syntax/2html.vim
@@ -1,6 +1,6 @@
" Vim syntax support file
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2004 Oct 12
+" Last Change: 2004 Oct 15
" (modified by David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>)
" (XHTML support by Panagiotis Issaris <takis@lumumba.luc.ac.be>)
@@ -103,6 +103,32 @@ if !exists("html_use_css")
endfun
endif
+" Return HTML valid characters enclosed in a span of class style_name with
+" unprintable characters expanded and double spaces replaced as necessary.
+function! s:HtmlFormat(text, style_name)
+ " Replace unprintable characters
+ let formatted = strtrans(a:text)
+
+ " Replace the reserved html characters
+ let formatted = substitute(substitute(substitute(substitute(substitute(formatted, '&', '\&amp;', 'g'), '<', '\&lt;', 'g'), '>', '\&gt;', 'g'), '"', '\&quot;', 'g'), "\x0c", '<hr class="PAGE-BREAK">', 'g')
+
+ " Replace double spaces
+ if ' ' != s:HtmlSpace
+ let formatted = substitute(formatted, ' ', s:HtmlSpace . s:HtmlSpace, 'g')
+ endif
+
+ " Enclose in a span of class style_name
+ let formatted = '<span class="' . a:style_name . '">' . formatted . '</span>'
+
+ " Add the class to class list if it's not there yet
+ let s:id = hlID(a:style_name)
+ if stridx(s:idlist, "," . s:id . ",") == -1
+ let s:idlist = s:idlist . s:id . ","
+ endif
+
+ return formatted
+endfun
+
" Return CSS style describing given highlight id (can be empty)
function! s:CSS1(id)
let a = ""
@@ -157,7 +183,6 @@ endif
" Set some options to make it work faster.
-" Expand tabs in original buffer to get 'tabstop' correctly used.
" Don't report changes for :substitute, there will be many of them.
let s:old_title = &title
let s:old_icon = &icon
@@ -187,18 +212,29 @@ set magic
if exists("use_xhtml")
exe "normal! a<?xml version=\"1.0\"?>\n\e"
- let tag_close = '/>'
+ let s:tag_close = '/>'
else
- let tag_close = '>'
+ let s:tag_close = '>'
+endif
+
+let s:HtmlSpace = ' '
+let s:HtmlEndline = ''
+if exists("html_no_pre")
+ let s:HtmlEndline = '<br' . s:tag_close
+ if exists("use_xhtml")
+ let s:HtmlSpace = '\&#x20;'
+ else
+ let s:HtmlSpace = '\&nbsp;'
+ endif
endif
" HTML header, with the title and generator ;-). Left free space for the CSS,
" to be filled at the end.
exe "normal! a<html>\n<head>\n<title>\e"
exe "normal! a" . expand("%:p:~") . "</title>\n\e"
-exe "normal! a<meta name=\"Generator\" content=\"Vim/" . v:version/100 . "." . v:version %100 . '"' . tag_close . "\n\e"
+exe "normal! a<meta name=\"Generator\" content=\"Vim/" . v:version/100 . "." . v:version %100 . '"' . s:tag_close . "\n\e"
if s:html_encoding != ""
- exe "normal! a<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:html_encoding . '"' . tag_close . "\n\e"
+ exe "normal! a<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:html_encoding . '"' . s:tag_close . "\n\e"
endif
if exists("html_use_css")
exe "normal! a<style type=\"text/css\">\n<!--\n-->\n</style>\n\e"
@@ -214,11 +250,6 @@ exe s:orgwin . "wincmd w"
" List of all id's
let s:idlist = ","
-let s:expandedtab = ' '
-while strlen(s:expandedtab) < &ts
- let s:expandedtab = s:expandedtab . ' '
-endwhile
-
" Loop over all lines in the original text.
" Use html_start_line and html_end_line if they are set.
if exists("html_start_line")
@@ -238,35 +269,18 @@ else
let s:end = line("$")
endif
-" Closed folds are kept in the HTML. Prepare the closed fold template text.
if has('folding')
- let s:c = &fillchars[matchend(&fillchars, 'fold:')]
- if s:c == ''
- let s:c = '-'
+ let s:foldfillchar = &fillchars[matchend(&fillchars, 'fold:')]
+ if s:foldfillchar == ''
+ let s:foldfillchar = '-'
endif
- let s:htmlfoldtext = '+' . s:c
- while strlen(s:htmlfoldtext) < &columns
- let s:htmlfoldtext = s:htmlfoldtext . s:c
- endwhile
- unlet s:c
endif
-
-" For diff filler lines
-if has('diff')
- if s:numblines
- let s:fillerline = strpart(' ', 0, strlen(line("$"))) . ' '
- else
- let s:fillerline = ''
- endif
- let s:fillchar = &fillchars[matchend(&fillchars, 'diff:')]
- if s:fillchar == ''
- let s:fillchar = '-'
- endif
- while strlen(s:fillerline) < &columns
- let s:fillerline = s:fillerline . s:fillchar
- endwhile
+let s:difffillchar = &fillchars[matchend(&fillchars, 'diff:')]
+if s:difffillchar == ''
+ let s:difffillchar = '-'
endif
+
while s:lnum <= s:end
" If there are filler lines for diff mode, show these above the line.
@@ -274,24 +288,28 @@ while s:lnum <= s:end
if s:filler > 0
let s:n = s:filler
while s:n > 0
+ if s:numblines
+ " Indent if line numbering is on
+ let s:new = repeat(' ', strlen(s:end) + 1) . repeat(s:difffillchar, 3)
+ else
+ let s:new = repeat(s:difffillchar, 3)
+ endif
+
if s:n > 2 && s:n < s:filler && !exists("html_whole_filler")
- let s:new = strpart(s:fillerline, 0, 3) . " " . s:filler . " inserted lines "
- let s:new = s:new . strpart(s:fillerline, strlen(s:new))
+ let s:new = s:new . " " . s:filler . " inserted lines "
let s:n = 2
- else
- let s:new = s:fillerline
endif
- let s:id_name = "DiffDelete"
- let s:id = hlID(s:id_name)
- let s:new = '<span class="' . s:id_name . '">' . s:new . '</span>'
- " Add the class to class list if it's not there yet
- if stridx(s:idlist, "," . s:id . ",") == -1
- let s:idlist = s:idlist . s:id . ","
+
+ if !exists("html_no_pre")
+ " HTML line wrapping is off--go ahead and fill to the margin
+ let s:new = s:new . repeat(s:difffillchar, &columns - strlen(s:new))
endif
+ let s:new = s:HtmlFormat(s:new, "DiffDelete")
exe s:newwin . "wincmd w"
- exe "normal! a" . strtrans(s:new) . "\n\e"
+ exe "normal! a" . s:new . s:HtmlEndline . "\n\e"
exe s:orgwin . "wincmd w"
+
let s:n = s:n - 1
endwhile
unlet s:n
@@ -300,35 +318,22 @@ while s:lnum <= s:end
" Start the line with the line number.
if s:numblines
- let s:new = strpart(' ', 0, strlen(line("$")) - strlen(s:lnum)) . s:lnum . ' '
+ let s:new = repeat(' ', strlen(s:end) - strlen(s:lnum)) . s:lnum . ' '
else
let s:new = ""
endif
- " Get the current line
- let s:line = getline(s:lnum)
-
if has('folding') && foldclosed(s:lnum) > -1
"
" This is the beginning of a folded block
"
- let s:line = foldtextresult(s:lnum)
-
- let s:new = s:new . s:line
+ let s:new = s:new . foldtextresult(s:lnum)
if !exists("html_no_pre")
- let s:new = s:new . strpart(s:htmlfoldtext, strlen(s:new))
+ " HTML line wrapping is off--go ahead and fill to the margin
+ let s:new = s:new . repeat(s:foldfillchar, &columns - strlen(s:new))
endif
- " Replace the reserved html characters
- let s:new = substitute(substitute(substitute(substitute(substitute(s:new, '&', '\&amp;', 'g'), '<', '\&lt;', 'g'), '>', '\&gt;', 'g'), '"', '\&quot;', 'g'), "\x0c", '<hr class="PAGE-BREAK">', 'g')
-
- let s:id_name = "Folded"
- let s:id = hlID(s:id_name)
- let s:new = '<span class="' . s:id_name . '">' . s:new . '</span>'
- " Add the class to class list if it's not there yet
- if stridx(s:idlist, "," . s:id . ",") == -1
- let s:idlist = s:idlist . s:id . ","
- endif
+ let s:new = s:HtmlFormat(s:new, "Folded")
" Skip to the end of the fold
let s:lnum = foldclosedend(s:lnum)
@@ -337,10 +342,12 @@ while s:lnum <= s:end
"
" A line that is not folded.
"
+ let s:line = getline(s:lnum)
+
let s:len = strlen(s:line)
if s:numblines
- let s:new = '<span class="lnr">' . s:new . '</span> '
+ let s:new = '<span class="lnr">' . s:new . '</span>'
endif
" Get the diff attribute, if any.
@@ -348,7 +355,7 @@ while s:lnum <= s:end
" Loop over each character in the line
let s:col = 1
- while s:col <= s:len
+ while s:col <= s:len || (s:col == 1 && s:diffattr)
let s:startcol = s:col " The start column for processing text
if s:diffattr
let s:id = diff_hlID(s:lnum, s:col)
@@ -356,11 +363,11 @@ while s:lnum <= s:end
" Speed loop (it's small - that's the trick)
" Go along till we find a change in hlID
while s:col <= s:len && s:id == diff_hlID(s:lnum, s:col) | let s:col = s:col + 1 | endwhile
- while s:len < &columns
+ if s:len < &columns && !exists("html_no_pre")
" Add spaces at the end to mark the changed line.
- let s:line = s:line . ' '
- let s:len = s:len + 1
- endwhile
+ let s:line = s:line . repeat(' ', &columns - s:len)
+ let s:len = &columns
+ endif
else
let s:id = synID(s:lnum, s:col, 1)
let s:col = s:col + 1
@@ -369,42 +376,24 @@ while s:lnum <= s:end
while s:col <= s:len && s:id == synID(s:lnum, s:col, 1) | let s:col = s:col + 1 | endwhile
endif
+ " Expand tabs
+ let s:expandedtab = strpart(s:line, s:startcol - 1, s:col - s:startcol)
+ let idx = stridx(s:expandedtab, "\t")
+ while idx >= 0
+ let i = &ts - ((idx + s:startcol - 1) % &ts)
+ let s:expandedtab = substitute(s:expandedtab, '\t', repeat(' ', i), '')
+ let idx = stridx(s:expandedtab, "\t")
+ endwhile
+
" Output the text with the same synID, with class set to {s:id_name}
let s:id = synIDtrans(s:id)
let s:id_name = synIDattr(s:id, "name", s:whatterm)
- let s:new = s:new . '<span class="' . s:id_name . '">' . substitute(substitute(substitute(substitute(substitute(strpart(s:line, s:startcol - 1, s:col - s:startcol), '&', '\&amp;', 'g'), '<', '\&lt;', 'g'), '>', '\&gt;', 'g'), '"', '\&quot;', 'g'), "\x0c", '<hr class="PAGE-BREAK">', 'g') . '</span>'
- " Add the class to class list if it's not there yet
- if stridx(s:idlist, "," . s:id . ",") == -1
- let s:idlist = s:idlist . s:id . ","
- endif
-
- if s:col > s:len
- break
- endif
+ let s:new = s:new . s:HtmlFormat(s:expandedtab, s:id_name)
endwhile
endif
- " Expand tabs
- let s:pad=0
- let s:start = 0
- let s:idx = stridx(s:line, "\t")
- while s:idx >= 0
- let s:i = &ts - ((s:start + s:pad + s:idx) % &ts)
- let s:new = substitute(s:new, '\t', strpart(s:expandedtab, 0, s:i), '')
- let s:pad = s:pad + s:i - 1
- let s:start = s:start + s:idx + 1
- let s:idx = stridx(strpart(s:line, s:start), "\t")
- endwhile
-
- if exists("html_no_pre")
- if exists("use_xhtml")
- let s:new = substitute(s:new, ' ', '\&#x20;\&#x20;', 'g') . '<br/>'
- else
- let s:new = substitute(s:new, ' ', '\&nbsp;\&nbsp;', 'g') . '<br>'
- endif
- endif
exe s:newwin . "wincmd w"
- exe "normal! a" . strtrans(s:new) . "\n\e"
+ exe "normal! a" . s:new . s:HtmlEndline . "\n\e"
exe s:orgwin . "wincmd w"
let s:lnum = s:lnum + 1
+
@@ -488,7 +477,7 @@ while s:idlist != ""
endwhile
" Add hyperlinks
-%s+\(http://\S\{-}\)\(\([.,;:}]\=\(\s\|$\)\)\|[\\"'<>]\|&gt;\|&lt;\)+<A HREF="\1">\1</A>\2+ge
+%s+\(http://\S\{-}\)\(\([.,;:}]\=\(\s\|$\)\)\|[\\"'<>]\|&gt;\|&lt;\|&quot;\)+<A HREF="\1">\1</A>\2+ge
" The DTD
if exists("html_use_css")
@@ -512,12 +501,13 @@ exe s:newwin . "wincmd w"
" Save a little bit of memory (worth doing?)
unlet s:old_et s:old_paste s:old_icon s:old_report s:old_title s:old_search
unlet s:whatterm s:idlist s:lnum s:end s:fgc s:bgc s:old_magic
-unlet! s:col s:id s:attr s:len s:line s:new s:did_retab s:numblines
+unlet! s:col s:id s:attr s:len s:line s:new s:expandedtab s:numblines
unlet s:orgwin s:newwin s:orgbufnr
delfunc s:HtmlColor
+delfunc s:HtmlFormat
delfunc s:CSS1
if !exists("html_use_css")
delfunc s:HtmlOpening
delfunc s:HtmlClosing
endif
-silent! unlet s:htmlfoldtext s:fillerline s:diffattr
+silent! unlet s:diffattr s:difffillchar s:foldfillchar s:HtmlSpace s:HtmlEndline
diff --git a/src/eval.c b/src/eval.c
index 8416b578f..88b954971 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -5571,6 +5571,10 @@ f_has(argvars, retvar)
else if (STRICMP(name, "win95") == 0)
n = mch_windows95();
#endif
+#ifdef FEAT_NETBEANS_INTG
+ else if (STRICMP(name, "netbeans_enabled") == 0)
+ n = usingNetbeans;
+#endif
}
retvar->var_val.var_number = n;
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index b462e1f6e..7ed48b967 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -3208,8 +3208,8 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags)
workshop_file_opened((char *)curbuf->b_ffname, curbuf->b_p_ro);
# endif
# ifdef FEAT_NETBEANS_INTG
- if (usingNetbeans)
- netbeans_file_opened((char *)curbuf->b_ffname);
+ if (usingNetbeans & ((flags & ECMD_SET_HELP) != ECMD_SET_HELP))
+ netbeans_file_opened(curbuf);
# endif
}
#endif
diff --git a/src/ex_cmds.h b/src/ex_cmds.h
index af76d734b..5d0f0819b 100644
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -524,6 +524,8 @@ EX(CMD_mzfile, "mzfile", ex_mzfile,
RANGE|FILE1|NEEDARG|CMDWIN),
EX(CMD_next, "next", ex_next,
RANGE|NOTADR|BANG|FILES|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_nbkey, "nbkey", ex_nbkey,
+ EXTRA|NOTADR|NEEDARG),
EX(CMD_new, "new", ex_splitview,
BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
EX(CMD_nmap, "nmap", ex_map,
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index bc727733f..6d6d55d09 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -3309,11 +3309,6 @@ gui_mch_init(void)
/* Pretend we don't have input focus, we will get an event if we do. */
gui.in_focus = FALSE;
-#ifdef FEAT_NETBEANS_INTG
- if (usingNetbeans)
- netbeans_gtk_connect();
-# endif
-
return OK;
}
diff --git a/src/gui_x11.c b/src/gui_x11.c
index 7087e0208..e57bb9279 100644
--- a/src/gui_x11.c
+++ b/src/gui_x11.c
@@ -1540,10 +1540,6 @@ gui_mch_init()
if (usingSunWorkShop)
workshop_connect(app_context);
#endif
-#ifdef FEAT_NETBEANS_INTG
- if (usingNetbeans)
- netbeans_Xt_connect(app_context);
-#endif
#ifdef FEAT_BEVAL
gui_init_tooltip_font();
diff --git a/src/main.c b/src/main.c
index 0f63d7848..3976a4433 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1255,6 +1255,20 @@ scripterror:
#endif
)
{
+#ifdef NBDEBUG
+ /*
+ * This shouldn't be necessary. But if I run netbeans with the log
+ * output coming to the console and XOpenDisplay fails, I get vim
+ * trying to start with input/output to my console tty. This fills my
+ * input buffer so fast I can't even kill the process in under 2
+ * minutes (and it beeps continuosly the whole time :-)
+ */
+ if (usingNetbeans && (!stdout_isatty || !input_isatty))
+ {
+ mch_errmsg(_("Vim: Error: Failure to start gvim from NetBeans\n"));
+ exit(1);
+ }
+#endif
if (!stdout_isatty)
mch_errmsg(_("Vim: Warning: Output is not to a terminal\n"));
if (!input_isatty)
diff --git a/src/memline.c b/src/memline.c
index 67d233b9e..a3bd9d7be 100644
--- a/src/memline.c
+++ b/src/memline.c
@@ -2462,8 +2462,8 @@ ml_append_int(buf, lnum, line, len, newfile, mark)
if (usingNetbeans)
{
if (STRLEN(line) > 0)
- netbeans_inserted(buf, lnum+1, (colnr_T)0, 0, line, STRLEN(line));
- netbeans_inserted(buf, lnum+1, (colnr_T)STRLEN(line), 0,
+ netbeans_inserted(buf, lnum+1, (colnr_T)0, line, STRLEN(line));
+ netbeans_inserted(buf, lnum+1, (colnr_T)STRLEN(line),
(char_u *)"\n", 1);
}
#endif
@@ -2500,7 +2500,7 @@ ml_replace(lnum, line, copy)
if (usingNetbeans)
{
netbeans_removed(curbuf, lnum, 0, (long)STRLEN(ml_get(lnum)));
- netbeans_inserted(curbuf, lnum, 0, 0, line, STRLEN(line));
+ netbeans_inserted(curbuf, lnum, 0, line, STRLEN(line));
}
#endif
if (curbuf->b_ml.ml_line_lnum != lnum) /* other line buffered */
@@ -2605,7 +2605,7 @@ ml_delete_int(buf, lnum, message)
#ifdef FEAT_NETBEANS_INTG
if (usingNetbeans)
- netbeans_removed(buf, lnum, 0, line_size);
+ netbeans_removed(buf, lnum, 0, (long)line_size);
#endif
/*