diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-03-15 22:59:18 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-03-15 22:59:18 +0000 |
commit | 7d47b6eed707db9af160ec517b71e1f9fdac1a0f (patch) | |
tree | f93785b6fba72029e272fac10caed4cda5c09f4e /src | |
parent | 5671873089d516a10c79733182797075071eb5f3 (diff) | |
download | vim-git-7d47b6eed707db9af160ec517b71e1f9fdac1a0f.tar.gz |
updated for version 7.0225
Diffstat (limited to 'src')
-rwxr-xr-x | src/auto/configure | 4 | ||||
-rw-r--r-- | src/configure.in | 5 | ||||
-rw-r--r-- | src/gui_mac.c | 20 | ||||
-rw-r--r-- | src/misc2.c | 10 | ||||
-rw-r--r-- | src/os_mac_conv.c | 15 | ||||
-rw-r--r-- | src/popupmenu.c | 36 | ||||
-rw-r--r-- | src/screen.c | 5 | ||||
-rw-r--r-- | src/testdir/Make_amiga.mak | 4 | ||||
-rw-r--r-- | src/testdir/Make_dos.mak | 2 | ||||
-rw-r--r-- | src/undo.c | 8 | ||||
-rw-r--r-- | src/version.h | 4 |
11 files changed, 83 insertions, 30 deletions
diff --git a/src/auto/configure b/src/auto/configure index 27c2d6414..13cb22610 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -2838,6 +2838,10 @@ if test "`(uname) 2>/dev/null`" = Darwin; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 + if test x$prefix = xNONE; then + prefix=/Applications + fi + echo "$as_me:$LINENO: checking --disable-darwin argument" >&5 echo $ECHO_N "checking --disable-darwin argument... $ECHO_C" >&6 # Check whether --enable-darwin or --disable-darwin was given. diff --git a/src/configure.in b/src/configure.in index 60a19ef64..1797f69c4 100644 --- a/src/configure.in +++ b/src/configure.in @@ -85,6 +85,11 @@ AC_MSG_CHECKING([for Darwin (Mac OS X)]) if test "`(uname) 2>/dev/null`" = Darwin; then AC_MSG_RESULT(yes) + dnl Default install directory is not /usr/local + if test x$prefix = xNONE; then + prefix=/Applications + fi + AC_MSG_CHECKING(--disable-darwin argument) AC_ARG_ENABLE(darwin, [ --disable-darwin Disable Darwin (Mac OS X) support.], diff --git a/src/gui_mac.c b/src/gui_mac.c index c4250a00a..d05fddb2a 100644 --- a/src/gui_mac.c +++ b/src/gui_mac.c @@ -52,8 +52,8 @@ static EventHandlerUPP mouseWheelHandlerUPP = NULL; SInt32 gMacSystemVersion; -#if defined(FEAT_MBYTE) -#define USE_CARBONKEYHANDLER +#ifdef MACOS_CONVERT +# define USE_CARBONKEYHANDLER static EventHandlerUPP keyEventHandlerUPP = NULL; #endif @@ -130,7 +130,7 @@ static struct Boolean isPanelVisible; } gFontPanelInfo = { 0, 0, 0, false }; -#if defined(FEAT_MBYTE) +#ifdef MACOS_CONVERT # define USE_ATSUI_DRAWING ATSUStyle gFontStyle; Boolean gIsFontFallbackSet; @@ -419,7 +419,7 @@ points_to_pixels(char_u *str, char_u **end, int vertical) return pixels; } -#if defined(FEAT_MBYTE) +#ifdef MACOS_CONVERT /* * Deletes all traces of any Windows-style mnemonic text (including any * parentheses) from a menu item and returns the cleaned menu item title. @@ -4437,7 +4437,7 @@ clip_mch_request_selection(VimClipboard *cbd) #endif tempclip[scrapSize] = 0; -#if defined(FEAT_MBYTE) +#ifdef MACOS_CONVERT /* Convert from utf-16 (clipboard) */ size_t encLen = 0; char_u *to = mac_utf16_to_enc((UniChar *)tempclip, scrapSize, &encLen); @@ -4510,7 +4510,7 @@ clip_mch_set_selection(VimClipboard *cbd) type = clip_convert_selection(&str, (long_u *) &scrapSize, cbd); -#if defined(FEAT_MBYTE) +#ifdef MACOS_CONVERT size_t utf16_len = 0; UniChar *to = mac_enc_to_utf16(str, scrapSize, &utf16_len); if (to) @@ -4628,7 +4628,7 @@ gui_mch_add_menu(vimmenu_T *menu, int idx) menu_after_me = hierMenu; /* Convert the name */ -#if defined(FEAT_MBYTE) +#ifdef MACOS_CONVERT name = menu_title_removing_mnemonic(menu); #else name = C2Pascal_save(menu->dname); @@ -4721,7 +4721,7 @@ gui_mch_add_menu_item(vimmenu_T *menu, int idx) for older OS call GetMenuItemData (menu, item, isCommandID?, data) */ /* Convert the name */ -#if defined(FEAT_MBYTE) +#ifdef MACOS_CONVERT name = menu_title_removing_mnemonic(menu); #else name = C2Pascal_save(menu->dname); @@ -5745,7 +5745,7 @@ gui_mch_settitle(char_u *title, char_u *icon) /* TODO: Get vim to make sure maxlen (from p_titlelen) is smaller * that 256. Even better get it to fit nicely in the titlebar. */ -#if defined(FEAT_MBYTE) +#ifdef MACOS_CONVERT CFStringRef windowTitle; size_t windowTitleLen; #else @@ -5755,7 +5755,7 @@ gui_mch_settitle(char_u *title, char_u *icon) if (title == NULL) /* nothing to do */ return; -#if defined(FEAT_MBYTE) +#ifdef MACOS_CONVERT windowTitleLen = STRLEN(title); windowTitle = mac_enc_to_cfstring(title, windowTitleLen); diff --git a/src/misc2.c b/src/misc2.c index 44b05178b..dece0d968 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -964,8 +964,10 @@ free_all_mem() #ifdef FEAT_WINDOWS /* close all tabs and windows */ - do_cmdline_cmd((char_u *)"tabonly!"); - do_cmdline_cmd((char_u *)"only!"); + if (first_tabpage->tp_next != NULL) + do_cmdline_cmd((char_u *)"tabonly!"); + if (firstwin != lastwin) + do_cmdline_cmd((char_u *)"only!"); #endif # if defined(FEAT_SPELL) @@ -1077,6 +1079,10 @@ free_all_mem() reset_last_sourcing(); +#ifdef FEAT_WINDOWS + vim_free(first_tabpage); +#endif + # ifdef UNIX /* Machine-specific free. */ mch_free_mem(); diff --git a/src/os_mac_conv.c b/src/os_mac_conv.c index fbce5770d..9f19a8098 100644 --- a/src/os_mac_conv.c +++ b/src/os_mac_conv.c @@ -16,7 +16,14 @@ #define NO_X11_INCLUDES #include "vim.h" -#ifdef FEAT_MBYTE +#if defined(MACOS_CONVERT) || defined(PROTO) +# ifdef PROTO +/* A few dummy types to be able to generate function prototypes. */ +typedef int UniChar; +typedef int *TECObjectRef; +typedef int CFStringRef; +# endif + static char_u *mac_utf16_to_utf8 __ARGS((UniChar *from, size_t fromLen, size_t *actualLen)); static UniChar *mac_utf8_to_utf16 __ARGS((char_u *from, size_t fromLen, size_t *actualLen)); @@ -477,7 +484,7 @@ mac_precompose_path(decompPath, decompLen, precompLen) /* * Converts from UTF-16 UniChars to precomposed UTF-8 */ - char_u * + static char_u * mac_utf16_to_utf8(from, fromLen, actualLen) UniChar *from; size_t fromLen; @@ -517,7 +524,7 @@ mac_utf16_to_utf8(from, fromLen, actualLen) /* * Converts from UTF-8 to UTF-16 UniChars */ - UniChar * + static UniChar * mac_utf8_to_utf16(from, fromLen, actualLen) char_u *from; size_t fromLen; @@ -548,4 +555,4 @@ mac_utf8_to_utf16(from, fromLen, actualLen) return result; } -#endif /* FEAT_MBYTE */ +#endif /* MACOS_CONVERT */ diff --git a/src/popupmenu.c b/src/popupmenu.c index 5126e8647..ca3547cb5 100644 --- a/src/popupmenu.c +++ b/src/popupmenu.c @@ -87,11 +87,13 @@ redo: pum_height = size; else pum_height = PUM_DEF_HEIGHT; + if (p_ph > 0 && pum_height > p_ph) + pum_height = p_ph; /* Put the pum below "row" if possible. If there are few lines decide on * where there is more room. */ - if (row >= cmdline_row - top_clear - pum_height - && row > (cmdline_row - top_clear - height) / 2) + if (row >= cmdline_row - pum_height + && row > (cmdline_row - top_clear - height) / 2) { /* pum above "row" */ if (row >= size) @@ -104,6 +106,11 @@ redo: pum_row = 0; pum_height = row; } + if (p_ph > 0 && pum_height > p_ph) + { + pum_row += pum_height - p_ph; + pum_height = p_ph; + } } else { @@ -113,6 +120,8 @@ redo: pum_height = cmdline_row - pum_row; else pum_height = size; + if (p_ph > 0 && pum_height > p_ph) + pum_height = p_ph; } /* don't display when we only have room for one line */ @@ -214,7 +223,7 @@ pum_redraw() int i; int idx; char_u *s; - char_u *p; + char_u *p = NULL; int totwidth, width, w; int thumb_pos = 0; int thumb_heigth = 1; @@ -330,6 +339,7 @@ pum_set_selected(n) int n; { int resized = FALSE; + int context = pum_height / 2; pum_selected = n; @@ -364,20 +374,22 @@ pum_set_selected(n) pum_first = pum_selected - pum_height + 1; } - if (pum_height > 6) + /* Give a few lines of context when possible. */ + if (context > 3) + context = 3; + if (pum_height > 2) { - /* Give three lines of context when possible. */ - if (pum_first > pum_selected - 3) + if (pum_first > pum_selected - context) { /* scroll down */ - pum_first = pum_selected - 3; + pum_first = pum_selected - context; if (pum_first < 0) pum_first = 0; } - else if (pum_first < pum_selected + 3 - pum_height + 1) + else if (pum_first < pum_selected + context - pum_height + 1) { /* scroll up */ - pum_first = pum_selected + 3 - pum_height + 1; + pum_first = pum_selected + context - pum_height + 1; } } @@ -479,6 +491,12 @@ pum_set_selected(n) if (win_valid(curwin_save)) win_enter(curwin_save, TRUE); + + /* May need to update the screen again when there are + * autocommands involved. */ + pum_do_redraw = TRUE; + update_screen(0); + pum_do_redraw = FALSE; } } } diff --git a/src/screen.c b/src/screen.c index 64c2bb5bc..6de791d5b 100644 --- a/src/screen.c +++ b/src/screen.c @@ -7305,6 +7305,11 @@ screenalloc(clear) #endif entered = FALSE; + +#ifdef FEAT_AUTOCMD + if (starting == 0) + apply_autocmds(EVENT_VIMRESIZED, NULL, NULL, FALSE, curbuf); +#endif } void diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak index 62e3dedb6..3bbd964be 100644 --- a/src/testdir/Make_amiga.mak +++ b/src/testdir/Make_amiga.mak @@ -24,7 +24,8 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ test38.out test39.out test40.out test41.out test42.out \ test43.out test44.out test45.out test46.out test47.out \ test48.out test51.out test53.out test54.out test55.out \ - test56.out test57.out test58.out test59.out test60.out + test56.out test57.out test58.out test59.out test60.out \ + test61.out .SUFFIXES: .in .out @@ -104,3 +105,4 @@ test57.out: test57.in test58.out: test58.in test59.out: test59.in test60.out: test60.in +test61.out: test61.in diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak index cbab6cd1e..66c9f9f59 100644 --- a/src/testdir/Make_dos.mak +++ b/src/testdir/Make_dos.mak @@ -19,7 +19,7 @@ SCRIPTS16 = test1.out test19.out test20.out test22.out \ test44.out test45.out test46.out test47.out \ test48.out test51.out test53.out test54.out \ test55.out test56.out test57.out test58.out test59.out \ - test60.out + test60.out test61.out SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test8.out test9.out test11.out test13.out test14.out \ diff --git a/src/undo.c b/src/undo.c index 88f11a342..27f04b92e 100644 --- a/src/undo.c +++ b/src/undo.c @@ -295,6 +295,8 @@ u_savecommon(top, bot, newbot) if (uhp == NULL) goto nomem; } + else + uhp = NULL; /* * If we undid more than we redid, move the entry lists before and @@ -326,7 +328,7 @@ u_savecommon(top, bot, newbot) } } - if (p_ul < 0) /* no undo at all */ + if (uhp == NULL) /* no undo at all */ { if (old_curhead != NULL) u_freebranch(curbuf, old_curhead, NULL); @@ -655,6 +657,10 @@ undo_time(step, sec) int dosec = sec; int above = FALSE; + /* First make sure the current undoable change is synced. */ + if (curbuf->b_u_synced == FALSE) + u_sync(); + u_newcount = 0; u_oldcount = 0; if (curbuf->b_ml.ml_flags & ML_EMPTY) diff --git a/src/version.h b/src/version.h index d239d8a44..774222d07 100644 --- a/src/version.h +++ b/src/version.h @@ -36,5 +36,5 @@ #define VIM_VERSION_NODOT "vim70aa" #define VIM_VERSION_SHORT "7.0aa" #define VIM_VERSION_MEDIUM "7.0aa ALPHA" -#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Mar 14)" -#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Mar 14, compiled " +#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Mar 15)" +#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Mar 15, compiled " |