/[beaver]/beaver/src/completion.c
ViewVC logotype

Diff of /beaver/src/completion.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by mikix, Sun Mar 9 18:25:10 2003 UTC revision 1.2 by skypher, Sun Mar 16 19:04:03 2003 UTC
# Line 30  Line 30 
30  #include <stdio.h>  #include <stdio.h>
31  #include <stdlib.h>  #include <stdlib.h>
32  #include <string.h>  #include <string.h>
33    #include "main.h"
34  #include "editor.h"  #include "editor.h"
35  #include "struct.h"  #include "struct.h"
36  #include "msgbar.h"  #include "msgbar.h"
# Line 86  gint                   auto_completion(GtkTextView *Edit Line 87  gint                   auto_completion(GtkTextView *Edit
87                WidgetInfo.Lg);                WidgetInfo.Lg);
88    if (Lg == -1)    if (Lg == -1)
89      {      {
90        print_msg ("Cannot complete: language not recognized...");        print_msg(_("Cannot auto-complete: language not recognized..."));
91        return -1;        return -1;
92      }      }
93    EditorBuffer = gtk_text_view_get_buffer (Editor);    EditorBuffer = gtk_text_view_get_buffer (Editor);
# Line 163  gint                   auto_completion(GtkTextView *Edit Line 164  gint                   auto_completion(GtkTextView *Edit
164      }      }
165    if (!bok || (dlist == NULL))    if (!bok || (dlist == NULL))
166      {      {
167        print_msg ("No matching string...");        print_msg(_("No matching string."));
168        return 0;        return 0;
169      }      }
170    if (!dlist->next)    if (!dlist->next)
# Line 180  gint                   auto_completion(GtkTextView *Edit Line 181  gint                   auto_completion(GtkTextView *Edit
181        gtk_text_buffer_delete(EditorBuffer, &start, &end);        gtk_text_buffer_delete(EditorBuffer, &start, &end);
182        gtk_text_buffer_insert_at_cursor(EditorBuffer,        gtk_text_buffer_insert_at_cursor(EditorBuffer,
183                                 label, strlen(label));                                 label, strlen(label));
184        msg = g_strconcat ("String \"", label, "\" inserted...", NULL);        msg = g_strdup_printf(_("String \"%s\" inserted."), label);
185        print_msg (msg);        print_msg (msg);
186        g_free (msg);        g_free (msg);
187        return 0;        return 0;
# Line 318  void                   auto_completion_double_clic(GtkWi Line 319  void                   auto_completion_double_clic(GtkWi
319          gtk_text_buffer_delete (Buffer, &start, &end);          gtk_text_buffer_delete (Buffer, &start, &end);
320        }        }
321        gtk_text_buffer_insert_at_cursor(Buffer, label, -1);        gtk_text_buffer_insert_at_cursor(Buffer, label, -1);
322        msg = g_strconcat ("String \"", label, "\" inserted...", NULL);        msg = g_strdup_printf(_("String \"%s\" inserted."), label);
323        print_msg (msg);        print_msg (msg);
324        g_free (msg);        g_free (msg);
325        gtk_widget_destroy(gtk_widget_get_toplevel(widget));        gtk_widget_destroy(gtk_widget_get_toplevel(widget));
# Line 378  void                   auto_completion_key_press(GtkWidg Line 379  void                   auto_completion_key_press(GtkWidg
379          gtk_text_buffer_delete (Buffer, &start, &end);          gtk_text_buffer_delete (Buffer, &start, &end);
380        }        }
381        gtk_text_buffer_insert_at_cursor(Buffer, label, -1);        gtk_text_buffer_insert_at_cursor(Buffer, label, -1);
382        msg = g_strconcat ("String \"", label, "\" inserted...", NULL);        msg = g_strdup_printf(_("String \"%s\" inserted."), label);
383        print_msg (msg);        print_msg (msg);
384        g_free (msg);        g_free (msg);
385        gtk_widget_destroy(window);        gtk_widget_destroy(window);
# Line 411  void                   auto_completion_key_press(GtkWidg Line 412  void                   auto_completion_key_press(GtkWidg
412        else        else
413          {          {
414            if (BEEP) gdk_beep();            if (BEEP) gdk_beep();
415            print_msg ("Beginning of auto-completion buffer...");            print_msg (_("Beginning of auto-completion buffer."));
416          }          }
417      }      }
418    else if (event->string[0] > ' ' && event->string[0] <= '~')    else if (event->string[0] > ' ' && event->string[0] <= '~')
# Line 438  void                   auto_completion_key_press(GtkWidg Line 439  void                   auto_completion_key_press(GtkWidg
439        else        else
440          {          {
441            if (BEEP) gdk_beep();            if (BEEP) gdk_beep();
442            print_msg ("No matching string...");            print_msg(_("No matching string."));
443          }          }
444        g_free (word);        g_free (word);
445      }      }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26