Rename sci_cb.[hc] editor.[hc].

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1584 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2007-05-28 16:07:30 +00:00
parent 4bbc65c449
commit fdaa689bff
12 changed files with 87 additions and 82 deletions

View File

@ -4,6 +4,11 @@
Show current project name in window title. Show current project name in window title.
* configure.in, src/Makefile.am: * configure.in, src/Makefile.am:
Force debug mode for a SVN working copy. Force debug mode for a SVN working copy.
* src/highlighting.c, src/keybindings.c, src/makefile.win32,
src/callbacks.c, src/sci_cb.c, src/sci_cb.h, src/search.c,
src/document.c, src/main.c, src/editor.c, src/Makefile.am,
src/editor.h, po/POTFILES.in:
Rename sci_cb.[hc] editor.[hc].
2007-05-26 Nick Treleaven <nick.treleaven@btinternet.com> 2007-05-26 Nick Treleaven <nick.treleaven@btinternet.com>

View File

@ -18,7 +18,7 @@ src/msgwindow.c
src/notebook.c src/notebook.c
src/prefs.c src/prefs.c
src/project.c src/project.c
src/sci_cb.c src/editor.c
src/sciwrappers.c src/sciwrappers.c
src/search.c src/search.c
src/socket.c src/socket.c

View File

@ -23,7 +23,7 @@ SRCS = \
notebook.c notebook.h \ notebook.c notebook.h \
prefs.c prefs.h \ prefs.c prefs.h \
project.c project.h \ project.c project.h \
sci_cb.c sci_cb.h \ editor.c editor.h \
sciwrappers.c sciwrappers.h \ sciwrappers.c sciwrappers.h \
search.c search.h \ search.c search.h \
socket.c socket.h \ socket.c socket.h \

View File

@ -41,7 +41,7 @@
#include "keyfile.h" #include "keyfile.h"
#include "document.h" #include "document.h"
#include "sciwrappers.h" #include "sciwrappers.h"
#include "sci_cb.h" #include "editor.h"
#include "ui_utils.h" #include "ui_utils.h"
#include "utils.h" #include "utils.h"
#include "dialogs.h" #include "dialogs.h"
@ -1249,7 +1249,7 @@ on_show_color_chooser1_activate (GtkMenuItem *menuitem,
if (idx == -1 || ! doc_list[idx].is_valid) if (idx == -1 || ! doc_list[idx].is_valid)
return; return;
sci_cb_find_current_word(doc_list[idx].sci, pos, colour, sizeof colour, NULL); editor_find_current_word(doc_list[idx].sci, pos, colour, sizeof colour, NULL);
dialogs_show_color(colour); dialogs_show_color(colour);
} }
@ -1477,7 +1477,7 @@ on_comments_multiline_activate (GtkMenuItem *menuitem,
verify_click_pos(idx); // make sure that the click_pos is valid verify_click_pos(idx); // make sure that the click_pos is valid
sci_cb_insert_multiline_comment(idx); editor_insert_multiline_comment(idx);
} }
@ -1829,7 +1829,7 @@ on_menu_comment_line1_activate (GtkMenuItem *menuitem,
{ {
gint idx = document_get_cur_idx(); gint idx = document_get_cur_idx();
if (idx == -1 || ! doc_list[idx].is_valid) return; if (idx == -1 || ! doc_list[idx].is_valid) return;
sci_cb_do_comment(idx, -1, FALSE); editor_do_comment(idx, -1, FALSE);
} }
@ -1839,7 +1839,7 @@ on_menu_uncomment_line1_activate (GtkMenuItem *menuitem,
{ {
gint idx = document_get_cur_idx(); gint idx = document_get_cur_idx();
if (idx == -1 || ! doc_list[idx].is_valid) return; if (idx == -1 || ! doc_list[idx].is_valid) return;
sci_cb_do_uncomment(idx, -1); editor_do_uncomment(idx, -1);
} }
@ -1850,7 +1850,7 @@ on_menu_toggle_line_commentation1_activate
{ {
gint idx = document_get_cur_idx(); gint idx = document_get_cur_idx();
if (idx == -1 || ! doc_list[idx].is_valid) return; if (idx == -1 || ! doc_list[idx].is_valid) return;
sci_cb_do_comment_toggle(idx); editor_do_comment_toggle(idx);
} }
@ -2067,7 +2067,7 @@ on_menu_open_selected_file1_activate (GtkMenuItem *menuitem,
{ // use the word at current cursor position { // use the word at current cursor position
gchar word[GEANY_MAX_WORD_LENGTH]; gchar word[GEANY_MAX_WORD_LENGTH];
sci_cb_find_current_word(doc_list[idx].sci, -1, word, sizeof(word), GEANY_WORDCHARS"./"); editor_find_current_word(doc_list[idx].sci, -1, word, sizeof(word), GEANY_WORDCHARS"./");
if (word[0] != '\0') if (word[0] != '\0')
filename = g_strdup(word); filename = g_strdup(word);
} }

View File

@ -53,7 +53,7 @@
#include "document.h" #include "document.h"
#include "support.h" #include "support.h"
#include "sciwrappers.h" #include "sciwrappers.h"
#include "sci_cb.h" #include "editor.h"
#include "dialogs.h" #include "dialogs.h"
#include "msgwindow.h" #include "msgwindow.h"
#include "templates.h" #include "templates.h"
@ -1571,14 +1571,14 @@ static gboolean update_type_keywords(ScintillaObject *sci)
guint n; guint n;
const GString *s; const GString *s;
if (sci != NULL && sci_cb_lexer_get_type_keyword_idx(sci_get_lexer(sci)) == -1) if (sci != NULL && editor_lexer_get_type_keyword_idx(sci_get_lexer(sci)) == -1)
return FALSE; return FALSE;
if (! get_project_typenames(&s)) if (! get_project_typenames(&s))
{ // typenames have not changed { // typenames have not changed
if (s != NULL && sci != NULL) if (s != NULL && sci != NULL)
{ {
gint keyword_idx = sci_cb_lexer_get_type_keyword_idx(sci_get_lexer(sci)); gint keyword_idx = editor_lexer_get_type_keyword_idx(sci_get_lexer(sci));
sci_set_keywords(sci, keyword_idx, s->str); sci_set_keywords(sci, keyword_idx, s->str);
if (! delay_colourise) if (! delay_colourise)
@ -1596,7 +1596,7 @@ static gboolean update_type_keywords(ScintillaObject *sci)
if (wid) if (wid)
{ {
gint keyword_idx = sci_cb_lexer_get_type_keyword_idx(sci_get_lexer(wid)); gint keyword_idx = editor_lexer_get_type_keyword_idx(sci_get_lexer(wid));
if (keyword_idx > 0) if (keyword_idx > 0)
{ {
@ -2214,7 +2214,7 @@ void document_colourise_new()
n = g_array_index(doc_indexes, gint, i); n = g_array_index(doc_indexes, gint, i);
sci = doc_list[n].sci; sci = doc_list[n].sci;
if (! recolour || (sci && sci_cb_lexer_get_type_keyword_idx(sci_get_lexer(sci)) == -1)) if (! recolour || (sci && editor_lexer_get_type_keyword_idx(sci_get_lexer(sci)) == -1))
{ {
doc_set[n] = FALSE; doc_set[n] = FALSE;
} }

View File

@ -1,5 +1,5 @@
/* /*
* sci_cb.c - this file is part of Geany, a fast and lightweight IDE * editor.c - this file is part of Geany, a fast and lightweight IDE
* *
* Copyright 2005-2007 Enrico Tröger <enrico.troeger@uvena.de> * Copyright 2005-2007 Enrico Tröger <enrico.troeger@uvena.de>
* Copyright 2006-2007 Nick Treleaven <nick.treleaven@btinternet.com> * Copyright 2006-2007 Nick Treleaven <nick.treleaven@btinternet.com>
@ -34,7 +34,7 @@
#include "SciLexer.h" #include "SciLexer.h"
#include "geany.h" #include "geany.h"
#include "sci_cb.h" #include "editor.h"
#include "document.h" #include "document.h"
#include "sciwrappers.h" #include "sciwrappers.h"
#include "ui_utils.h" #include "ui_utils.h"
@ -87,7 +87,7 @@ on_editor_button_press_event (GtkWidget *widget,
if (event->button == 3) if (event->button == 3)
{ {
sci_cb_find_current_word(doc_list[idx].sci, editor_info.click_pos, editor_find_current_word(doc_list[idx].sci, editor_info.click_pos,
current_word, sizeof current_word, NULL); current_word, sizeof current_word, NULL);
ui_update_popup_goto_items((current_word[0] != '\0') ? TRUE : FALSE); ui_update_popup_goto_items((current_word[0] != '\0') ? TRUE : FALSE);
@ -147,7 +147,7 @@ static void on_update_ui(gint idx, G_GNUC_UNUSED SCNotification *nt)
ui_update_popup_reundo_items(idx); ui_update_popup_reundo_items(idx);
// brace highlighting // brace highlighting
sci_cb_highlight_braces(sci, pos); editor_highlight_braces(sci, pos);
ui_update_statusbar(idx, pos); ui_update_statusbar(idx, pos);
@ -203,7 +203,7 @@ static void on_char_added(gint idx, SCNotification *nt)
} }
case '(': case '(':
{ // show calltips { // show calltips
sci_cb_show_calltip(idx, --pos); editor_show_calltip(idx, --pos);
break; break;
} }
case ')': case ')':
@ -223,7 +223,7 @@ static void on_char_added(gint idx, SCNotification *nt)
if (sci_get_lexer(sci) == SCLEX_LATEX) if (sci_get_lexer(sci) == SCLEX_LATEX)
{ {
auto_close_bracket(sci, pos, nt->ch); // Tex auto-closing auto_close_bracket(sci, pos, nt->ch); // Tex auto-closing
sci_cb_show_calltip(idx, --pos); editor_show_calltip(idx, --pos);
} }
break; break;
} }
@ -231,10 +231,10 @@ static void on_char_added(gint idx, SCNotification *nt)
{ // closing bracket handling { // closing bracket handling
if (doc_list[idx].use_auto_indention && if (doc_list[idx].use_auto_indention &&
app->pref_editor_indention_mode == INDENT_ADVANCED) app->pref_editor_indention_mode == INDENT_ADVANCED)
sci_cb_close_block(idx, pos - 1); editor_close_block(idx, pos - 1);
break; break;
} }
default: sci_cb_start_auto_complete(idx, pos, FALSE); default: editor_start_auto_complete(idx, pos, FALSE);
} }
} }
@ -351,7 +351,7 @@ void on_editor_notification(GtkWidget *editor, gint scn, gpointer lscn, gpointer
case 2: calltip.tag_index++; break; // down arrow case 2: calltip.tag_index++; break; // down arrow
} }
sci_cb_show_calltip(idx, -1); editor_show_calltip(idx, -1);
} }
break; break;
} }
@ -389,7 +389,7 @@ static void on_new_line_added(ScintillaObject *sci, gint idx)
// " * " auto completion in multiline C/C++/D/Java comments // " * " auto completion in multiline C/C++/D/Java comments
auto_multiline(sci, pos); auto_multiline(sci, pos);
sci_cb_auto_latex(idx, pos); editor_auto_latex(idx, pos);
} }
} }
@ -435,7 +435,7 @@ static void do_indent(gchar *buf, gsize len, guint *idx)
/* "use_this_line" to auto-indent only if it is a real new line /* "use_this_line" to auto-indent only if it is a real new line
* and ignore the case of sci_cb_close_block */ * and ignore the case of editor_close_block */
static void get_indent(ScintillaObject *sci, gint pos, gboolean use_this_line) static void get_indent(ScintillaObject *sci, gint pos, gboolean use_this_line)
{ {
guint i, len, j = 0; guint i, len, j = 0;
@ -456,7 +456,7 @@ static void get_indent(ScintillaObject *sci, gint pos, gboolean use_this_line)
break; break;
else if (use_this_line) else if (use_this_line)
break; break;
else // sci_cb_close_block else // editor_close_block
{ {
if (! lexer_has_braces(sci)) if (! lexer_has_braces(sci))
break; break;
@ -506,7 +506,7 @@ static void auto_close_bracket(ScintillaObject *sci, gint pos, gchar c)
/* Finds a corresponding matching brace to the given pos /* Finds a corresponding matching brace to the given pos
* (this is taken from Scintilla Editor.cxx, * (this is taken from Scintilla Editor.cxx,
* fit to work with sci_cb_close_block) */ * fit to work with editor_close_block) */
static gint brace_match(ScintillaObject *sci, gint pos) static gint brace_match(ScintillaObject *sci, gint pos)
{ {
gchar chBrace = sci_get_char_at(sci, pos); gchar chBrace = sci_get_char_at(sci, pos);
@ -544,7 +544,7 @@ static gint brace_match(ScintillaObject *sci, gint pos)
/* Called after typing '}', if pref_editor_indention_mode is INDENT_ADVANCED. */ /* Called after typing '}', if pref_editor_indention_mode is INDENT_ADVANCED. */
void sci_cb_close_block(gint idx, gint pos) void editor_close_block(gint idx, gint pos)
{ {
gint x = 0, cnt = 0; gint x = 0, cnt = 0;
gint start_brace, line, line_len, eol_char_len; gint start_brace, line, line_len, eol_char_len;
@ -609,7 +609,7 @@ void sci_cb_close_block(gint idx, gint pos)
* NULL terminated in any case, even when the word is truncated because wordlen is too small. * NULL terminated in any case, even when the word is truncated because wordlen is too small.
* position can be -1, then the current position is used. * position can be -1, then the current position is used.
* wc are the wordchars to use, if NULL, GEANY_WORDCHARS will be used */ * wc are the wordchars to use, if NULL, GEANY_WORDCHARS will be used */
void sci_cb_find_current_word(ScintillaObject *sci, gint pos, gchar *word, size_t wordlen, void editor_find_current_word(ScintillaObject *sci, gint pos, gchar *word, size_t wordlen,
const gchar *wc) const gchar *wc)
{ {
gint line, line_start, startword, endword; gint line, line_start, startword, endword;
@ -794,7 +794,7 @@ static gchar *find_calltip(const gchar *word, filetype *ft)
// use pos = -1 to search for the previous unmatched open bracket. // use pos = -1 to search for the previous unmatched open bracket.
gboolean sci_cb_show_calltip(gint idx, gint pos) gboolean editor_show_calltip(gint idx, gint pos)
{ {
gint orig_pos = pos; // the position for the calltip gint orig_pos = pos; // the position for the calltip
gint lexer; gint lexer;
@ -827,7 +827,7 @@ gboolean sci_cb_show_calltip(gint idx, gint pos)
return FALSE; return FALSE;
word[0] = '\0'; word[0] = '\0';
sci_cb_find_current_word(sci, pos - 1, word, sizeof word, NULL); editor_find_current_word(sci, pos - 1, word, sizeof word, NULL);
if (word[0] == '\0') return FALSE; if (word[0] == '\0') return FALSE;
str = find_calltip(word, doc_list[idx].file_type); str = find_calltip(word, doc_list[idx].file_type);
@ -908,7 +908,7 @@ autocomplete_tags(gint idx, gchar *root, gsize rootlen)
} }
gboolean sci_cb_start_auto_complete(gint idx, gint pos, gboolean force) gboolean editor_start_auto_complete(gint idx, gint pos, gboolean force)
{ {
gint line, line_start, line_len, line_pos, current, rootlen, startword, lexer, style; gint line, line_start, line_len, line_pos, current, rootlen, startword, lexer, style;
gchar *linebuf, *root; gchar *linebuf, *root;
@ -969,7 +969,7 @@ gboolean sci_cb_start_auto_complete(gint idx, gint pos, gboolean force)
} }
void sci_cb_auto_latex(gint idx, gint pos) void editor_auto_latex(gint idx, gint pos)
{ {
ScintillaObject *sci; ScintillaObject *sci;
@ -1186,7 +1186,7 @@ static gboolean at_eol(ScintillaObject *sci, gint pos)
} }
gboolean sci_cb_auto_forif(gint idx, gint pos) gboolean editor_auto_forif(gint idx, gint pos)
{ {
gboolean result; gboolean result;
gchar buf[16]; gchar buf[16];
@ -1256,7 +1256,7 @@ gboolean sci_cb_auto_forif(gint idx, gint pos)
} }
void sci_cb_show_macro_list(ScintillaObject *sci) void editor_show_macro_list(ScintillaObject *sci)
{ {
GString *words; GString *words;
@ -1347,7 +1347,7 @@ static gboolean handle_xml(ScintillaObject *sci, gchar ch, gint idx)
if (ch == '>') if (ch == '>')
{ {
SSM(sci, SCI_SETSEL, pos, pos); SSM(sci, SCI_SETSEL, pos, pos);
if (utils_str_equal(str_found, "table")) sci_cb_auto_table(sci, pos); if (utils_str_equal(str_found, "table")) editor_auto_table(sci, pos);
} }
sci_end_undo_action(sci); sci_end_undo_action(sci);
g_free(to_insert); g_free(to_insert);
@ -1361,7 +1361,7 @@ static gboolean handle_xml(ScintillaObject *sci, gchar ch, gint idx)
} }
void sci_cb_auto_table(ScintillaObject *sci, gint pos) void editor_auto_table(ScintillaObject *sci, gint pos)
{ {
gchar *table; gchar *table;
gint indent_pos; gint indent_pos;
@ -1450,7 +1450,7 @@ static void real_uncomment_multiline(gint idx)
} }
void sci_cb_do_uncomment(gint idx, gint line) void editor_do_uncomment(gint idx, gint line)
{ {
gint first_line, last_line; gint first_line, last_line;
gint x, i, line_start, line_len; gint x, i, line_start, line_len;
@ -1591,7 +1591,7 @@ void sci_cb_do_uncomment(gint idx, gint line)
} }
void sci_cb_do_comment_toggle(gint idx) void editor_do_comment_toggle(gint idx)
{ {
gint first_line, last_line; gint first_line, last_line;
gint x, i, line_start, line_len; gint x, i, line_start, line_len;
@ -1665,7 +1665,7 @@ void sci_cb_do_comment_toggle(gint idx)
if (sel[x] == co[0]) if (sel[x] == co[0])
{ {
do_continue = TRUE; do_continue = TRUE;
sci_cb_do_uncomment(idx, i); editor_do_uncomment(idx, i);
count_uncommented++; count_uncommented++;
} }
break; break;
@ -1673,7 +1673,7 @@ void sci_cb_do_comment_toggle(gint idx)
if (sel[x] == co[0] && sel[x+1] == co[1]) if (sel[x] == co[0] && sel[x+1] == co[1])
{ {
do_continue = TRUE; do_continue = TRUE;
sci_cb_do_uncomment(idx, i); editor_do_uncomment(idx, i);
count_uncommented++; count_uncommented++;
} }
break; break;
@ -1681,7 +1681,7 @@ void sci_cb_do_comment_toggle(gint idx)
if (sel[x] == co[0] && sel[x+1] == co[1] && sel[x+2] == co[2]) if (sel[x] == co[0] && sel[x+1] == co[1] && sel[x+2] == co[2])
{ {
do_continue = TRUE; do_continue = TRUE;
sci_cb_do_uncomment(idx, i); editor_do_uncomment(idx, i);
count_uncommented++; count_uncommented++;
} }
break; break;
@ -1691,7 +1691,7 @@ void sci_cb_do_comment_toggle(gint idx)
if (do_continue) continue; if (do_continue) continue;
// we are still here, so the above lines were not already comments, so comment it // we are still here, so the above lines were not already comments, so comment it
sci_cb_do_comment(idx, i, FALSE); editor_do_comment(idx, i, FALSE);
count_commented++; count_commented++;
} }
// use multi line comment // use multi line comment
@ -1777,7 +1777,7 @@ void sci_cb_do_comment_toggle(gint idx)
} }
void sci_cb_do_comment(gint idx, gint line, gboolean allow_empty_lines) void editor_do_comment(gint idx, gint line, gboolean allow_empty_lines)
{ {
gint first_line, last_line; gint first_line, last_line;
gint x, i, line_start, line_len; gint x, i, line_start, line_len;
@ -1907,7 +1907,7 @@ void sci_cb_do_comment(gint idx, gint line, gboolean allow_empty_lines)
} }
void sci_cb_highlight_braces(ScintillaObject *sci, gint cur_pos) void editor_highlight_braces(ScintillaObject *sci, gint cur_pos)
{ {
gint brace_pos = cur_pos - 1; gint brace_pos = cur_pos - 1;
gint end_pos; gint end_pos;
@ -2148,7 +2148,7 @@ static gboolean is_comment(gint lexer, gint style)
#if 0 #if 0
gboolean sci_cb_lexer_is_c_like(gint lexer) gboolean editor_lexer_is_c_like(gint lexer)
{ {
switch (lexer) switch (lexer)
{ {
@ -2164,7 +2164,7 @@ gboolean sci_cb_lexer_is_c_like(gint lexer)
// Returns: -1 if lexer doesn't support type keywords // Returns: -1 if lexer doesn't support type keywords
gint sci_cb_lexer_get_type_keyword_idx(gint lexer) gint editor_lexer_get_type_keyword_idx(gint lexer)
{ {
switch (lexer) switch (lexer)
{ {
@ -2179,7 +2179,7 @@ gint sci_cb_lexer_get_type_keyword_idx(gint lexer)
// inserts a three-line comment at one line above current cursor position // inserts a three-line comment at one line above current cursor position
void sci_cb_insert_multiline_comment(gint idx) void editor_insert_multiline_comment(gint idx)
{ {
gchar *text; gchar *text;
gint text_len; gint text_len;
@ -2217,7 +2217,7 @@ void sci_cb_insert_multiline_comment(gint idx)
sci_set_selection_start(doc_list[idx].sci, pos); sci_set_selection_start(doc_list[idx].sci, pos);
sci_set_selection_end(doc_list[idx].sci, pos + text_len); sci_set_selection_end(doc_list[idx].sci, pos + text_len);
sci_cb_do_comment(idx, -1, TRUE); editor_do_comment(idx, -1, TRUE);
// set the current position to the start of the first inserted line // set the current position to the start of the first inserted line
pos += strlen(doc_list[idx].file_type->comment_open); pos += strlen(doc_list[idx].file_type->comment_open);
@ -2259,7 +2259,7 @@ static void scroll_to_line(ScintillaObject *sci, gint line, gfloat percent_of_vi
} }
void sci_cb_insert_alternative_whitespace(ScintillaObject *sci) void editor_insert_alternative_whitespace(ScintillaObject *sci)
{ {
// creates and inserts one tabulator sign or whitespace of the amount of the tab width // creates and inserts one tabulator sign or whitespace of the amount of the tab width
gchar *text = utils_get_whitespace(app->pref_editor_tab_width, TRUE); gchar *text = utils_get_whitespace(app->pref_editor_tab_width, TRUE);
@ -2268,7 +2268,7 @@ void sci_cb_insert_alternative_whitespace(ScintillaObject *sci)
} }
void sci_cb_select_word(ScintillaObject *sci) void editor_select_word(ScintillaObject *sci)
{ {
gint pos; gint pos;
gint start; gint start;

View File

@ -1,5 +1,5 @@
/* /*
* sci_cb.h - this file is part of Geany, a fast and lightweight IDE * editor.h - this file is part of Geany, a fast and lightweight IDE
* *
* Copyright 2005-2007 Enrico Tröger <enrico.troeger@uvena.de> * Copyright 2005-2007 Enrico Tröger <enrico.troeger@uvena.de>
* Copyright 2006-2007 Nick Treleaven <nick.treleaven@btinternet.com> * Copyright 2006-2007 Nick Treleaven <nick.treleaven@btinternet.com>
@ -51,43 +51,43 @@ on_editor_button_press_event (GtkWidget *widget,
// callback func called by all editors when a signal arises // callback func called by all editors when a signal arises
void on_editor_notification(GtkWidget* editor, gint scn, gpointer lscn, gpointer user_data); void on_editor_notification(GtkWidget* editor, gint scn, gpointer lscn, gpointer user_data);
gboolean sci_cb_start_auto_complete(gint idx, gint pos, gboolean force); gboolean editor_start_auto_complete(gint idx, gint pos, gboolean force);
void sci_cb_close_block(gint idx, gint pos); void editor_close_block(gint idx, gint pos);
gboolean sci_cb_auto_forif(gint idx, gint pos); gboolean editor_auto_forif(gint idx, gint pos);
void sci_cb_auto_latex(gint idx, gint pos); void editor_auto_latex(gint idx, gint pos);
void sci_cb_show_macro_list(ScintillaObject *sci); void editor_show_macro_list(ScintillaObject *sci);
/* Reads the word at given cursor position and writes it into the given buffer. The buffer will be /* Reads the word at given cursor position and writes it into the given buffer. The buffer will be
* NULL terminated in any case, even when the word is truncated because wordlen is too small. * NULL terminated in any case, even when the word is truncated because wordlen is too small.
* position can be -1, then the current position is used. * position can be -1, then the current position is used.
* wc are the wordchars to use, if NULL, GEANY_WORDCHARS will be used */ * wc are the wordchars to use, if NULL, GEANY_WORDCHARS will be used */
void sci_cb_find_current_word(ScintillaObject *sci, gint pos, gchar *word, size_t wordlen, void editor_find_current_word(ScintillaObject *sci, gint pos, gchar *word, size_t wordlen,
const gchar *wc); const gchar *wc);
gboolean sci_cb_show_calltip(gint idx, gint pos); gboolean editor_show_calltip(gint idx, gint pos);
void sci_cb_do_comment_toggle(gint idx); void editor_do_comment_toggle(gint idx);
void sci_cb_do_comment(gint idx, gint line, gboolean allow_empty_lines); void editor_do_comment(gint idx, gint line, gboolean allow_empty_lines);
void sci_cb_do_uncomment(gint idx, gint line); void editor_do_uncomment(gint idx, gint line);
void sci_cb_highlight_braces(ScintillaObject *sci, gint cur_pos); void editor_highlight_braces(ScintillaObject *sci, gint cur_pos);
void sci_cb_auto_table(ScintillaObject *sci, gint pos); void editor_auto_table(ScintillaObject *sci, gint pos);
gboolean sci_cb_lexer_is_c_like(gint lexer); gboolean editor_lexer_is_c_like(gint lexer);
gint sci_cb_lexer_get_type_keyword_idx(gint lexer); gint editor_lexer_get_type_keyword_idx(gint lexer);
void sci_cb_insert_multiline_comment(gint idx); void editor_insert_multiline_comment(gint idx);
void sci_cb_select_word(ScintillaObject *sci); void editor_select_word(ScintillaObject *sci);
void sci_cb_insert_alternative_whitespace(ScintillaObject *sci); void editor_insert_alternative_whitespace(ScintillaObject *sci);
#endif #endif

View File

@ -30,7 +30,7 @@
#include "SciLexer.h" #include "SciLexer.h"
#include "geany.h" #include "geany.h"
#include "highlighting.h" #include "highlighting.h"
#include "sci_cb.h" #include "editor.h"
#include "utils.h" #include "utils.h"
#include "filetypes.h" #include "filetypes.h"
#include "symbols.h" #include "symbols.h"

View File

@ -36,7 +36,7 @@
#include "callbacks.h" #include "callbacks.h"
#include "prefs.h" #include "prefs.h"
#include "msgwindow.h" #include "msgwindow.h"
#include "sci_cb.h" #include "editor.h"
#include "sciwrappers.h" #include "sciwrappers.h"
#include "build.h" #include "build.h"
#include "tools.h" #include "tools.h"
@ -617,7 +617,7 @@ static gboolean check_construct_completion(GdkEventKey *event)
gint pos = sci_get_current_position(sci); gint pos = sci_get_current_position(sci);
if (app->pref_editor_auto_complete_constructs) if (app->pref_editor_auto_complete_constructs)
return sci_cb_auto_forif(idx, pos); return editor_auto_forif(idx, pos);
} }
} }
return FALSE; return FALSE;
@ -901,7 +901,7 @@ static void cb_func_current_word(guint key_id)
pos = sci_get_current_position(doc_list[idx].sci); pos = sci_get_current_position(doc_list[idx].sci);
sci_cb_find_current_word(doc_list[idx].sci, pos, editor_find_current_word(doc_list[idx].sci, pos,
editor_info.current_word, GEANY_MAX_WORD_LENGTH, NULL); editor_info.current_word, GEANY_MAX_WORD_LENGTH, NULL);
if (*editor_info.current_word == 0) if (*editor_info.current_word == 0)
@ -1082,13 +1082,13 @@ static void cb_func_edit(guint key_id)
on_menu_uncomment_line1_activate(NULL, NULL); on_menu_uncomment_line1_activate(NULL, NULL);
break; break;
case GEANY_KEYS_EDIT_AUTOCOMPLETE: case GEANY_KEYS_EDIT_AUTOCOMPLETE:
sci_cb_start_auto_complete(idx, sci_get_current_position(doc_list[idx].sci), TRUE); editor_start_auto_complete(idx, sci_get_current_position(doc_list[idx].sci), TRUE);
break; break;
case GEANY_KEYS_EDIT_CALLTIP: case GEANY_KEYS_EDIT_CALLTIP:
sci_cb_show_calltip(idx, -1); editor_show_calltip(idx, -1);
break; break;
case GEANY_KEYS_EDIT_MACROLIST: case GEANY_KEYS_EDIT_MACROLIST:
sci_cb_show_macro_list(doc_list[idx].sci); editor_show_macro_list(doc_list[idx].sci);
break; break;
case GEANY_KEYS_EDIT_SUPPRESSCOMPLETION: case GEANY_KEYS_EDIT_SUPPRESSCOMPLETION:
@ -1106,10 +1106,10 @@ static void cb_func_edit(guint key_id)
break; break;
case GEANY_KEYS_EDIT_SELECTWORD: case GEANY_KEYS_EDIT_SELECTWORD:
sci_cb_select_word(doc_list[idx].sci); editor_select_word(doc_list[idx].sci);
break; break;
case GEANY_KEYS_EDIT_INSERTALTWHITESPACE: case GEANY_KEYS_EDIT_INSERTALTWHITESPACE:
sci_cb_insert_alternative_whitespace(doc_list[idx].sci); editor_insert_alternative_whitespace(doc_list[idx].sci);
break; break;
case GEANY_KEYS_EDIT_INCREASEINDENT: case GEANY_KEYS_EDIT_INCREASEINDENT:
on_menu_increase_indent1_activate(NULL, NULL); on_menu_increase_indent1_activate(NULL, NULL);

View File

@ -52,7 +52,7 @@
#include "treeviews.h" #include "treeviews.h"
#include "notebook.h" #include "notebook.h"
#include "keybindings.h" #include "keybindings.h"
#include "sci_cb.h" #include "editor.h"
#include "search.h" #include "search.h"
#include "build.h" #include "build.h"
#include "highlighting.h" #include "highlighting.h"

View File

@ -46,7 +46,7 @@ CCFLAGS=-Wall -O2 -g -mms-bitfields $(DEFINES) $(INCLUDEDIRS)
OBJS = treeviews.o templates.o encodings.o about.o prefs.o win32.o build.o msgwindow.o dialogs.o \ OBJS = treeviews.o templates.o encodings.o about.o prefs.o win32.o build.o msgwindow.o dialogs.o \
filetypes.o interface.o main.o support.o callbacks.o utils.o ui_utils.o socket.o \ filetypes.o interface.o main.o support.o callbacks.o utils.o ui_utils.o socket.o \
highlighting.o sci_cb.o document.o sciwrappers.o keyfile.o keybindings.o search.o notebook.o \ highlighting.o editor.o document.o sciwrappers.o keyfile.o keybindings.o search.o notebook.o \
symbols.o tools.o project.o symbols.o tools.o project.o
.c.o: .c.o:

View File

@ -36,7 +36,7 @@
#include "document.h" #include "document.h"
#include "sciwrappers.h" #include "sciwrappers.h"
#include "ui_utils.h" #include "ui_utils.h"
#include "sci_cb.h" #include "editor.h"
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
@ -220,7 +220,7 @@ static gchar *get_default_text(gint idx)
{ // use the word at current cursor position { // use the word at current cursor position
gchar word[GEANY_MAX_WORD_LENGTH]; gchar word[GEANY_MAX_WORD_LENGTH];
sci_cb_find_current_word(doc_list[idx].sci, -1, word, sizeof(word), NULL); editor_find_current_word(doc_list[idx].sci, -1, word, sizeof(word), NULL);
if (word[0] != '\0') s = g_strdup(word); if (word[0] != '\0') s = g_strdup(word);
} }
return s; return s;