]> granicus.if.org Git - vim/commitdiff
updated for version 7.0022 v7.0022
authorBram Moolenaar <Bram@vim.org>
Sun, 12 Dec 2004 11:37:09 +0000 (11:37 +0000)
committerBram Moolenaar <Bram@vim.org>
Sun, 12 Dec 2004 11:37:09 +0000 (11:37 +0000)
runtime/doc/todo.txt
runtime/doc/version7.txt
src/eval.c
src/gui_gtk_x11.c
src/gui_x11.c
src/proto/gui_amiga.pro
src/proto/gui_x11.pro
src/ui.c

index d6da62fd77d4095483de39811444cad26aff17b2..cd4868791ecff1fdc346a517dbb2f25a69890e53 100644 (file)
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.0aa.  Last change: 2004 Dec 09
+*todo.txt*      For Vim version 7.0aa.  Last change: 2004 Dec 11
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -30,17 +30,8 @@ be worked on, but only if you sponsor Vim development.  See |sponsor|.
                                                        *known-bugs*
 -------------------- Known bugs and current work -----------------------
 
-Add a function to test if a font name actually works.
-
-When using "set laststatus=2 cmdheight=2" in the .gvimrc you only get one line
-for the cmdline. (Christian Robinson)  When the Vim window is resized (e.g.,
-xterm with many lines) it's OK.
-
 ":e <cfile>" does not expand ~/file, very confusing compared to ":e ~/file".
 
-SIGHUP is delayed until waiting for a character.  Can the same thing be done
-for SIGINT?  Then also check when waiting for a short time.
-
 When no termcap/termlib library is found, check that compiling Vim works in
 configure.  Give an clear error message ("install termcap or ncurses-dev
 package") when it doesn't.
@@ -1354,6 +1345,7 @@ Multi-byte characters:
 8   The quickfix file is read without conversion, thus in 'encoding'.  Add an
     option to specify the encoding of the errorfile and convert it.  Also for
     ":grep" and ":helpgrep".
+    More generic solution: support a filter (e.g., by calling a function).
 8   When a file was converted from 'fileencoding' to 'encoding', a tag search
     should also do this on the search pattern. (Andrzej M. Ostruszka)
 7   When converting a file fails, mention which byte could not be converted,
index cdfb1a0a061521263585f3fd82ee9d17686c093e..814752ba435d1b2aa41b1523db3adb277ee5d8f4 100644 (file)
@@ -1,4 +1,4 @@
-*version7.txt*  For Vim version 7.0aa.  Last change: 2004 Dec 09
+*version7.txt*  For Vim version 7.0aa.  Last change: 2004 Dec 11
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -166,6 +166,7 @@ repeat(expr, count) |repeat()|      Repeat "expr" "count" times.
 tr(expr, from, to)     |tr()|          Translate characters. (Ron Aaron)
 system(cmd, input)     |system()|      Filters {input} through a shell
                                        command.
+getfontname([name])    |getfontname()| Get actual font name being used.
 
 
 New autocommand events: ~
@@ -223,6 +224,10 @@ Also fixes the problem that setting 'clipboard' to "unnamed" breaks using
 
 Mac: GUI font selector. (Peter "Rain Dog" Cucka)
 
+Mac: better integration with Xcode.  Post a fake mouse-up event after the odoc
+event and the drag receive handler to work around a stall after Vim loads a
+file.  Fixed an off-by-one line number error. (Da Woon Jung)
+
 The netrw plugin now also supports viewing a directory, when "scp://" is used.
 Deleting and renaming files is possible.  (Charles Campbell)
 
@@ -494,7 +499,11 @@ After "Y" '[ and '] were not at start/end of the yanked text.
 
 When a telnet connection is dropped Vim preserves files and exits.  While
 doing that a SIGHUP may arrive and disturbe us, thus ignore it. (Scott
-Anderson)  Also postpone SIGHUP until it's safe to handle.  Added
-handle_sighup().
+Anderson)  Also postpone SIGHUP, SIGQUIT and SIGTERM until it's safe to
+handle.  Added handle_signal().
+
+When using "set laststatus=2 cmdheight=2" in the .gvimrc you may only get one
+line for the cmdline. (Christian Robinson)  Invoke command_height() after the
+GUI has started up.
 
  vim:tw=78:ts=8:ft=help:norl:
index 27783792f0e433e89c35e27de6c5e57db7717e2b..b5b4b792a32a0297f8f3533c5da1f8e4cdf0cad7 100644 (file)
@@ -300,6 +300,7 @@ static void f_getcharmod __ARGS((VAR argvars, VAR retvar));
 static void f_getcmdline __ARGS((VAR argvars, VAR retvar));
 static void f_getcmdpos __ARGS((VAR argvars, VAR retvar));
 static void f_getcwd __ARGS((VAR argvars, VAR retvar));
+static void f_getfontname __ARGS((VAR argvars, VAR retvar));
 static void f_getfperm __ARGS((VAR argvars, VAR retvar));
 static void f_getfsize __ARGS((VAR argvars, VAR retvar));
 static void f_getftime __ARGS((VAR argvars, VAR retvar));
@@ -2864,6 +2865,7 @@ static struct fst
     {"getcmdline",     0, 0, f_getcmdline},
     {"getcmdpos",      0, 0, f_getcmdpos},
     {"getcwd",         0, 0, f_getcwd},
+    {"getfontname",    0, 1, f_getfontname},
     {"getfperm",       1, 1, f_getfperm},
     {"getfsize",       1, 1, f_getfsize},
     {"getftime",       1, 1, f_getftime},
@@ -4731,6 +4733,45 @@ f_getcwd(argvars, retvar)
     }
 }
 
+/*
+ * "getfontname()" function
+ */
+    static void
+f_getfontname(argvars, retvar)
+    VAR                argvars;
+    VAR                retvar;
+{
+    retvar->var_type = VAR_STRING;
+    retvar->var_val.var_string = NULL;
+#ifdef FEAT_GUI
+    if (gui.in_use)
+    {
+       GuiFont font;
+       char_u  *name = NULL;
+
+       if (argvars[0].var_type == VAR_UNKNOWN)
+       {
+           /* Get the "Normal" font.  Either the name saved by
+            * hl_set_font_name() or from the font ID. */
+           font = gui.norm_font;
+           name = hl_get_font_name();
+       }
+       else
+       {
+           name = get_var_string(&argvars[0]);
+           if (STRCMP(name, "*") == 0)     /* don't use font dialog */
+               return;
+           font = gui_mch_get_font(name, FALSE);
+           if (font == NOFONT)
+               return;     /* Invalid font name, return empty string. */
+       }
+       retvar->var_val.var_string = gui_mch_get_fontname(font, name);
+       if (argvars[0].var_type != VAR_UNKNOWN)
+           gui_mch_free_font(font);
+    }
+#endif
+}
+
 /*
  * "getfperm({fname})" function
  */
index b67b6f2d21026e912c4bad624350faa770e2a409..34bbed5333197a02433b12713524212ca0ca539e 100644 (file)
@@ -2722,7 +2722,7 @@ mainwin_screen_changed_cb(GtkWidget  *widget,
 
     if (gui.norm_font != NULL)
     {
-       gui_mch_init_font(p_guifont, 0);
+       gui_mch_init_font(p_guifont, FALSE);
        gui_set_shellsize(FALSE, FALSE);
     }
 }
@@ -4792,6 +4792,34 @@ gui_mch_get_font(char_u *name, int report_error)
     return font;
 }
 
+/*
+ * Return the name of font "font" in allocated memory.
+ */
+/*ARGSUSED*/
+    char_u *
+gui_mch_get_fontname(GuiFont font, char_u *name)
+{
+#ifdef HAVE_GTK2
+    if (font != NOFONT)
+    {
+       char    *name = pango_font_description_to_string(font);
+
+       if (name != NULL)
+       {
+           char_u      *s = vim_strsave((char_u *)name);
+
+           g_free(name);
+           return s;
+       }
+    }
+#else
+    /* Don't know how to get the name, return what we got. */
+    if (name != NULL)
+       return vim_strsave(name);
+#endif
+    return NULL;
+}
+
 #if !defined(HAVE_GTK2) || defined(PROTO)
 /*
  * Set the current text font.
index e57bb9279ffa7e9fdbaf1329d60682398a965296..90e6fbd9460f4acee7e6873a4503c2586cdb4057 100644 (file)
@@ -1988,6 +1988,20 @@ gui_mch_get_font(name, giveErrorIfMissing)
     return (GuiFont)font;
 }
 
+/*
+ * Return the name of font "font" in allocated memory.
+ * Don't know how to get the actual name, thus use the provided name.
+ */
+    char_u *
+gui_mch_get_fontname(font, name)
+    GuiFont font;
+    char_u  *name;
+{
+    if (name == NULL)
+       return NULL;
+    return vim_strsave(name);
+}
+
     int
 gui_mch_adjust_charsize()
 {
index ec70bc1028656ab2b38c522edd3fa0f687a140b6..2f8d2ac5935b1125390971ca5d02d9327f54bacc 100644 (file)
@@ -20,9 +20,11 @@ void gui_mch_set_scrollbar_thumb __ARGS((scrollbar_T *sb, long val, long size, l
 void gui_mch_set_scrollbar_pos __ARGS((scrollbar_T *sb, int x, int y, int w, int h));
 void gui_mch_create_scrollbar __ARGS((scrollbar_T *sb, int orient));
 void gui_mch_destroy_scrollbar __ARGS((scrollbar_T *sb));
+char_u *gui_mch_getfontname __ARGS((GuiFont font));
 int gui_mch_init_font __ARGS((char_u *font_name, int fontset));
 int gui_mch_adjust_charsize __ARGS((void));
 GuiFont gui_mch_get_font __ARGS((char_u *name, int giveErrorIfMissing));
+char_u *gui_mch_get_fontname __ARGS((GuiFont font, char_u *name));
 void gui_mch_set_font __ARGS((GuiFont font));
 void gui_mch_free_font __ARGS((GuiFont font));
 guicolor_T gui_mch_get_color __ARGS((char_u *name));
index 6524c265deffba4dccdcb75e6805ebd7bc841b8e..035c27f95e322774e92f9b1e03804824650b8372 100644 (file)
@@ -15,6 +15,7 @@ void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min
 void gui_mch_get_screen_dimensions __ARGS((int *screen_w, int *screen_h));
 int gui_mch_init_font __ARGS((char_u *font_name, int do_fontset));
 GuiFont gui_mch_get_font __ARGS((char_u *name, int giveErrorIfMissing));
+char_u *gui_mch_get_fontname __ARGS((GuiFont font, char_u *name));
 int gui_mch_adjust_charsize __ARGS((void));
 void gui_mch_set_font __ARGS((GuiFont font));
 void gui_mch_set_fontset __ARGS((GuiFontset fontset));
index 3963bd545acca5e5fd0fa8dc608f2890cae8ef21..ac88dc6ab5d494f081347abe2e8f038e3c648cdf 100644 (file)
--- a/src/ui.c
+++ b/src/ui.c
@@ -177,11 +177,11 @@ ui_inchar(buf, maxlen, wtime, tb_change_cnt)
     else
 # endif
     {
-       if (wtime == -1)
-           handle_sighup(SIGHUP_UNBLOCK);  /* allow SIGHUP to kill us */
+       if (wtime == -1 || wtime > 100L)
+           (void)handle_signal(SIGNAL_UNBLOCK);  /* allow signals to kill us */
        retval = mch_inchar(buf, maxlen, wtime, tb_change_cnt);
-       if (wtime == -1)
-           handle_sighup(SIGHUP_BLOCK);    /* block SIGHUP */
+       if (wtime == -1 || wtime > 100L)
+           (void)handle_signal(SIGNAL_BLOCK);    /* block SIGHUP et al. */
     }
 #endif