diff options
author | 2010-10-14 21:09:46 -0400 | |
---|---|---|
committer | 2010-10-14 21:09:46 -0400 | |
commit | 3aa3f9f30142ea40dc20cb0aba462fdc5ac0da64 (patch) | |
tree | 4627624ca45905b494e212a74ca3f5f72de7248d /core | |
parent | 8d29321eeba9f77dcd3aaaa9fd504d5f736463e7 (diff) | |
download | textadept-3aa3f9f30142ea40dc20cb0aba462fdc5ac0da64.tar.gz textadept-3aa3f9f30142ea40dc20cb0aba462fdc5ac0da64.zip |
Code formatting changes.
Diffstat (limited to 'core')
-rw-r--r-- | core/events.lua | 12 | ||||
-rw-r--r-- | core/file_io.lua | 34 | ||||
-rw-r--r-- | core/gui.lua | 15 |
3 files changed, 29 insertions, 32 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 |