mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-01 09:41:44 +02:00
Merge branch 'master' of git://git.code.sf.net/p/zsh/code
Conflicts: ChangeLog
This commit is contained in:
commit
8d3d34cfa4
6 changed files with 62 additions and 4 deletions
15
ChangeLog
15
ChangeLog
|
@ -1,9 +1,22 @@
|
|||
2014-01-28 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||
|
||||
* 32303: Src/Zle/compcore.c, Completion/Zsh/Type/_parameters,
|
||||
Completion/Zsh/Context/_brace_parameter: allow completion
|
||||
of modifiers for parameters in a fairly simplistic way.
|
||||
|
||||
2014-01-28 Peter Stephenson <p.stephenson@samsung.com>
|
||||
|
||||
* 32308 (slightly modified to use "a" as the vi command at start
|
||||
of line): Src/Zle/zle_main.c, Src/Zle/zle_vi.c: improve
|
||||
initialising of vi mode change when entering viins at start of
|
||||
editing.
|
||||
|
||||
2014-01-27 Barton E. Schaefer <schaefer@zsh.org>
|
||||
|
||||
* users/18368: Completion/Unix/Command/_git: in __git_files,
|
||||
retry ls-files if nothing matched the prefix pattern, to give
|
||||
_multi_parts a shot at the whole file list. Restores partial
|
||||
path completion inadvertently removed by 31159.
|
||||
path completion inadvertently removed by 31159.
|
||||
|
||||
2014-01-27 Peter Stephenson <p.stephenson@samsung.com>
|
||||
|
||||
|
|
|
@ -185,6 +185,9 @@ if [[ $PREFIX = *'${('[^\)]# ]]; then
|
|||
)
|
||||
_describe -t flags "parameter flag" flags -Q -S ''
|
||||
return
|
||||
elif compset -P '*:'; then
|
||||
_history_modifiers p
|
||||
return
|
||||
fi
|
||||
|
||||
_parameters -e
|
||||
|
|
|
@ -8,6 +8,11 @@
|
|||
|
||||
local expl pattern fakes faked tmp pfilt
|
||||
|
||||
if compset -P '*:'; then
|
||||
_history_modifiers p
|
||||
return
|
||||
fi
|
||||
|
||||
pattern=(-g \*)
|
||||
zparseopts -D -K -E g:=pattern
|
||||
|
||||
|
|
|
@ -1260,6 +1260,20 @@ check_param(char *s, int set, int test)
|
|||
ispar = (br >= 2 ? 2 : 1);
|
||||
b[we-wb] = '\0';
|
||||
return b;
|
||||
} else if (offs > e - s && *e == ':') {
|
||||
/*
|
||||
* Guess whether we are in modifiers.
|
||||
* If the name is followed by a : and the stuff after
|
||||
* that is either colons or alphanumerics we probably are.
|
||||
* This is a very rough guess.
|
||||
*/
|
||||
char *offsptr = s + offs;
|
||||
for (; e < offsptr; e++) {
|
||||
if (*e != ':' && !ialnum(*e))
|
||||
break;
|
||||
}
|
||||
ispar = (br >= 2 ? 2 : 1);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
|
|
|
@ -1204,7 +1204,7 @@ zleread(char **lp, char **rp, int flags, int context, char *init, char *finish)
|
|||
* no user operation to indicate this.
|
||||
*/
|
||||
if (openkeymap("main") == openkeymap("viins"))
|
||||
viinsert(NULL);
|
||||
viinsert_init();
|
||||
selectlocalmap(NULL);
|
||||
fixsuffix();
|
||||
if ((s = getlinknode(bufstack))) {
|
||||
|
|
|
@ -67,6 +67,13 @@ int viinsbegin;
|
|||
static struct modifier lastmod;
|
||||
static int inrepeat, vichgrepeat;
|
||||
|
||||
/**
|
||||
* im: >= 0: is an insertmode
|
||||
* -1: skip setting insert mode
|
||||
* -2: entering viins at start of editing from clean --- don't use
|
||||
* inrepeat or lastchar, synthesise an i to enter insert mode.
|
||||
*/
|
||||
|
||||
/**/
|
||||
static void
|
||||
startvichange(int im)
|
||||
|
@ -75,7 +82,7 @@ startvichange(int im)
|
|||
insmode = im;
|
||||
vichgflag = 1;
|
||||
}
|
||||
if (inrepeat) {
|
||||
if (inrepeat && im != -2) {
|
||||
zmod = lastmod;
|
||||
inrepeat = vichgflag = 0;
|
||||
vichgrepeat = 1;
|
||||
|
@ -84,7 +91,11 @@ startvichange(int im)
|
|||
if (vichgbuf)
|
||||
free(vichgbuf);
|
||||
vichgbuf = (char *)zalloc(vichgbufsz = 16);
|
||||
vichgbuf[0] = lastchar;
|
||||
if (im == -2) {
|
||||
vichgbuf[0] = 'a';
|
||||
} else {
|
||||
vichgbuf[0] = lastchar;
|
||||
}
|
||||
vichgbufptr = 1;
|
||||
vichgrepeat = 0;
|
||||
}
|
||||
|
@ -303,6 +314,18 @@ viinsert(UNUSED(char **args))
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Go to vi insert mode when we first start the line editor.
|
||||
* Iniialises some other stuff.
|
||||
*/
|
||||
|
||||
/**/
|
||||
void
|
||||
viinsert_init(void)
|
||||
{
|
||||
startvitext(-2);
|
||||
}
|
||||
|
||||
/**/
|
||||
int
|
||||
viinsertbol(UNUSED(char **args))
|
||||
|
|
Loading…
Reference in a new issue