Compare commits

...

7 Commits

Author SHA1 Message Date
Bram Moolenaar
f65e5667df updated for version 7.3.596
Problem:    Can't remove all signs for a file or buffer.
Solution:   Support "*" for the sign id. (Christian Brabandt)
2012-07-10 15:18:22 +02:00
Bram Moolenaar
773c1ef81b updated for version 7.3.595
Problem:    The X command server responds slowly
Solution:   Change the loop that waits for replies. (Brian Burns)
2012-07-10 14:56:45 +02:00
Bram Moolenaar
52bf469f6f updated for version 7.3.594
Problem:    The X command server doesn't work perfectly. It sends an empty
            reply for as-keys requests.
Solution:   Remove duplicate ga_init2(). Do not send a reply for as-keys
            requests. (Brian Burns)
2012-07-10 14:25:04 +02:00
Bram Moolenaar
77c604d3ff updated for version 7.3.593
Problem:    No easy way to decide if b:browsefilter will work.
Solution:   Add the browsefilter feature.
2012-07-10 13:41:14 +02:00
Bram Moolenaar
6c4b646d84 updated for version 7.3.592
Problem:    Vim on GTK does not support g:browsefilter.
Solution:   Add a GtkFileFilter to the file chooser. (Christian Brabandt)
2012-07-10 13:12:51 +02:00
Bram Moolenaar
8cb8dca2f0 updated for version 7.3.591
Problem:    Can only move to a tab by absolute number.
Solution:   Move a number of tabs to the left or the right. (Lech Lorens)
2012-07-06 18:27:39 +02:00
Bram Moolenaar
0306ac33a5 updated for version 7.3.590
Problem:    The '< and '> marks cannot be set directly.
Solution:   Allow setting '< and '>. (Christian Brabandt)
2012-07-06 17:51:28 +02:00
16 changed files with 265 additions and 91 deletions

View File

@@ -153,8 +153,14 @@ REMOVING SIGNS *:sign-unplace* *E159*
Remove the previously placed sign {id} from file {fname}.
See remark above about {fname} |:sign-fname|.
:sign unplace * file={fname}
Remove all placed signs in file {fname}.
:sign unplace {id} buffer={nr}
Same, but use buffer {nr}.
Remove the previously placed sign {id} from buffer {nr}.
:sign unplace * buffer={nr}
Remove all placed signs in buffer {nr}.
:sign unplace {id}
Remove the previously placed sign {id} from all files it

View File

@@ -173,10 +173,20 @@ Other commands:
REORDERING TAB PAGES:
:tabm[ove] [N] *:tabm* *:tabmove*
:[N]tabm[ove]
Move the current tab page to after tab page N. Use zero to
make the current tab page the first one. Without N the tab
page is made the last one.
:tabm[ove] +[N]
:tabm[ove] -[N]
Move the current tab page N places to the right (with +) or to
the left (with -).
Note that although it is possible to move a tab behind the N-th one by using
:Ntabmove, it is impossible to move it by N places by using :+Ntabmove. For
clarification what +N means in this context see |[range]|.
LOOPING OVER TAB PAGES:

View File

@@ -57,7 +57,6 @@ static void clear_wininfo __ARGS((buf_T *buf));
#if defined(FEAT_SIGNS)
static void insert_sign __ARGS((buf_T *buf, signlist_T *prev, signlist_T *next, int id, linenr_T lnum, int typenr));
static void buf_delete_signs __ARGS((buf_T *buf));
#endif
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
@@ -5537,7 +5536,7 @@ buf_signcount(buf, lnum)
/*
* Delete signs in buffer "buf".
*/
static void
void
buf_delete_signs(buf)
buf_T *buf;
{

View File

@@ -12044,6 +12044,11 @@ f_has(argvars, rettv)
"all_builtin_terms",
# endif
#endif
#if defined(FEAT_BROWSE) && (defined(USE_FILE_CHOOSER) \
|| defined(FEAT_GUI_W32) \
|| defined(FEAT_GUI_MOTIF))
"browsefilter",
#endif
#ifdef FEAT_BYTEOFF
"byte_offset",
#endif

View File

@@ -6997,6 +6997,16 @@ ex_sign(eap)
lnum = atoi((char *)arg);
arg = skiptowhite(arg);
}
else if (STRNCMP(arg, "*", 1) == 0 && idx == SIGNCMD_UNPLACE)
{
if (id != -1)
{
EMSG(_(e_invarg));
return;
}
id = -2;
arg = skiptowhite(arg + 1);
}
else if (STRNCMP(arg, "name=", 5) == 0)
{
arg += 5;
@@ -7033,7 +7043,7 @@ ex_sign(eap)
{
EMSG2(_("E158: Invalid buffer name: %s"), arg);
}
else if (id <= 0)
else if (id <= 0 && !(idx == SIGNCMD_UNPLACE && id == -2))
{
if (lnum >= 0 || sign_name != NULL)
EMSG(_(e_invarg));
@@ -7074,11 +7084,17 @@ ex_sign(eap)
}
else if (idx == SIGNCMD_UNPLACE)
{
/* ":sign unplace {id} file={fname}" */
if (lnum >= 0 || sign_name != NULL)
EMSG(_(e_invarg));
else if (id == -2)
{
/* ":sign unplace * file={fname}" */
redraw_buf_later(buf, NOT_VALID);
buf_delete_signs(buf);
}
else
{
/* ":sign unplace {id} file={fname}" */
lnum = buf_delsign(buf, id);
update_debug_sign(buf, lnum);
}

View File

@@ -944,7 +944,7 @@ EX(CMD_tabfind, "tabfind", ex_splitview,
EX(CMD_tabfirst, "tabfirst", ex_tabnext,
TRLBAR),
EX(CMD_tabmove, "tabmove", ex_tabmove,
RANGE|NOTADR|ZEROR|COUNT|TRLBAR|ZEROR),
RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR),
EX(CMD_tablast, "tablast", ex_tabnext,
TRLBAR),
EX(CMD_tabnext, "tabnext", ex_tabnext,

View File

@@ -7478,7 +7478,42 @@ ex_tabnext(eap)
ex_tabmove(eap)
exarg_T *eap;
{
tabpage_move(eap->addr_count == 0 ? 9999 : (int)eap->line2);
int tab_number = 9999;
if (eap->arg && *eap->arg != NUL)
{
char_u *p = eap->arg;
int relative = 0; /* argument +N/-N means: move N places to the
* right/left relative to the current position. */
if (*eap->arg == '-')
{
relative = -1;
p = eap->arg + 1;
}
else if (*eap->arg == '+')
{
relative = 1;
p = eap->arg + 1;
}
else
p = eap->arg;
if (p == skipdigits(p))
{
/* No numbers as argument. */
eap->errmsg = e_invarg;
return;
}
tab_number = getdigits(&p);
if (relative != 0)
tab_number = tab_number * relative + tabpage_index(curtab) - 1;;
}
else if (eap->addr_count != 0)
tab_number = eap->line2;
tabpage_move(tab_number);
}
/*

View File

@@ -779,9 +779,6 @@ gui_mch_destroy_scrollbar(scrollbar_T *sb)
/*
* Implementation of the file selector related stuff
*/
#if GTK_CHECK_VERSION(2,4,0)
# define USE_FILE_CHOOSER
#endif
#ifndef USE_FILE_CHOOSER
static void
@@ -840,7 +837,7 @@ gui_mch_browse(int saving UNUSED,
char_u *dflt,
char_u *ext UNUSED,
char_u *initdir,
char_u *filter UNUSED)
char_u *filter)
{
#ifdef USE_FILE_CHOOSER
GtkWidget *fc;
@@ -848,6 +845,7 @@ gui_mch_browse(int saving UNUSED,
char_u dirbuf[MAXPATHL];
guint log_handler;
const gchar *domain = "Gtk";
GtkFileFilter *gfilter;
title = CONVERT_TO_UTF8(title);
@@ -879,6 +877,45 @@ gui_mch_browse(int saving UNUSED,
NULL);
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(fc),
(const gchar *)dirbuf);
if (filter != NULL && *filter != NUL)
{
int i = 0;
char_u *patt;
char_u *p = filter;
gfilter = gtk_file_filter_new();
patt = alloc(STRLEN(filter));
while (p != NULL && *p != NUL)
{
if (*p == '\n' || *p == ';' || *p == '\t')
{
STRNCPY(patt, filter, i);
patt[i] = '\0';
if (*p == '\t')
gtk_file_filter_set_name(gfilter, (gchar *)patt);
else
{
gtk_file_filter_add_pattern(gfilter, (gchar *)patt);
if (*p == '\n')
{
gtk_file_chooser_add_filter((GtkFileChooser *)fc,
gfilter);
if (*(p + 1) != NUL)
gfilter = gtk_file_filter_new();
}
}
filter = ++p;
i = 0;
}
else
{
p++;
i++;
}
}
vim_free(patt);
}
if (saving && dflt != NULL && *dflt != NUL)
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(fc), (char *)dflt);
@@ -1304,7 +1341,7 @@ gui_mch_dialog(int type, /* type of dialog */
gtk_widget_show(entry);
/* Make Enter work like pressing OK. */
gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE);
gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE);
text = CONVERT_TO_UTF8(textfield);
gtk_entry_set_text(GTK_ENTRY(entry), (const char *)text);

View File

@@ -572,61 +572,55 @@ ServerWait(dpy, w, endCond, endData, localLoop, seconds)
{
time_t start;
time_t now;
time_t lastChk = 0;
XEvent event;
XPropertyEvent *e = (XPropertyEvent *)&event;
# define SEND_MSEC_POLL 50
#define UI_MSEC_DELAY 50
#define SEND_MSEC_POLL 500
#ifndef HAVE_SELECT
struct pollfd fds;
fds.fd = ConnectionNumber(dpy);
fds.events = POLLIN;
#else
fd_set fds;
struct timeval tv;
tv.tv_sec = 0;
tv.tv_usec = SEND_MSEC_POLL * 1000;
FD_ZERO(&fds);
FD_SET(ConnectionNumber(dpy), &fds);
#endif
time(&start);
while (endCond(endData) == 0)
while (TRUE)
{
while (XCheckWindowEvent(dpy, commWindow, PropertyChangeMask, &event))
serverEventProc(dpy, &event);
if (endCond(endData) != 0)
break;
if (!WindowValid(dpy, w))
break;
time(&now);
if (seconds >= 0 && (now - start) >= seconds)
break;
if (now != lastChk)
{
lastChk = now;
if (!WindowValid(dpy, w))
break;
/*
* Sometimes the PropertyChange event doesn't come.
* This can be seen in eg: vim -c 'echo remote_expr("gvim", "3+2")'
*/
serverEventProc(dpy, NULL);
}
/* Just look out for the answer without calling back into Vim */
if (localLoop)
{
/* Just look out for the answer without calling back into Vim */
#ifndef HAVE_SELECT
struct pollfd fds;
fds.fd = ConnectionNumber(dpy);
fds.events = POLLIN;
if (poll(&fds, 1, SEND_MSEC_POLL) < 0)
break;
#else
fd_set fds;
struct timeval tv;
tv.tv_sec = 0;
tv.tv_usec = SEND_MSEC_POLL * 1000;
FD_ZERO(&fds);
FD_SET(ConnectionNumber(dpy), &fds);
if (select(ConnectionNumber(dpy) + 1, &fds, NULL, NULL, &tv) < 0)
if (select(FD_SETSIZE, &fds, NULL, NULL, &tv) < 0)
break;
#endif
while (XEventsQueued(dpy, QueuedAfterReading) > 0)
{
XNextEvent(dpy, &event);
if (event.type == PropertyNotify && e->window == commWindow)
serverEventProc(dpy, &event);
}
}
else
{
if (got_int)
break;
ui_delay((long)SEND_MSEC_POLL, TRUE);
ui_delay((long)UI_MSEC_DELAY, TRUE);
ui_breakcheck();
}
}
@@ -655,7 +649,6 @@ serverGetVimNames(dpy)
if (SendInit(dpy) < 0)
return NULL;
}
ga_init2(&ga, 1, 100);
/*
* Read the registry property.
@@ -1198,9 +1191,8 @@ serverEventProc(dpy, eventPtr)
if ((*p == 'c' || *p == 'k') && (p[1] == 0))
{
Window resWindow;
char_u *name, *script, *serial, *end, *res;
char_u *name, *script, *serial, *end;
Bool asKeys = *p == 'k';
garray_T reply;
char_u *enc;
/*
@@ -1256,50 +1248,52 @@ serverEventProc(dpy, eventPtr)
if (script == NULL || name == NULL)
continue;
/*
* Initialize the result property, so that we're ready at any
* time if we need to return an error.
*/
if (resWindow != None)
{
ga_init2(&reply, 1, 100);
if (serverName != NULL && STRICMP(name, serverName) == 0)
{
script = serverConvert(enc, script, &tofree);
if (asKeys)
server_to_input_buf(script);
else
{
char_u *res;
res = eval_client_expr_to_string(script);
if (resWindow != None)
{
garray_T reply;
/* Initialize the result property. */
ga_init2(&reply, 1, 100);
#ifdef FEAT_MBYTE
ga_grow(&reply, 50 + STRLEN(p_enc));
sprintf(reply.ga_data, "%cr%c-E %s%c-s %s%c-r ",
ga_grow(&reply, 50 + STRLEN(p_enc));
sprintf(reply.ga_data, "%cr%c-E %s%c-s %s%c-r ",
0, 0, p_enc, 0, serial, 0);
reply.ga_len = 14 + STRLEN(p_enc) + STRLEN(serial);
reply.ga_len = 14 + STRLEN(p_enc) + STRLEN(serial);
#else
ga_grow(&reply, 50);
sprintf(reply.ga_data, "%cr%c-s %s%c-r ", 0, 0, serial, 0);
reply.ga_len = 10 + STRLEN(serial);
ga_grow(&reply, 50);
sprintf(reply.ga_data, "%cr%c-s %s%c-r ",
0, 0, serial, 0);
reply.ga_len = 10 + STRLEN(serial);
#endif
}
res = NULL;
if (serverName != NULL && STRICMP(name, serverName) == 0)
{
script = serverConvert(enc, script, &tofree);
if (asKeys)
server_to_input_buf(script);
else
res = eval_client_expr_to_string(script);
vim_free(tofree);
}
if (resWindow != None)
{
if (res != NULL)
ga_concat(&reply, res);
else if (asKeys == 0)
{
ga_concat(&reply, (char_u *)_(e_invexprmsg));
ga_append(&reply, 0);
ga_concat(&reply, (char_u *)"-c 1");
}
ga_append(&reply, NUL);
(void)AppendPropCarefully(dpy, resWindow, commProperty,
reply.ga_data, reply.ga_len);
ga_clear(&reply);
}
vim_free(res);
/* Evaluate the expression and return the result. */
if (res != NULL)
ga_concat(&reply, res);
else
{
ga_concat(&reply, (char_u *)_(e_invexprmsg));
ga_append(&reply, 0);
ga_concat(&reply, (char_u *)"-c 1");
}
ga_append(&reply, NUL);
(void)AppendPropCarefully(dpy, resWindow, commProperty,
reply.ga_data, reply.ga_len);
ga_clear(&reply);
}
vim_free(res);
}
vim_free(tofree);
}
}
else if (*p == 'r' && p[1] == 0)
{

View File

@@ -98,6 +98,19 @@ setmark_pos(c, pos, fnum)
return OK;
}
#ifdef FEAT_VISUAL
if (c == '<')
{
curbuf->b_visual.vi_start = *pos;
return OK;
}
if (c == '>')
{
curbuf->b_visual.vi_end = *pos;
return OK;
}
#endif
#ifndef EBCDIC
if (c > 'z') /* some islower() and isupper() cannot handle
characters above 127 */

View File

@@ -60,6 +60,7 @@ int buf_findsign __ARGS((buf_T *buf, int id));
int buf_findsign_id __ARGS((buf_T *buf, linenr_T lnum));
int buf_findsigntype_id __ARGS((buf_T *buf, linenr_T lnum, int typenr));
int buf_signcount __ARGS((buf_T *buf, linenr_T lnum));
void buf_delete_signs __ARGS((buf_T *buf));
void buf_delete_all_signs __ARGS((void));
void sign_list_placed __ARGS((buf_T *rbuf));
void sign_mark_adjust __ARGS((linenr_T line1, linenr_T line2, long amount, long amount_after));

View File

@@ -93,6 +93,34 @@ STARTTEST
:endif
:"
:"
:for i in range(9) | tabnew | endfor
1gt
Go=tabpagenr()

:tabmove 5
i=tabpagenr()

:tabmove -2
i=tabpagenr()

:tabmove +4
i=tabpagenr()

:tabmove
i=tabpagenr()

:tabmove -20
i=tabpagenr()

:tabmove +20
i=tabpagenr()

:3tabmove
i=tabpagenr()

View File

@@ -8,3 +8,13 @@ settabvar: pass
tab drop 1: pass
tab drop 2: pass
tab drop 3: pass
1
6
4
8
10
1
10
4
6
E474 caught.

View File

@@ -714,6 +714,20 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
596,
/**/
595,
/**/
594,
/**/
593,
/**/
592,
/**/
591,
/**/
590,
/**/
589,
/**/

View File

@@ -2125,6 +2125,12 @@ typedef int VimClipboard; /* This is required for the prototypes. */
# endif
#endif
#if defined(FEAT_BROWSE) && defined(GTK_CHECK_VERSION)
# if GTK_CHECK_VERSION(2,4,0)
# define USE_FILE_CHOOSER
# endif
#endif
#ifndef FEAT_NETBEANS_INTG
# undef NBDEBUG
#endif

View File

@@ -3929,7 +3929,7 @@ tabpage_move(nr)
}
/* Re-insert it at the specified position. */
if (n == 0)
if (n <= 0)
{
curtab->tp_next = first_tabpage;
first_tabpage = curtab;