~ubuntu-branches/ubuntu/jaunty/geany/jaunty

« back to all changes in this revision

Viewing changes to src/callbacks.c

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc
  • Date: 2007-02-25 21:12:13 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070225211213-jk4d4vxtgji0rj74
Tags: 0.10.2-0ubuntu1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *      callbacks.c - this file is part of Geany, a fast and lightweight IDE
3
3
 *
4
 
 *      Copyright 2006 Enrico Troeger <enrico.troeger@uvena.de>
 
4
 *      Copyright 2005-2007 Enrico Tröger <enrico.troeger@uvena.de>
 
5
 *      Copyright 2006-2007 Nick Treleaven <nick.treleaven@btinternet.com>
5
6
 *
6
7
 *      This program is free software; you can redistribute it and/or modify
7
8
 *      it under the terms of the GNU General Public License as published by
17
18
 *      along with this program; if not, write to the Free Software
18
19
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
20
 *
20
 
 * $Id: callbacks.c 1137 2006-12-21 16:41:36Z eht16 $
 
21
 * $Id: callbacks.c 1270 2007-02-12 18:42:15Z eht16 $
21
22
 */
22
23
 
23
24
 
382
383
                        gchar *content = gtk_clipboard_wait_for_text(gtk_clipboard_get(GDK_NONE));
383
384
                        if (content != NULL)
384
385
                        {
385
 
                                sci_insert_text(doc_list[idx].sci,
386
 
                                                                                sci_get_current_position(doc_list[idx].sci), content);
 
386
                                sci_replace_sel(doc_list[idx].sci, content);
387
387
                                g_free(content);
388
388
                        }
389
389
                }
885
885
                        doc_list[idx].tm_file = NULL;
886
886
                        g_free(doc_list[idx].file_name);
887
887
                }
888
 
                doc_list[idx].file_name = new_filename;
 
888
                doc_list[idx].file_name = utils_get_utf8_from_locale(new_filename);
 
889
                g_free(new_filename);
889
890
 
890
891
                utils_replace_filename(idx);
891
892
                document_save_file(idx, TRUE);
2001
2002
                line = sci_get_current_line(doc_list[idx].sci, old_pos);
2002
2003
                ind_pos = sci_get_line_indent_position(doc_list[idx].sci, line);
2003
2004
 
2004
 
                sci_set_current_position(doc_list[idx].sci, ind_pos);
 
2005
                sci_set_current_position(doc_list[idx].sci, ind_pos, TRUE);
2005
2006
                sci_cmd(doc_list[idx].sci, SCI_TAB);
2006
2007
                sci_set_current_position(doc_list[idx].sci,
2007
 
                        (old_pos > ind_pos) ? old_pos + 1 : old_pos);
 
2008
                        (old_pos > ind_pos) ? old_pos + 1 : old_pos, TRUE);
2008
2009
        }
2009
2010
}
2010
2011
 
2030
2031
 
2031
2032
                if (ind_pos == sci_get_position_from_line(doc_list[idx].sci, line))
2032
2033
                        return;
2033
 
                sci_set_current_position(doc_list[idx].sci, ind_pos);
 
2034
                sci_set_current_position(doc_list[idx].sci, ind_pos, TRUE);
2034
2035
                sci_cmd(doc_list[idx].sci, SCI_BACKTAB);
2035
2036
                sci_set_current_position(doc_list[idx].sci,
2036
 
                        (old_pos >= ind_pos) ? old_pos - 1 : old_pos);
 
2037
                        (old_pos >= ind_pos) ? old_pos - 1 : old_pos, TRUE);
2037
2038
        }
2038
2039
}
2039
2040