Compare commits

...

5 Commits

Author SHA1 Message Date
Bram Moolenaar
0f6c9487b7 updated for version 7.2-080 2009-01-13 11:29:48 +00:00
Bram Moolenaar
d7f8f5c847 updated for version 7.2-079 2009-01-06 15:14:30 +00:00
Bram Moolenaar
238b8e20bb updated for version 7.2-078 2009-01-06 14:02:45 +00:00
Bram Moolenaar
e0e6f99212 updated for version 7.2-077 2008-12-31 15:21:32 +00:00
Bram Moolenaar
3576da72b4 updated for version 7.2-076 2008-12-30 15:15:57 +00:00
9 changed files with 174 additions and 64 deletions

View File

@@ -1,4 +1,4 @@
*netbeans.txt* For Vim version 7.2. Last change: 2008 Jun 28
*netbeans.txt* For Vim version 7.2. Last change: 2009 Jan 06
VIM REFERENCE MANUAL by Gordon Prieur et al.
@@ -722,8 +722,10 @@ keyAtPos keyName lnum/col
of the cursor.
New in version 2.1.
killed A file was closed by the user. Only for files that have been
assigned a number by the IDE.
killed A file was deleted or wiped out by the user and the buffer
annotations have been removed. The bufID number for this
buffer has become invalid. Only for files that have been
assigned a bufID number by the IDE.
newDotAndMark off off
Reports the position of the cursor being at "off" bytes into

View File

@@ -437,10 +437,6 @@ close_buffer(win, buf, action)
return;
#endif
#ifdef FEAT_NETBEANS_INTG
if (usingNetbeans)
netbeans_file_closed(buf);
#endif
/* Change directories when the 'acd' option is set. */
DO_AUTOCHDIR
@@ -639,6 +635,10 @@ free_buffer_stuff(buf, free_options)
#ifdef FEAT_SIGNS
buf_delete_signs(buf); /* delete any signs */
#endif
#ifdef FEAT_NETBEANS_INTG
if (usingNetbeans)
netbeans_file_killed(buf);
#endif
#ifdef FEAT_LOCALMAP
map_clear_int(buf, MAP_ALL_MODES, TRUE, FALSE); /* clear local mappings */
map_clear_int(buf, MAP_ALL_MODES, TRUE, TRUE); /* clear local abbrevs */
@@ -815,9 +815,6 @@ do_bufdel(command, arg, addr_count, start_bnr, end_bnr, forceit)
int bnr; /* buffer number */
char_u *p;
#ifdef FEAT_NETBEANS_INTG
netbeansCloseFile = 1;
#endif
if (addr_count == 0)
{
(void)do_buffer(command, DOBUF_CURRENT, FORWARD, 0, forceit);
@@ -912,9 +909,6 @@ do_bufdel(command, arg, addr_count, start_bnr, end_bnr, forceit)
}
}
#ifdef FEAT_NETBEANS_INTG
netbeansCloseFile = 0;
#endif
return errormsg;
}

View File

@@ -147,6 +147,7 @@ static void ins_compl_clear __ARGS((void));
static int ins_compl_bs __ARGS((void));
static void ins_compl_new_leader __ARGS((void));
static void ins_compl_addleader __ARGS((int c));
static int ins_compl_len __ARGS((void));
static void ins_compl_restart __ARGS((void));
static void ins_compl_set_original_text __ARGS((char_u *str));
static void ins_compl_addfrommatch __ARGS((void));
@@ -197,7 +198,8 @@ static void replace_pop_ins __ARGS((void));
static void mb_replace_pop_ins __ARGS((int cc));
#endif
static void replace_flush __ARGS((void));
static void replace_do_bs __ARGS((void));
static void replace_do_bs __ARGS((int limit_col));
static int del_char_after_col __ARGS((int limit_col));
#ifdef FEAT_CINDENT
static int cindent_on __ARGS((void));
#endif
@@ -1933,6 +1935,8 @@ truncate_spaces(line)
/*
* Backspace the cursor until the given column. Handles REPLACE and VREPLACE
* modes correctly. May also be used when not in insert mode at all.
* Will attempt not to go before "col" even when there is a composing
* character.
*/
void
backspace_until_column(col)
@@ -1942,13 +1946,49 @@ backspace_until_column(col)
{
curwin->w_cursor.col--;
if (State & REPLACE_FLAG)
replace_do_bs();
else
(void)del_char(FALSE);
replace_do_bs(col);
else if (!del_char_after_col(col))
break;
}
}
#endif
/*
* Like del_char(), but make sure not to go before column "limit_col".
* Only matters when there are composing characters.
* Return TRUE when something was deleted.
*/
static int
del_char_after_col(limit_col)
int limit_col;
{
#ifdef FEAT_MBYTE
if (enc_utf8 && limit_col >= 0)
{
int ecol = curwin->w_cursor.col + 1;
/* Make sure the cursor is at the start of a character, but
* skip forward again when going too far back because of a
* composing character. */
mb_adjust_cursor();
while (curwin->w_cursor.col < limit_col)
{
int l = utf_ptr2len(ml_get_cursor());
if (l == 0) /* end of line */
break;
curwin->w_cursor.col += l;
}
if (*ml_get_cursor() == NUL || curwin->w_cursor.col == ecol)
return FALSE;
del_bytes((long)(ecol - curwin->w_cursor.col), FALSE, TRUE);
}
else
#endif
(void)del_char(FALSE);
return TRUE;
}
#if defined(FEAT_INS_EXPAND) || defined(PROTO)
/*
* CTRL-X pressed in Insert mode.
@@ -2418,7 +2458,7 @@ ins_compl_longest_match(match)
{
had_match = (curwin->w_cursor.col > compl_col);
ins_compl_delete();
ins_bytes(compl_leader + curwin->w_cursor.col - compl_col);
ins_bytes(compl_leader + ins_compl_len());
ins_redraw(FALSE);
/* When the match isn't there (to avoid matching itself) remove it
@@ -2470,7 +2510,7 @@ ins_compl_longest_match(match)
*p = NUL;
had_match = (curwin->w_cursor.col > compl_col);
ins_compl_delete();
ins_bytes(compl_leader + curwin->w_cursor.col - compl_col);
ins_bytes(compl_leader + ins_compl_len());
ins_redraw(FALSE);
/* When the match isn't there (to avoid matching itself) remove it
@@ -3209,7 +3249,7 @@ ins_compl_new_leader()
{
ins_compl_del_pum();
ins_compl_delete();
ins_bytes(compl_leader + curwin->w_cursor.col - compl_col);
ins_bytes(compl_leader + ins_compl_len());
compl_used_match = FALSE;
if (compl_started)
@@ -3263,6 +3303,20 @@ ins_compl_new_leader()
compl_enter_selects = FALSE;
}
/*
* Return the length of the completion, from the completion start column to
* the cursor column. Making sure it never goes below zero.
*/
static int
ins_compl_len()
{
int off = curwin->w_cursor.col - compl_col;
if (off < 0)
return 0;
return off;
}
/*
* Append one character to the match leader. May reduce the number of
* matches.
@@ -3621,10 +3675,9 @@ ins_compl_prep(c)
{
ins_compl_delete();
if (compl_leader != NULL)
ins_bytes(compl_leader + curwin->w_cursor.col - compl_col);
ins_bytes(compl_leader + ins_compl_len());
else if (compl_first_match != NULL)
ins_bytes(compl_orig_text
+ curwin->w_cursor.col - compl_col);
ins_bytes(compl_orig_text + ins_compl_len());
retval = TRUE;
}
@@ -4256,7 +4309,7 @@ ins_compl_delete()
static void
ins_compl_insert()
{
ins_bytes(compl_shown_match->cp_str + curwin->w_cursor.col - compl_col);
ins_bytes(compl_shown_match->cp_str + ins_compl_len());
if (compl_shown_match->cp_flags & ORIGINAL_TEXT)
compl_used_match = FALSE;
else
@@ -4425,7 +4478,7 @@ ins_compl_next(allow_get_expansion, count, insert_match)
if (!compl_get_longest || compl_used_match)
ins_compl_insert();
else
ins_bytes(compl_leader + curwin->w_cursor.col - compl_col);
ins_bytes(compl_leader + ins_compl_len());
}
else
compl_used_match = FALSE;
@@ -7123,9 +7176,12 @@ replace_flush()
* cc == 0: character was inserted, delete it
* cc > 0: character was replaced, put cc (first byte of original char) back
* and check for more characters to be put back
* When "limit_col" is >= 0, don't delete before this column. Matters when
* using composing characters, use del_char_after_col() instead of del_char().
*/
static void
replace_do_bs()
replace_do_bs(limit_col)
int limit_col;
{
int cc;
#ifdef FEAT_VREPLACE
@@ -7153,7 +7209,7 @@ replace_do_bs()
#ifdef FEAT_MBYTE
if (has_mbyte)
{
del_char(FALSE);
(void)del_char_after_col(limit_col);
# ifdef FEAT_VREPLACE
if (State & VREPLACE_FLAG)
orig_len = (int)STRLEN(ml_get_cursor());
@@ -7203,7 +7259,7 @@ replace_do_bs()
changed_bytes(curwin->w_cursor.lnum, curwin->w_cursor.col);
}
else if (cc == 0)
(void)del_char(FALSE);
(void)del_char_after_col(limit_col);
}
#ifdef FEAT_CINDENT
@@ -8239,7 +8295,7 @@ ins_bs_one(vcolp)
* Replace mode */
if (curwin->w_cursor.lnum != Insstart.lnum
|| curwin->w_cursor.col >= Insstart.col)
replace_do_bs();
replace_do_bs(-1);
}
else
(void)del_char(FALSE);
@@ -8556,7 +8612,7 @@ ins_bs(c, mode, inserted_space_p)
break;
}
if (State & REPLACE_FLAG)
replace_do_bs();
replace_do_bs(-1);
else
{
#ifdef FEAT_MBYTE

View File

@@ -6106,12 +6106,24 @@ vim_rename(from, to)
#ifdef HAVE_ACL
vim_acl_T acl; /* ACL from original file */
#endif
#if defined(UNIX) || defined(CASE_INSENSITIVE_FILENAME)
int use_tmp_file = FALSE;
#endif
/*
* When the names are identical, there is nothing to do.
* When the names are identical, there is nothing to do. When they refer
* to the same file (ignoring case and slash/backslash differences) but
* the file name differs we need to go through a temp file.
*/
if (fnamecmp(from, to) == 0)
return 0;
{
#ifdef CASE_INSENSITIVE_FILENAME
if (STRCMP(gettail(from), gettail(to)) != 0)
use_tmp_file = TRUE;
else
#endif
return 0;
}
/*
* Fail if the "from" file doesn't exist. Avoids that "to" is deleted.
@@ -6119,6 +6131,55 @@ vim_rename(from, to)
if (mch_stat((char *)from, &st) < 0)
return -1;
#ifdef UNIX
{
struct stat st_to;
/* It's possible for the source and destination to be the same file.
* This happens when "from" and "to" differ in case and are on a FAT32
* filesystem. In that case go through a temp file name. */
if (mch_stat((char *)to, &st_to) >= 0
&& st.st_dev == st_to.st_dev
&& st.st_ino == st_to.st_ino)
use_tmp_file = TRUE;
}
#endif
#if defined(UNIX) || defined(CASE_INSENSITIVE_FILENAME)
if (use_tmp_file)
{
char tempname[MAXPATHL + 1];
/*
* Find a name that doesn't exist and is in the same directory.
* Rename "from" to "tempname" and then rename "tempname" to "to".
*/
if (STRLEN(from) >= MAXPATHL - 5)
return -1;
STRCPY(tempname, from);
for (n = 123; n < 99999; ++n)
{
sprintf((char *)gettail((char_u *)tempname), "%d", n);
if (mch_stat(tempname, &st) < 0)
{
if (mch_rename((char *)from, tempname) == 0)
{
if (mch_rename(tempname, (char *)to) == 0)
return 0;
/* Strange, the second step failed. Try moving the
* file back and return failure. */
mch_rename(tempname, (char *)from);
return -1;
}
/* If it fails for one temp name it will most likely fail
* for any temp name, give up. */
return -1;
}
}
return -1;
}
#endif
/*
* Delete the "to" file, this is required on some systems to make the
* mch_rename() work, on other systems it makes sure that we don't have

View File

@@ -740,7 +740,7 @@ deleteFold(start, end, recursive, had_visual)
garray_T *found_ga;
fold_T *found_fp = NULL;
linenr_T found_off = 0;
int use_level = FALSE;
int use_level;
int maybe_small = FALSE;
int level = 0;
linenr_T lnum = start;
@@ -757,6 +757,7 @@ deleteFold(start, end, recursive, had_visual)
gap = &curwin->w_folds;
found_ga = NULL;
lnum_off = 0;
use_level = FALSE;
for (;;)
{
if (!foldFind(gap, lnum - lnum_off, &fp))
@@ -783,20 +784,21 @@ deleteFold(start, end, recursive, had_visual)
else
{
lnum = found_fp->fd_top + found_fp->fd_len + found_off;
did_one = TRUE;
if (foldmethodIsManual(curwin))
deleteFoldEntry(found_ga,
(int)(found_fp - (fold_T *)found_ga->ga_data), recursive);
else
{
if (found_fp->fd_top + found_off < first_lnum)
first_lnum = found_fp->fd_top;
if (lnum > last_lnum)
if (first_lnum > found_fp->fd_top + found_off)
first_lnum = found_fp->fd_top + found_off;
if (last_lnum < lnum)
last_lnum = lnum;
parseMarker(curwin);
if (!did_one)
parseMarker(curwin);
deleteFoldMarkers(found_fp, recursive, found_off);
}
did_one = TRUE;
/* redraw window */
changed_window_setting();
@@ -811,6 +813,10 @@ deleteFold(start, end, recursive, had_visual)
redraw_curbuf_later(INVERTED);
#endif
}
else
/* Deleting markers may make cursor column invalid. */
check_cursor_col();
if (last_lnum > 0)
changed_lines(first_lnum, (colnr_T)0, last_lnum, 0L);
}

View File

@@ -1340,7 +1340,6 @@ EXTERN garray_T error_ga
#ifdef FEAT_NETBEANS_INTG
EXTERN char *netbeansArg INIT(= NULL); /* the -nb[:host:port:passwd] arg */
EXTERN int netbeansCloseFile INIT(= 0); /* send killed if != 0 */
EXTERN int netbeansFireChanges INIT(= 1); /* send buffer changes if != 0 */
EXTERN int netbeansForcedQuit INIT(= 0);/* don't write modified files */
EXTERN int netbeansReadFile INIT(= 1); /* OK to read from disk if != 0 */

View File

@@ -2921,44 +2921,26 @@ netbeans_file_opened(buf_T *bufp)
}
/*
* Tell netbeans a file was closed.
* Tell netbeans that a file was deleted or wiped out.
*/
void
netbeans_file_closed(buf_T *bufp)
netbeans_file_killed(buf_T *bufp)
{
int bufno = nb_getbufno(bufp);
nbbuf_T *nbbuf = nb_get_buf(bufno);
char buffer[2*MAXPATHL];
if (!haveConnection || bufno < 0)
if (!haveConnection || bufno == -1)
return;
if (!netbeansCloseFile)
{
nbdebug(("Ignoring file_closed for %s. File was closed from IDE\n",
bufp->b_ffname));
return;
}
nbdebug(("netbeans_file_closed:\n"));
nbdebug((" Closing bufno: %d", bufno));
if (curbuf != NULL && curbuf != bufp)
{
nbdebug((" Curbuf bufno: %d\n", nb_getbufno(curbuf)));
}
else if (curbuf == bufp)
{
nbdebug((" curbuf == bufp\n"));
}
if (bufno <= 0)
return;
nbdebug(("netbeans_file_killed:\n"));
nbdebug((" Killing bufno: %d", bufno));
sprintf(buffer, "%d:killed=%d\n", bufno, r_cmdno);
nbdebug(("EVT: %s", buffer));
nb_send(buffer, "netbeans_file_closed");
nb_send(buffer, "netbeans_file_killed");
if (nbbuf != NULL)
nbbuf->bufp = NULL;

View File

@@ -11,7 +11,7 @@ void netbeans_send_disconnect __ARGS((void));
void netbeans_frame_moved __ARGS((int new_x, int new_y));
void netbeans_file_activated __ARGS((buf_T *bufp));
void netbeans_file_opened __ARGS((buf_T *bufp));
void netbeans_file_closed __ARGS((buf_T *bufp));
void netbeans_file_killed __ARGS((buf_T *bufp));
void netbeans_inserted __ARGS((buf_T *bufp, linenr_T linenr, colnr_T col, char_u *txt, int newlen));
void netbeans_removed __ARGS((buf_T *bufp, linenr_T linenr, colnr_T col, long len));
void netbeans_unmodified __ARGS((buf_T *bufp));

View File

@@ -676,6 +676,16 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
80,
/**/
79,
/**/
78,
/**/
77,
/**/
76,
/**/
75,
/**/