diff options
author | 2013-04-29 16:13:59 -0400 | |
---|---|---|
committer | 2013-04-29 16:13:59 -0400 | |
commit | 78990df4f114c45adc7fd2678ffaedf0c4124d95 (patch) | |
tree | 9e79e8f93aa07ee9384b5ddd8cc548dc3c8ea20f /core/gui.lua | |
parent | 8407377bbe3800dbc4706f584285b7a7858efabc (diff) | |
download | textadept-78990df4f114c45adc7fd2678ffaedf0c4124d95.tar.gz textadept-78990df4f114c45adc7fd2678ffaedf0c4124d95.zip |
More code cleanup.
"local buffer = buffer" and similar optimizations are not needed since lexing
the buffer is much more expensive and reaction time is limited by how fast the
keyboard can submit key presses.
Diffstat (limited to 'core/gui.lua')
-rw-r--r-- | core/gui.lua | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/core/gui.lua b/core/gui.lua index 6869468f..445a65de 100644 --- a/core/gui.lua +++ b/core/gui.lua @@ -19,8 +19,6 @@ local gui = gui -- The text displayed by the buffer statusbar. module('gui')]] -local _L = _L - -- Helper function for printing messages to buffers. -- @see gui._print local function _print(buffer_type, ...) @@ -161,6 +159,7 @@ end local theme_file = not CURSES and 'theme' or 'theme_term' local THEME + --- -- Sets the editor theme name to *name* or the default platform theme. -- Themes with *name* in the *`_USERHOME`/themes/* directory override themes of @@ -348,23 +347,21 @@ events_connect(events.APPLEEVENT_ODOC, function(uri) return events_emit(events.URI_DROPPED, 'file://'..uri) end) -local string_format = string.format local EOLs = {_L['CRLF'], _L['CR'], _L['LF']} local GETLEXERLANGUAGE = _SCINTILLA.properties.lexer_language[1] -- Sets docstatusbar text. events_connect(events.UPDATE_UI, function() - local buffer = buffer local pos = buffer.current_pos local line, max = buffer:line_from_position(pos) + 1, buffer.line_count local col = buffer.column[pos] + 1 local lexer = buffer:private_lexer_call(GETLEXERLANGUAGE):match('^[^/]+') local eol = EOLs[buffer.eol_mode + 1] - local tabs = string_format('%s %d', buffer.use_tabs and _L['Tabs:'] or + local tabs = string.format('%s %d', buffer.use_tabs and _L['Tabs:'] or _L['Spaces:'], buffer.tab_width) local enc = buffer.encoding or '' local text = not CURSES and '%s %d/%d %s %d %s %s %s %s' or '%s %d/%d %s %d %s %s %s %s' - gui.docstatusbar_text = string_format(text, _L['Line:'], line, max, + gui.docstatusbar_text = string.format(text, _L['Line:'], line, max, _L['Col:'], col, lexer, eol, tabs, enc) end) |