aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/events.lua12
-rw-r--r--core/file_io.lua34
-rw-r--r--core/gui.lua15
-rw-r--r--modules/textadept/editing.lua9
-rw-r--r--modules/textadept/find.lua21
-rw-r--r--modules/textadept/menu.lua35
-rw-r--r--modules/textadept/mime_types.lua17
-rw-r--r--modules/textadept/session.lua15
-rw-r--r--modules/textadept/snapopen.lua21
-rw-r--r--modules/textadept/snippets.lua69
-rwxr-xr-xscripts/gen_iface.lua2
-rw-r--r--src/lua_interface.c22
-rw-r--r--src/textadept.c16
13 files changed, 138 insertions, 150 deletions
diff --git a/core/events.lua b/core/events.lua
index 3591d6df..96cb082b 100644
--- a/core/events.lua
+++ b/core/events.lua
@@ -296,9 +296,8 @@ local function set_title(buffer)
local buffer = buffer
local filename = buffer.filename or buffer._type or locale.UNTITLED
local dirty = buffer.dirty and '*' or '-'
- gui.title =
- string.format('%s %s Textadept (%s)', filename:match('[^/\\]+$'), dirty,
- filename)
+ gui.title = string.format('%s %s Textadept (%s)', filename:match('[^/\\]+$'),
+ dirty, filename)
end
connect('save_point_reached',
@@ -350,8 +349,9 @@ connect('update_ui',
local tabs = (buffer.use_tabs and locale.STATUS_TABS or
locale.STATUS_SPACES)..buffer.indent
local enc = buffer.encoding or ''
- gui.docstatusbar_text =
- locale.DOCSTATUSBAR_TEXT:format(line, max, col, lexer, eol, tabs, enc)
+ gui.docstatusbar_text = locale.DOCSTATUSBAR_TEXT:format(line, max, col,
+ lexer, eol, tabs,
+ enc)
end)
connect('margin_click',
@@ -424,7 +424,7 @@ connect('quit',
'--title', locale.EVENTS_QUIT_TITLE,
'--text', locale.EVENTS_QUIT_TEXT,
'--informative-text',
- string.format('%s', table.concat(list, '\n')),
+ string.format('%s', table.concat(list, '\n')),
'--button1', 'gtk-cancel',
'--button2', locale.EVENTS_QUIT_BUTTON2,
'--no-newline') ~= '2' then
diff --git a/core/file_io.lua b/core/file_io.lua
index 856959d4..b395984a 100644
--- a/core/file_io.lua
+++ b/core/file_io.lua
@@ -188,13 +188,12 @@ end
-- must be encoded in UTF-8.
-- @usage io.open_file(utf8_encoded_filename)
function open_file(utf8_filenames)
- utf8_filenames =
- utf8_filenames or
- gui.dialog('fileselect',
- '--title', locale.IO_OPEN_TITLE,
- '--select-multiple',
- '--with-directory',
- (buffer.filename or ''):match('.+[/\\]') or '')
+ utf8_filenames = utf8_filenames or
+ gui.dialog('fileselect',
+ '--title', locale.IO_OPEN_TITLE,
+ '--select-multiple',
+ '--with-directory',
+ (buffer.filename or ''):match('.+[/\\]') or '')
for filename in utf8_filenames:gmatch('[^\n]+') do open_helper(filename) end
end
@@ -264,14 +263,13 @@ end
local function save_as(buffer, utf8_filename)
gui.check_focused_buffer(buffer)
if not utf8_filename then
- utf8_filename =
- gui.dialog('filesave',
- '--title', locale.IO_SAVE_TITLE,
- '--with-directory',
- (buffer.filename or ''):match('.+[/\\]') or '',
- '--with-file',
- (buffer.filename or ''):match('[^/\\]+$') or '',
- '--no-newline')
+ utf8_filename = gui.dialog('filesave',
+ '--title', locale.IO_SAVE_TITLE,
+ '--with-directory',
+ (buffer.filename or ''):match('.+[/\\]') or '',
+ '--with-file',
+ (buffer.filename or ''):match('[^/\\]+$') or '',
+ '--no-newline')
end
if #utf8_filename > 0 then
buffer.filename = utf8_filename
@@ -302,8 +300,8 @@ local function close(buffer)
'--title', locale.IO_CLOSE_TITLE,
'--text', locale.IO_CLOSE_TEXT,
'--informative-text',
- string.format('%s', (buffer.filename or
- buffer._type or locale.UNTITLED)),
+ string.format('%s', (buffer.filename or
+ buffer._type or locale.UNTITLED)),
'--button1', 'gtk-cancel',
'--button2', locale.IO_CLOSE_BUTTON2,
'--no-newline') ~= '2' then
@@ -341,7 +339,7 @@ local function update_modified_file()
'--title', locale.IO_RELOAD_TITLE,
'--text', locale.IO_RELOAD_TEXT,
'--informative-text',
- string.format(locale.IO_RELOAD_MSG, utf8_filename),
+ string.format(locale.IO_RELOAD_MSG, utf8_filename),
'--no-cancel',
'--no-newline') == '1' then
buffer:reload()
diff --git a/core/gui.lua b/core/gui.lua
index fabd7ec2..b18b7afd 100644
--- a/core/gui.lua
+++ b/core/gui.lua
@@ -59,14 +59,13 @@ function gui.switch_buffer()
items[#items + 1] = dirty..filename:match('[^/\\]+$')
items[#items + 1] = filename
end
- local response =
- gui.dialog('filteredlist',
- '--title', locale.SWITCH_BUFFERS,
- '--button1', 'gtk-ok',
- '--button2', 'gtk-cancel',
- '--no-newline',
- '--columns', 'Name', 'File',
- '--items', items)
+ local response = gui.dialog('filteredlist',
+ '--title', locale.SWITCH_BUFFERS,
+ '--button1', 'gtk-ok',
+ '--button2', 'gtk-cancel',
+ '--no-newline',
+ '--columns', 'Name', 'File',
+ '--items', items)
local ok, i = response:match('(%-?%d+)\n(%d+)$')
if ok and ok ~= '2' then view:goto_buffer(tonumber(i) + 1, true) end
end
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index 7a8080bb..b9f00382 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -228,11 +228,10 @@ end
function goto_line(line)
local buffer = buffer
if not line then
- line =
- gui.dialog('standard-inputbox',
- '--title', locale.M_TEXTADEPT_EDITING_GOTO_TITLE,
- '--text', locale.M_TEXTADEPT_EDITING_GOTO_TEXT,
- '--no-newline')
+ line = gui.dialog('standard-inputbox',
+ '--title', locale.M_TEXTADEPT_EDITING_GOTO_TITLE,
+ '--text', locale.M_TEXTADEPT_EDITING_GOTO_TEXT,
+ '--no-newline')
line = tonumber(line:match('%-?%d+$'))
if not line or line < 0 then return end
end
diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua
index a1f873fe..80f24a4e 100644
--- a/modules/textadept/find.lua
+++ b/modules/textadept/find.lua
@@ -74,13 +74,12 @@ local function find_(text, next, flags, nowrap, wrapped)
end
else -- find in files
- local utf8_dir =
- gui.dialog('fileselect',
- '--title', locale.FIND_IN_FILES_TITLE,
- '--select-only-directories',
- '--with-directory',
- (buffer.filename or ''):match('^.+[/\\]') or '',
- '--no-newline')
+ local utf8_dir = gui.dialog('fileselect',
+ '--title', locale.FIND_IN_FILES_TITLE,
+ '--select-only-directories',
+ '--with-directory',
+ (buffer.filename or ''):match('^.+[/\\]') or '',
+ '--no-newline')
if #utf8_dir > 0 then
if not find.lua then text = text:gsub('([().*+?^$%%[%]-])', '%%%1') end
if not find.match_case then text = text:lower() end
@@ -264,8 +263,8 @@ local function replace_all(ftext, rtext, flags)
local s, e = anchor, current_pos
if s > e then s, e = e, s end
buffer:insert_text(e, '\n')
- local end_marker =
- buffer:marker_add(buffer:line_from_position(e + 1), MARK_FIND)
+ local end_marker = buffer:marker_add(buffer:line_from_position(e + 1),
+ MARK_FIND)
buffer:goto_pos(s)
local pos = find_(ftext, true, flags, true)
while pos ~= -1 and
@@ -282,8 +281,8 @@ local function replace_all(ftext, rtext, flags)
buffer:set_sel(anchor, current_pos)
buffer:marker_delete_handle(end_marker)
end
- gui.statusbar_text =
- string.format(locale.FIND_REPLACEMENTS_MADE, tostring(count))
+ gui.statusbar_text = string.format(locale.FIND_REPLACEMENTS_MADE,
+ tostring(count))
buffer:end_undo_action()
end
events.connect('replace_all', replace_all)
diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua
index af71519d..589c3205 100644
--- a/modules/textadept/menu.lua
+++ b/modules/textadept/menu.lua
@@ -345,14 +345,14 @@ local actions = {
[ID.CLOSE_ALL] = { io.close_all },
[ID.LOAD_SESSION] = {
function()
- local utf8_filename =
- gui.dialog('fileselect',
- '--title', l.MENU_LOAD_SESSION_TITLE,
- '--with-directory',
- (_SESSIONFILE or ''):match('.+[/\\]') or '',
- '--with-file',
- (_SESSIONFILE or ''):match('[^/\\]+$') or '',
- '--no-newline')
+ local session_file = _SESSIONFILE or ''
+ local utf8_filename = gui.dialog('fileselect',
+ '--title', l.MENU_LOAD_SESSION_TITLE,
+ '--with-directory',
+ session_file:match('.+[/\\]') or '',
+ '--with-file',
+ session_file:match('[^/\\]+$') or '',
+ '--no-newline')
if #utf8_filename > 0 then
_m.textadept.session.load(utf8_filename:iconv(_CHARSET, 'UTF-8'))
end
@@ -360,14 +360,14 @@ local actions = {
},
[ID.SAVE_SESSION] = {
function()
- local utf8_filename =
- gui.dialog('filesave',
- '--title', l.MENU_SAVE_SESSION_TITLE,
- '--with-directory',
- (_SESSIONFILE or ''):match('.+[/\\]') or '',
- '--with-file',
- (_SESSIONFILE or ''):match('[^/\\]+$') or '',
- '--no-newline')
+ local session_file = _SESSIONFILE or ''
+ local utf8_filename = gui.dialog('filesave',
+ '--title', l.MENU_SAVE_SESSION_TITLE,
+ '--with-directory',
+ session_file:match('.+[/\\]') or '',
+ '--with-file',
+ session_file:match('[^/\\]+$') or '',
+ '--no-newline')
if #utf8_filename > 0 then
_m.textadept.session.save(utf8_filename:iconv(_CHARSET, 'UTF-8'))
end
@@ -499,8 +499,7 @@ events.connect('menu_clicked',
function(menu_id)
local active_table = actions[menu_id]
if menu_id >= ID.LEXER_START and menu_id < ID.LEXER_START + 99 then
- active_table =
- { set_lexer, lexer_menu[menu_id - ID.LEXER_START + 1][1] }
+ active_table = { set_lexer, lexer_menu[menu_id - ID.LEXER_START + 1][1] }
end
local f, args
if active_table and #active_table > 0 then
diff --git a/modules/textadept/mime_types.lua b/modules/textadept/mime_types.lua
index 5d19228c..4908708f 100644
--- a/modules/textadept/mime_types.lua
+++ b/modules/textadept/mime_types.lua
@@ -282,15 +282,14 @@ events.connect('reset_after',
-- Prompts the user to select a lexer from a filtered list for the current
-- buffer.
function select_lexer()
- local out =
- gui.dialog('filteredlist',
- '--title', locale.MT_SELECT_LEXER,
- '--button1', 'gtk-ok',
- '--button2', 'gtk-cancel',
- '--no-newline',
- '--string-output',
- '--columns', 'Name',
- '--items', lexers)
+ local out = gui.dialog('filteredlist',
+ '--title', locale.MT_SELECT_LEXER,
+ '--button1', 'gtk-ok',
+ '--button2', 'gtk-cancel',
+ '--no-newline',
+ '--string-output',
+ '--columns', 'Name',
+ '--items', lexers)
local response, lexer = out:match('([^\n]+)\n([^\n]+)$')
if response and response ~= 'gtk-cancel' then buffer:set_lexer(lexer) end
end
diff --git a/modules/textadept/session.lua b/modules/textadept/session.lua
index 057ea449..59e3009a 100644
--- a/modules/textadept/session.lua
+++ b/modules/textadept/session.lua
@@ -91,7 +91,7 @@ function load(filename)
'--title', locale.M_SESSION_FILES_NOT_FOUND_TITLE,
'--text', locale.M_SESSION_FILES_NOT_FOUND_TEXT,
'--informative-text',
- string.format('%s', table.concat(not_found, '\n')))
+ string.format('%s', table.concat(not_found, '\n')))
end
return true
end
@@ -117,11 +117,11 @@ function save(filename)
local current = buffer.doc_pointer == gui.focused_doc_pointer
local anchor = current and 'anchor' or '_anchor'
local current_pos = current and 'current_pos' or '_current_pos'
- local first_visible_line =
- current and 'first_visible_line' or '_first_visible_line'
- session[#session + 1] =
- buffer_line:format(buffer[anchor] or 0, buffer[current_pos] or 0,
- buffer[first_visible_line] or 0, filename)
+ local top_line = current and 'first_visible_line' or '_first_visible_line'
+ session[#session + 1] = buffer_line:format(buffer[anchor] or 0,
+ buffer[current_pos] or 0,
+ buffer[top_line] or 0,
+ filename)
end
end
-- Write out split views.
@@ -161,8 +161,7 @@ function save(filename)
local size = gui.size
session[#session + 1] = ("size: %d %d"):format(size[1], size[2])
-- Write the session.
- local f =
- io.open(filename or _SESSIONFILE or DEFAULT_SESSION, 'wb')
+ local f = io.open(filename or _SESSIONFILE or DEFAULT_SESSION, 'wb')
if f then
f:write(table.concat(session, '\n'))
f:close()
diff --git a/modules/textadept/snapopen.lua b/modules/textadept/snapopen.lua
index da4581d3..62320835 100644
--- a/modules/textadept/snapopen.lua
+++ b/modules/textadept/snapopen.lua
@@ -15,13 +15,13 @@ module('_m.textadept.snapopen', package.seeall)
--
-- ## Examples
--
--- local snapopen = _m.textadept.snapopen
+-- local snapopen = _m.textadept.snapopen.open
--
-- -- Show all files in PATHS.
-- snapopen()
--
-- -- Show all files in the current file's directory.
--- snapopen(buffer.filename:match('^.+[/\\]'), nil, true)
+-- snapopen(buffer.filename:match('^(.+)[/\\]'), nil, true)
--
-- -- Show all Lua files in PATHS.
-- snapopen(nil, '!%.lua$')
@@ -110,16 +110,15 @@ function open(paths, filter, exclusive, depth)
gui.dialog('ok-msgbox',
'--title', locale.M_SNAPOPEN_LIMIT_EXCEEDED_TITLE,
'--informative-text',
- string.format(locale.M_SNAPOPEN_LIMIT_EXCEEDED_TEXT, MAX, MAX))
+ string.format(locale.M_SNAPOPEN_LIMIT_EXCEEDED_TEXT, MAX, MAX))
end
- local out =
- gui.dialog('filteredlist',
- '--title', locale.IO_OPEN_TITLE,
- '--button1', 'gtk-ok',
- '--button2', 'gtk-cancel',
- '--no-newline',
- '--columns', 'File',
- '--items', list)
+ local out = gui.dialog('filteredlist',
+ '--title', locale.IO_OPEN_TITLE,
+ '--button1', 'gtk-ok',
+ '--button2', 'gtk-cancel',
+ '--no-newline',
+ '--columns', 'File',
+ '--items', list)
local response, index = out:match('^(%d+)[\r\n]+(%d+)')
if response == '1' then io.open_file(list[tonumber(index) + 1]) end
end
diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua
index e8af7ac1..0c1b5e8b 100644
--- a/modules/textadept/snippets.lua
+++ b/modules/textadept/snippets.lua
@@ -163,9 +163,8 @@ local function unescape(s) return s:gsub('%%([%%`%)|#])', '%1') end
local function snippet_info()
local buffer = buffer
local s = snippet.start_pos
- local e =
- buffer:position_from_line(
- buffer:marker_line_from_handle(snippet.end_marker)) - 1
+ local e = buffer:position_from_line(
+ buffer:marker_line_from_handle(snippet.end_marker)) - 1
if e >= s then return s, e, buffer:text_range(s, e) end
end
@@ -174,8 +173,8 @@ end
-- @return string result from the code run.
local function run_lua_code(code)
code = unhandle_escapes(code)
- local env =
- setmetatable({ selected_text = buffer:get_sel_text() }, { __index = _G })
+ local env = setmetatable({ selected_text = buffer:get_sel_text() },
+ { __index = _G })
local _, val = pcall(setfenv(loadstring('return '..code), env))
return val or ''
end
@@ -201,29 +200,29 @@ local function next_tab_stop()
local ph_text = buffer:text_range(snippet.ph_pos, caret)
-- Transform mirror.
- s_text =
- s_text:gsub('%%'..index..'(%b())',
- function(mirror)
- local pattern, replacement = mirror:match('^%(([^|]+)|(.+)%)$')
- if not pattern and not replacement then return ph_text end
- return ph_text:gsub(unhandle_escapes(pattern),
- function(...)
- local arg = {...}
- local repl = replacement:gsub('%%(%d+)',
- function(i) return arg[tonumber(i)] or '' end)
- return repl:gsub('#(%b())', run_lua_code)
- end, 1)
- end)
+ local function transform_mirror(mirror)
+ local pattern, replacement = mirror:match('^%(([^|]+)|(.+)%)$')
+ if not pattern and not replacement then return ph_text end
+ return ph_text:gsub(unhandle_escapes(pattern),
+ function(...)
+ local arg = {...}
+ local repl = replacement:gsub('%%(%d+)',
+ function(i) return arg[tonumber(i)] or '' end)
+ return repl:gsub('#(%b())', run_lua_code)
+ end, 1)
+ end
+ s_text = s_text:gsub('%%'..index..'(%b())', transform_mirror)
-- Regular mirror.
s_text = s_text:gsub('()%%'..index,
- function(pos)
- for mirror, e in s_text:gmatch('%%%d+(%b())()') do
- local s = mirror:find('|')
- if s and pos > s and pos < e then return nil end -- inside transform
- end
- return ph_text
- end)
+ function(pos)
+ for mirror, e in s_text:gmatch('%%%d+(%b())()') do
+ local s = mirror:find('|')
+ -- If inside transform, do not do anything.
+ if s and pos > s and pos < e then return nil end
+ end
+ return ph_text
+ end)
buffer:set_sel(s_start, s_end)
buffer:replace_sel(s_text)
@@ -344,14 +343,13 @@ function _insert(s_text)
-- Execute Lua and shell code.
s_text = s_text:gsub('%%(%b())', run_lua_code)
- s_text =
- s_text:gsub('`([^`]+)`',
- function(code)
- local p = io.popen(code)
- local out = p:read('*all'):sub(1, -2)
- p:close()
- return out
- end)
+ s_text = s_text:gsub('`([^`]+)`',
+ function(code)
+ local p = io.popen(code)
+ local out = p:read('*all'):sub(1, -2)
+ p:close()
+ return out
+ end)
-- Initialize the new snippet. If one is running, push it onto the stack.
if snippet.index then snippet_stack[#snippet_stack + 1] = snippet end
@@ -464,9 +462,8 @@ function _show_style()
local lexer = buffer:get_lexer()
local style_num = buffer.style_at[buffer.current_pos]
local style = buffer:get_style_name(style_num)
- local text =
- string.format(locale.M_TEXTADEPT_SNIPPETS_SHOW_STYLE, lexer, style,
- style_num)
+ local text = string.format(locale.M_TEXTADEPT_SNIPPETS_SHOW_STYLE, lexer,
+ style, style_num)
buffer:call_tip_show(buffer.current_pos, text)
end
diff --git a/scripts/gen_iface.lua b/scripts/gen_iface.lua
index fcfe5bb5..0ddd6e8f 100755
--- a/scripts/gen_iface.lua
+++ b/scripts/gen_iface.lua
@@ -1,7 +1,7 @@
#!/usr/bin/lua
-- Copyright 2007-2010 Mitchell mitchell<att>caladbolg.net. See LICENSE.
-local f = io.open('../../scintillua/scite/src/IFaceTable.cxx')
+local f = io.open('../../scite-latest/scite/src/IFaceTable.cxx')
local contents = f:read('*all')
f:close()
diff --git a/src/lua_interface.c b/src/lua_interface.c
index 3c94c6fc..a23360b5 100644
--- a/src/lua_interface.c
+++ b/src/lua_interface.c
@@ -155,9 +155,9 @@ int l_load_script(const char *script_file) {
if (!retval) {
const char *errmsg = lua_tostring(lua, -1);
lua_settop(lua, 0);
- GtkWidget *dialog =
- gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK, "%s\n", errmsg);
+ GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_OK, "%s\n", errmsg);
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
}
@@ -871,8 +871,8 @@ static int l_view_mt_index(lua_State *lua) {
else if (streq(key, "size")) {
GtkWidget *editor = l_checkview(lua, 1);
if (GTK_IS_PANED(gtk_widget_get_parent(editor))) {
- int pos =
- gtk_paned_get_position(GTK_PANED(gtk_widget_get_parent(editor)));
+ int pos = gtk_paned_get_position(
+ GTK_PANED(gtk_widget_get_parent(editor)));
lua_pushinteger(lua, pos);
} else lua_pushnil(lua);
} else lua_rawget(lua, 1);
@@ -897,8 +897,8 @@ static int l_gui_mt_index(lua_State *lua) {
else if (streq(key, "focused_doc_pointer"))
lua_pushinteger(lua, SS(focused_editor, SCI_GETDOCPOINTER, 0, 0));
else if (streq(key, "clipboard_text")) {
- char *text =
- gtk_clipboard_wait_for_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD));
+ char *text = gtk_clipboard_wait_for_text(
+ gtk_clipboard_get(GDK_SELECTION_CLIPBOARD));
if (text) {
lua_pushstring(lua, text);
g_free(text);
@@ -1232,10 +1232,10 @@ static int l_cf_ce_focus(lua_State *lua) {
static int l_cf_ce_show_completions(lua_State *lua) {
luaL_checktype(lua, 1, LUA_TTABLE);
- GtkEntryCompletion *completion =
- gtk_entry_get_completion(GTK_ENTRY(command_entry));
- GtkListStore *store =
- GTK_LIST_STORE(gtk_entry_completion_get_model(completion));
+ GtkEntryCompletion *completion = gtk_entry_get_completion(
+ GTK_ENTRY(command_entry));
+ GtkListStore *store = GTK_LIST_STORE(
+ gtk_entry_completion_get_model(completion));
gtk_list_store_clear(store);
lua_pushnil(lua);
while (lua_next(lua, 1)) {
diff --git a/src/textadept.c b/src/textadept.c
index b0e35702..94fe1fb3 100644
--- a/src/textadept.c
+++ b/src/textadept.c
@@ -120,8 +120,8 @@ void create_ui() {
GList *icon_list = NULL;
const char *icons[] = { "16x16", "32x32", "48x48", "64x64", "128x128" };
for (int i = 0; i < 5; i++) {
- char *icon_file =
- g_strconcat(textadept_home, "/core/images/ta_", icons[i], ".png", NULL);
+ char *icon_file = g_strconcat(textadept_home, "/core/images/ta_", icons[i],
+ ".png", NULL);
GdkPixbuf *pb = gdk_pixbuf_new_from_file(icon_file, NULL);
if (pb) icon_list = g_list_prepend(icon_list, pb);
g_free(icon_file);
@@ -289,8 +289,8 @@ void split_window(GtkWidget *editor, int vertical) {
int first_line = SS(editor, SCI_GETFIRSTVISIBLELINE, 0, 0);
int current_pos = SS(editor, SCI_GETCURRENTPOS, 0, 0);
int anchor = SS(editor, SCI_GETANCHOR, 0, 0);
- int middle =
- (vertical ? editor->allocation.width : editor->allocation.height) / 2;
+ int middle = (vertical ? editor->allocation.width
+ : editor->allocation.height) / 2;
sptr_t curdoc = SS(editor, SCI_GETDOCPOINTER, 0, 0);
GtkWidget *neweditor = new_scintilla_window(curdoc);
@@ -547,15 +547,15 @@ GtkWidget *find_create_ui() {
GtkWidget *flabel = gtk_label_new_with_mnemonic("_Find:");
GtkWidget *rlabel = gtk_label_new_with_mnemonic("R_eplace:");
- GtkWidget *find_combo =
- gtk_combo_box_entry_new_with_model(GTK_TREE_MODEL(find_store), 0);
+ GtkWidget *find_combo = gtk_combo_box_entry_new_with_model(
+ GTK_TREE_MODEL(find_store), 0);
g_object_unref(find_store);
gtk_combo_box_set_focus_on_click(GTK_COMBO_BOX(find_combo), FALSE);
find_entry = gtk_bin_get_child(GTK_BIN(find_combo));
gtk_widget_set_name(find_entry, "textadept-find-entry");
gtk_entry_set_activates_default(GTK_ENTRY(find_entry), TRUE);
- GtkWidget *replace_combo =
- gtk_combo_box_entry_new_with_model(GTK_TREE_MODEL(repl_store), 0);
+ GtkWidget *replace_combo = gtk_combo_box_entry_new_with_model(
+ GTK_TREE_MODEL(repl_store), 0);
g_object_unref(repl_store);
gtk_combo_box_set_focus_on_click(GTK_COMBO_BOX(replace_combo), FALSE);
replace_entry = gtk_bin_get_child(GTK_BIN(replace_combo));