Permalink
Browse files

Support completion for ":find". (Nazri Ramliy)

Cleanup white space.

--HG--
branch : vim73
  • Loading branch information...
1 parent 74a0f28 commit 6a69fb8ff758577139e35a98f8c3cf95b6e524b9 @brammool brammool committed Jul 14, 2010
Showing with 440 additions and 217 deletions.
  1. +0 −1 runtime/doc/todo.txt
  2. +3 −2 src/Make_mvc.mak
  3. +4 −4 src/blowfish.c
  4. +73 −73 src/dosinst.c
  5. +8 −8 src/ex_cmds.c
  6. +5 −0 src/ex_docmd.c
  7. +6 −1 src/ex_getln.c
  8. +2 −2 src/fileio.c
  9. +1 −1 src/getchar.c
  10. +1 −1 src/gui.c
  11. +2 −2 src/gui_gtk_x11.c
  12. +4 −4 src/gui_w32.c
  13. +3 −3 src/gui_w48.c
  14. +1 −1 src/gui_x11.c
  15. +4 −4 src/gui_xmebw.c
  16. +2 −2 src/if_python.c
  17. +1 −1 src/mbyte.c
  18. +16 −16 src/menu.c
  19. +1 −1 src/message.c
  20. +212 −1 src/misc1.c
  21. +1 −1 src/ops.c
  22. +2 −2 src/option.c
  23. +4 −4 src/os_mswin.c
  24. +2 −2 src/os_unix.c
  25. +2 −2 src/os_win32.c
  26. +3 −3 src/search.c
  27. +1 −1 src/sha256.c
  28. +1 −1 src/syntax.c
  29. +3 −3 src/tag.c
  30. +1 −1 src/ui.c
  31. +69 −69 src/undo.c
  32. +2 −0 src/vim.h
View
@@ -1098,7 +1098,6 @@ Vim 7.3:
- Conceal feature: no update when moving to another window. (Dominique Pelle,
2010 Jul 5) Vince will look into it.
Patches to possibly include:
-- Win32: patch for better font scaling. (George Reilly, 2009 Mar 26)
- Patch for completion of ":find" arguments. (Nazri Ramliy, 2009 Feb 22, 26)
8 For ":find" and ":sfind" expand files found in 'path'.
Update 2009 Mar 28.
View
@@ -1057,8 +1057,9 @@ $(OUTDIR)/window.obj: $(OUTDIR) window.c $(INCL)
$(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
$(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c
-$(OUTDIR)/vim.res: $(OUTDIR) vim.rc gvim.exe.mnf version.h tools.bmp tearoff.bmp \
- vim.ico vim_error.ico vim_alert.ico vim_info.ico vim_quest.ico
+$(OUTDIR)/vim.res: $(OUTDIR) vim.rc gvim.exe.mnf version.h tools.bmp \
+ tearoff.bmp vim.ico vim_error.ico \
+ vim_alert.ico vim_info.ico vim_quest.ico
$(RC) /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
iid_ole.c if_ole.h vim.tlb: if_ole.idl
View
@@ -421,7 +421,7 @@ bf_key_init(password, salt, salt_len)
* See http://en.wikipedia.org/wiki/Key_strengthening. */
key = sha256_key(password, salt, salt_len);
for (i = 0; i < 1000; i++)
- key = sha256_key(key, salt, salt_len);
+ key = sha256_key(key, salt, salt_len);
/* Convert the key from 64 hex chars to 32 binary chars. */
keylen = (int)STRLEN(key) / 2;
@@ -432,8 +432,8 @@ bf_key_init(password, salt, salt_len)
}
for (i = 0; i < keylen; i++)
{
- sscanf((char *)&key[i * 2], "%2x", &j);
- key[i] = j;
+ sscanf((char *)&key[i * 2], "%2x", &j);
+ key[i] = j;
}
mch_memmove(sbx, sbi, 4 * 4 * 256);
@@ -534,7 +534,7 @@ bf_self_test()
for (i = 0; i < bn; i++)
{
bf_key_init((char_u *)(bf_test_data[i].password),
- bf_test_data[i].salt,
+ bf_test_data[i].salt,
(int)STRLEN(bf_test_data[i].salt));
if (!bf_check_tables(pax, sbx, bf_test_data[i].keysum))
err++;
View
@@ -1370,10 +1370,10 @@ reg_create_key(
*phKey = NULL;
return RegCreateKeyEx(
- root, subkey,
- 0, NULL, REG_OPTION_NON_VOLATILE,
- KEY_WOW64_64KEY | KEY_WRITE,
- NULL, phKey, &disp);
+ root, subkey,
+ 0, NULL, REG_OPTION_NON_VOLATILE,
+ KEY_WOW64_64KEY | KEY_WRITE,
+ NULL, phKey, &disp);
}
static LONG
@@ -1398,8 +1398,8 @@ reg_create_key_and_value(
if (ERROR_SUCCESS == lRet)
{
- lRet = reg_set_string_value(hKey, value_name, data);
- RegCloseKey(hKey);
+ lRet = reg_set_string_value(hKey, value_name, data);
+ RegCloseKey(hKey);
}
return lRet;
}
@@ -1419,13 +1419,13 @@ register_inproc_server(
lRet = reg_create_key_and_value(hRootKey, subkey, NULL, extname);
if (ERROR_SUCCESS == lRet)
{
- sprintf(subkey, "CLSID\\%s\\InProcServer32", clsid);
- lRet = reg_create_key_and_value(hRootKey, subkey, NULL, module);
- if (ERROR_SUCCESS == lRet)
- {
- lRet = reg_create_key_and_value(hRootKey, subkey,
+ sprintf(subkey, "CLSID\\%s\\InProcServer32", clsid);
+ lRet = reg_create_key_and_value(hRootKey, subkey, NULL, module);
+ if (ERROR_SUCCESS == lRet)
+ {
+ lRet = reg_create_key_and_value(hRootKey, subkey,
"ThreadingModel", threading_model);
- }
+ }
}
return lRet;
}
@@ -1438,27 +1438,27 @@ register_shellex(
const char *exe_path)
{
LONG lRet = reg_create_key_and_value(
- hRootKey,
- "*\\shellex\\ContextMenuHandlers\\gvim",
- NULL,
- clsid);
+ hRootKey,
+ "*\\shellex\\ContextMenuHandlers\\gvim",
+ NULL,
+ clsid);
if (ERROR_SUCCESS == lRet)
{
- lRet = reg_create_key_and_value(
- HKEY_LOCAL_MACHINE,
- "Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved",
- clsid,
- name);
-
- if (ERROR_SUCCESS == lRet)
- {
- lRet = reg_create_key_and_value(
- HKEY_LOCAL_MACHINE,
- "Software\\Vim\\Gvim",
- "path",
- exe_path);
- }
+ lRet = reg_create_key_and_value(
+ HKEY_LOCAL_MACHINE,
+ "Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved",
+ clsid,
+ name);
+
+ if (ERROR_SUCCESS == lRet)
+ {
+ lRet = reg_create_key_and_value(
+ HKEY_LOCAL_MACHINE,
+ "Software\\Vim\\Gvim",
+ "path",
+ exe_path);
+ }
}
return lRet;
}
@@ -1469,25 +1469,25 @@ register_openwith(
const char *exe_path)
{
LONG lRet = reg_create_key_and_value(
- hRootKey,
- "Applications\\gvim.exe\\shell\\edit\\command",
- NULL,
- exe_path);
+ hRootKey,
+ "Applications\\gvim.exe\\shell\\edit\\command",
+ NULL,
+ exe_path);
if (ERROR_SUCCESS == lRet)
{
- int i;
- static const char *openwith[] = {
- ".htm\\OpenWithList\\gvim.exe",
- ".vim\\OpenWithList\\gvim.exe",
- "*\\OpenWithList\\gvim.exe",
- };
+ int i;
+ static const char *openwith[] = {
+ ".htm\\OpenWithList\\gvim.exe",
+ ".vim\\OpenWithList\\gvim.exe",
+ "*\\OpenWithList\\gvim.exe",
+ };
- for (i = 0; ERROR_SUCCESS == lRet
+ for (i = 0; ERROR_SUCCESS == lRet
&& i < sizeof(openwith) / sizeof(openwith[0]); i++)
- {
- lRet = reg_create_key_and_value(hRootKey, openwith[i], NULL, "");
- }
+ {
+ lRet = reg_create_key_and_value(hRootKey, openwith[i], NULL, "");
+ }
}
return lRet;
@@ -1504,7 +1504,7 @@ register_uninstall(
"DisplayName", display_name);
if (ERROR_SUCCESS == lRet)
- lRet = reg_create_key_and_value(hRootKey, appname,
+ lRet = reg_create_key_and_value(hRootKey, appname,
"UninstallString", uninstall_string);
return lRet;
}
@@ -1521,47 +1521,47 @@ register_uninstall(
install_registry(void)
{
#ifdef WIN3264
- LONG lRet = ERROR_SUCCESS;
+ LONG lRet = ERROR_SUCCESS;
const char *vim_ext_ThreadingModel = "Apartment";
const char *vim_ext_name = "Vim Shell Extension";
const char *vim_ext_clsid = "{51EEE242-AD87-11d3-9C1E-0090278BBD99}";
char buf[BUFSIZE];
char vim_exe_path[BUFSIZE];
- char display_name[BUFSIZE];
- char uninstall_string[BUFSIZE];
+ char display_name[BUFSIZE];
+ char uninstall_string[BUFSIZE];
sprintf(vim_exe_path, "%s\\gvim.exe", installdir);
if (install_popup)
{
- char bufg[BUFSIZE];
- struct stat st;
+ char bufg[BUFSIZE];
+ struct stat st;
- if (stat("gvimext.dll", &st) >= 0)
- sprintf(bufg, "%s\\gvimext.dll", installdir);
- else
- /* gvimext.dll is in gvimext subdir */
- sprintf(bufg, "%s\\gvimext\\gvimext.dll", installdir);
+ if (stat("gvimext.dll", &st) >= 0)
+ sprintf(bufg, "%s\\gvimext.dll", installdir);
+ else
+ /* gvimext.dll is in gvimext subdir */
+ sprintf(bufg, "%s\\gvimext\\gvimext.dll", installdir);
- printf("Creating \"Edit with Vim\" popup menu entry\n");
+ printf("Creating \"Edit with Vim\" popup menu entry\n");
- lRet = register_inproc_server(
- HKEY_CLASSES_ROOT, vim_ext_clsid, vim_ext_name,
+ lRet = register_inproc_server(
+ HKEY_CLASSES_ROOT, vim_ext_clsid, vim_ext_name,
bufg, vim_ext_ThreadingModel);
- if (ERROR_SUCCESS != lRet)
+ if (ERROR_SUCCESS != lRet)
return FAIL;
- lRet = register_shellex(
- HKEY_CLASSES_ROOT, vim_ext_clsid, vim_ext_name, vim_exe_path);
- if (ERROR_SUCCESS != lRet)
+ lRet = register_shellex(
+ HKEY_CLASSES_ROOT, vim_ext_clsid, vim_ext_name, vim_exe_path);
+ if (ERROR_SUCCESS != lRet)
return FAIL;
}
if (install_openwith)
{
- printf("Creating \"Open with ...\" list entry\n");
+ printf("Creating \"Open with ...\" list entry\n");
- lRet = register_openwith(HKEY_CLASSES_ROOT, vim_exe_path);
- if (ERROR_SUCCESS != lRet)
+ lRet = register_openwith(HKEY_CLASSES_ROOT, vim_exe_path);
+ if (ERROR_SUCCESS != lRet)
return FAIL;
}
@@ -1570,20 +1570,20 @@ install_registry(void)
/* For the NSIS installer use the generated uninstaller. */
if (interactive)
{
- sprintf(display_name, "Vim " VIM_VERSION_SHORT);
- sprintf(uninstall_string, "%suninstal.exe", buf);
+ sprintf(display_name, "Vim " VIM_VERSION_SHORT);
+ sprintf(uninstall_string, "%suninstal.exe", buf);
}
else
{
- sprintf(display_name, "Vim " VIM_VERSION_SHORT " (self-installing)");
- sprintf(uninstall_string, "%suninstall-gui.exe", buf);
+ sprintf(display_name, "Vim " VIM_VERSION_SHORT " (self-installing)");
+ sprintf(uninstall_string, "%suninstall-gui.exe", buf);
}
lRet = register_uninstall(
- HKEY_LOCAL_MACHINE,
- "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Vim " VIM_VERSION_SHORT,
- display_name,
- uninstall_string);
+ HKEY_LOCAL_MACHINE,
+ "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Vim " VIM_VERSION_SHORT,
+ display_name,
+ uninstall_string);
if (ERROR_SUCCESS != lRet)
return FAIL;
#endif /* WIN3264 */
View
@@ -3099,8 +3099,8 @@ getfile(fnum, ffname, sfname, setpm, lnum, forceit)
* ECMD_FORCEIT: ! used for Ex command
* ECMD_ADDBUF: don't edit, just add to buffer list
* oldwin: Should be "curwin" when editing a new buffer in the current
- * window, NULL when splitting the window first. When not NULL info
- * of the previous buffer for "oldwin" is stored.
+ * window, NULL when splitting the window first. When not NULL info
+ * of the previous buffer for "oldwin" is stored.
*
* return FAIL for failure, OK otherwise
*/
@@ -7232,8 +7232,8 @@ set_context_in_sign_cmd(xp, arg)
cmd_idx = sign_cmd_idx(arg, end_subcmd);
/* :sign {subcmd} {subcmd_args}
- * |
- * begin_subcmd_args */
+ * |
+ * begin_subcmd_args */
begin_subcmd_args = skipwhite(end_subcmd);
p = skiptowhite(begin_subcmd_args);
if (*p == NUL)
@@ -7261,8 +7261,8 @@ set_context_in_sign_cmd(xp, arg)
/* expand last argument of subcmd */
/* :sign define {name} {args}...
- * |
- * p */
+ * |
+ * p */
/* Loop until reaching last argument. */
do
@@ -7275,8 +7275,8 @@ set_context_in_sign_cmd(xp, arg)
p = vim_strchr(last, '=');
/* :sign define {name} {args}... {last}=
- * | |
- * last p */
+ * | |
+ * last p */
if (p == NUL)
{
/* Expand last argument name (before equal sign). */
View
@@ -3442,6 +3442,11 @@ set_one_cmd_context(xp, buff)
*/
switch (ea.cmdidx)
{
+ case CMD_find:
+ case CMD_sfind:
+ case CMD_tabfind:
+ xp->xp_context = EXPAND_FILES_IN_PATH;
+ break;
case CMD_cd:
case CMD_chdir:
case CMD_lcd:
View
@@ -4099,6 +4099,7 @@ addstar(fname, len, context)
int ends_in_star;
if (context != EXPAND_FILES
+ && context != EXPAND_FILES_IN_PATH
&& context != EXPAND_SHELLCMD
&& context != EXPAND_DIRECTORIES)
{
@@ -4423,7 +4424,9 @@ ExpandFromContext(xp, pat, num_file, file, options)
if (options & WILD_SILENT)
flags |= EW_SILENT;
- if (xp->xp_context == EXPAND_FILES || xp->xp_context == EXPAND_DIRECTORIES)
+ if (xp->xp_context == EXPAND_FILES
+ || xp->xp_context == EXPAND_DIRECTORIES
+ || xp->xp_context == EXPAND_FILES_IN_PATH)
{
/*
* Expand file or directory names.
@@ -4453,6 +4456,8 @@ ExpandFromContext(xp, pat, num_file, file, options)
if (xp->xp_context == EXPAND_FILES)
flags |= EW_FILE;
+ else if (xp->xp_context == EXPAND_FILES_IN_PATH)
+ flags |= (EW_FILE | EW_PATH);
else
flags = (flags | EW_DIR) & ~EW_FILE;
/* Expand wildcards, supporting %:h and the like. */
View
@@ -2970,8 +2970,8 @@ prepare_crypt_read(fp)
return FAIL;
method = get_crypt_method((char *)buffer,
CRYPT_MAGIC_LEN +
- CRYPT_SEED_LEN_MAX +
- CRYPT_SALT_LEN_MAX);
+ CRYPT_SEED_LEN_MAX +
+ CRYPT_SALT_LEN_MAX);
if (method < 0 || method != curbuf->b_p_cm)
return FAIL;
View
@@ -2941,7 +2941,7 @@ inchar(buf, maxlen, wait_time, tb_change_cnt)
#if defined(FEAT_NETBEANS_INTG)
/* Process the queued netbeans messages. */
- netbeans_parse_messages();
+ netbeans_parse_messages();
#endif
if (got_int || (script_char = getc(scriptin[curscript])) < 0)
View
@@ -1383,7 +1383,7 @@ gui_set_shellsize(mustset, fit_to_display, direction)
int screen_h;
#ifdef FEAT_GUI_GTK
int un_maximize = mustset;
- int did_adjust = 0;
+ int did_adjust = 0;
#endif
int x = -1, y = -1;
Oops, something went wrong.

0 comments on commit 6a69fb8

Please sign in to comment.