diff options
Diffstat (limited to 'modules/textadept')
-rw-r--r-- | modules/textadept/editing.lua | 2 | ||||
-rw-r--r-- | modules/textadept/find.lua | 20 | ||||
-rw-r--r-- | modules/textadept/keys.lua | 162 | ||||
-rw-r--r-- | modules/textadept/macros.lua | 8 | ||||
-rw-r--r-- | modules/textadept/menu.lua | 300 | ||||
-rw-r--r-- | modules/textadept/run.lua | 2 |
6 files changed, 246 insertions, 248 deletions
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index e9014f3f..f97e5618 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -349,7 +349,7 @@ function M.goto_line(line) if not line then local button, value = ui.dialogs.inputbox{ title = _L['Go To'], informative_text = _L['Line Number:'], - button1 = _L['_OK'], button2 = _L['_Cancel'] + button1 = _L['OK'], button2 = _L['Cancel'] } line = tonumber(value) if button ~= 1 or not line then return end diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua index 368380e1..70a3f7d7 100644 --- a/modules/textadept/find.lua +++ b/modules/textadept/find.lua @@ -67,16 +67,16 @@ local M = ui.find module('ui.find')]] local _L = _L -M.find_label_text = _L['_Find:'] -M.replace_label_text = _L['R_eplace:'] -M.find_next_button_text = not CURSES and _L['Find _Next'] or _L['[Next]'] -M.find_prev_button_text = not CURSES and _L['Find _Prev'] or _L['[Prev]'] -M.replace_button_text = not CURSES and _L['_Replace'] or _L['[Replace]'] -M.replace_all_button_text = not CURSES and _L['Replace _All'] or _L['[All]'] -M.match_case_label_text = not CURSES and _L['_Match case'] or _L['Case(F1)'] -M.whole_word_label_text = not CURSES and _L['_Whole word'] or _L['Word(F2)'] -M.regex_label_text = not CURSES and _L['Rege_x'] or _L['Regex(F3)'] -M.in_files_label_text = not CURSES and _L['_In files'] or _L['Files(F4)'] +M.find_label_text = _L['Find:'] +M.replace_label_text = _L['Replace:'] +M.find_next_button_text = not CURSES and _L['Find Next'] or _L['[Next]'] +M.find_prev_button_text = not CURSES and _L['Find Prev'] or _L['[Prev]'] +M.replace_button_text = not CURSES and _L['Replace'] or _L['[Replace]'] +M.replace_all_button_text = not CURSES and _L['Replace All'] or _L['[All]'] +M.match_case_label_text = not CURSES and _L['Match case'] or _L['Case(F1)'] +M.whole_word_label_text = not CURSES and _L['Whole word'] or _L['Word(F2)'] +M.regex_label_text = not CURSES and _L['Regex'] or _L['Regex(F3)'] +M.in_files_label_text = not CURSES and _L['In files'] or _L['Files(F4)'] M.find_in_files_timeout = 10 M.INDIC_FIND = _SCINTILLA.next_indic_number() diff --git a/modules/textadept/keys.lua b/modules/textadept/keys.lua index d9fe3041..01669279 100644 --- a/modules/textadept/keys.lua +++ b/modules/textadept/keys.lua @@ -291,7 +291,7 @@ keys[not OSX and (GUI and 'cW' or 'cmw') or 'mW'] = io.close_all_buffers keys[not OSX and 'cq' or 'mq'] = quit -- Edit. -local m_edit = textadept.menu.menubar[_L['_Edit']] +local m_edit = textadept.menu.menubar[_L['Edit']] keys[not OSX and 'cz' or 'mz'] = buffer.undo if CURSES then keys.mz = keys.cz end -- ^Z suspends in some terminals if not OSX then keys.cy = buffer.redo end @@ -304,11 +304,11 @@ keys[not OSX and (GUI and 'cV' or 'mv') if GUI then keys[not OSX and 'cd' or 'md'] = buffer.line_duplicate end keys.del = buffer.clear keys[not OSX and (GUI and 'adel' or 'mdel') - or 'cdel'] = m_edit[_L['D_elete Word']][2] + or 'cdel'] = m_edit[_L['Delete Word']][2] keys[not OSX and GUI and 'ca' or 'ma'] = buffer.select_all -keys[GUI and 'cm' or 'mm'] = m_edit[_L['_Match Brace']][2] +keys[GUI and 'cm' or 'mm'] = m_edit[_L['Match Brace']][2] keys[not OSX and ((GUI or WIN32) and 'c\n' or 'cmj') - or 'cesc'] = m_edit[_L['Complete _Word']][2] + or 'cesc'] = m_edit[_L['Complete Word']][2] if GUI then keys[not OSX and 'caH' or 'mH'] = textadept.editing.highlight_word end @@ -316,41 +316,41 @@ keys[not OSX and GUI and 'c/' or 'm/'] = textadept.editing.block_comment keys.ct = textadept.editing.transpose_chars keys[not OSX and (GUI and 'cJ' or 'mj') or 'cj'] = textadept.editing.join_lines keys[not OSX and (GUI and 'c|' or 'c\\') - or 'm|'] = m_edit[_L['_Filter Through']][2] + or 'm|'] = m_edit[_L['Filter Through']][2] -- Select. -local m_sel = m_edit[_L['_Select']] -keys[GUI and 'cM' or 'mM'] = m_sel[_L['Select between _Matching Delimiters']][2] +local m_sel = m_edit[_L['Select']] +keys[GUI and 'cM' or 'mM'] = m_sel[_L['Select between Matching Delimiters']][2] keys[not OSX and GUI and 'c<' - or 'm<'] = m_sel[_L['Select between _XML Tags']][2] + or 'm<'] = m_sel[_L['Select between XML Tags']][2] if GUI then - keys[not OSX and 'c>' or 'm>'] = m_sel[_L['Select in XML _Tag']][2] + keys[not OSX and 'c>' or 'm>'] = m_sel[_L['Select in XML Tag']][2] end keys[not OSX and (GUI and 'cD' or 'mW') or 'mD'] = textadept.editing.select_word keys[not OSX and GUI and 'cN' or 'mN'] = textadept.editing.select_line keys[not OSX and GUI and 'cP' or 'mP'] = textadept.editing.select_paragraph -- Selection. -m_sel = m_edit[_L['Selectio_n']] +m_sel = m_edit[_L['Selection']] keys[not OSX and (GUI and 'cau' or 'cmu') or 'cu'] = buffer.upper_case keys[not OSX and (GUI and 'caU' or 'cml') or 'cU'] = buffer.lower_case keys[not OSX and (GUI and 'a<' or 'm>') - or 'c<'] = m_sel[_L['Enclose as _XML Tags']][2] + or 'c<'] = m_sel[_L['Enclose as XML Tags']][2] if GUI then - keys[not OSX and 'a>' or 'c>'] = m_sel[_L['Enclose as Single XML _Tag']][2] - keys[not OSX and "a'" or "c'"] = m_sel[_L['Enclose in Single _Quotes']][2] - keys[not OSX and 'a"' or 'c"'] = m_sel[_L['Enclose in _Double Quotes']][2] + keys[not OSX and 'a>' or 'c>'] = m_sel[_L['Enclose as Single XML Tag']][2] + keys[not OSX and "a'" or "c'"] = m_sel[_L['Enclose in Single Quotes']][2] + keys[not OSX and 'a"' or 'c"'] = m_sel[_L['Enclose in Double Quotes']][2] end keys[not OSX and (GUI and 'a(' or 'm)') - or 'c('] = m_sel[_L['Enclose in _Parentheses']][2] + or 'c('] = m_sel[_L['Enclose in Parentheses']][2] keys[not OSX and (GUI and 'a[' or 'm]') - or 'c['] = m_sel[_L['Enclose in _Brackets']][2] + or 'c['] = m_sel[_L['Enclose in Brackets']][2] keys[not OSX and (GUI and 'a{' or 'm}') - or 'c{'] = m_sel[_L['Enclose in B_races']][2] + or 'c{'] = m_sel[_L['Enclose in Braces']][2] keys.csup = buffer.move_selected_lines_up keys.csdown = buffer.move_selected_lines_down -- Search. -local m_search = textadept.menu.menubar[_L['_Search']] -keys[not OSX and GUI and 'cf' or 'mf'] = m_search[_L['_Find']][2] +local m_search = textadept.menu.menubar[_L['Search']] +keys[not OSX and GUI and 'cf' or 'mf'] = m_search[_L['Find']][2] if CURSES then keys.mF = keys.mf end -- mf is used by some GUI terminals keys[not OSX and GUI and 'cg' or 'mg'] = ui.find.find_next if not OSX and GUI then keys.f3 = keys.cg end @@ -364,138 +364,138 @@ keys[not OSX and (GUI and 'caR' or 'mR') or 'cR'] = ui.find.replace_all -- Replace All is aa when find pane is focused in GUI. keys[not OSX and GUI and 'caf' or 'cmf'] = ui.find.find_incremental if GUI then - keys[not OSX and 'cF' or 'mF'] = m_search[_L['Find in Fi_les']][2] + keys[not OSX and 'cF' or 'mF'] = m_search[_L['Find in Files']][2] end -- Find in Files is ai when find pane is focused in GUI. if GUI then - keys[not OSX and 'cag' or 'cmg'] = m_search[_L['Goto Nex_t File Found']][2] + keys[not OSX and 'cag' or 'cmg'] = m_search[_L['Goto Next File Found']][2] keys[not OSX and 'caG' - or 'cmG'] = m_search[_L['Goto Previou_s File Found']][2] + or 'cmG'] = m_search[_L['Goto Previous File Found']][2] end keys[not OSX and 'cj' or 'mj'] = textadept.editing.goto_line -- Tools. -local m_tools = textadept.menu.menubar[_L['_Tools']] +local m_tools = textadept.menu.menubar[_L['Tools']] keys[not OSX and (GUI and 'ce' or 'mc') - or 'me'] = m_tools[_L['Command _Entry']][2] + or 'me'] = m_tools[_L['Command Entry']][2] keys[not OSX and (GUI and 'cE' or 'mC') - or 'mE'] = m_tools[_L['Select Co_mmand']][2] + or 'mE'] = m_tools[_L['Select Command']][2] keys[not OSX and 'cr' or 'mr'] = textadept.run.run keys[not OSX and (GUI and 'cR' or 'cmr') or 'mR'] = textadept.run.compile keys[not OSX and (GUI and 'cB' or 'cmb') or 'mB'] = textadept.run.build if GUI then - keys[not OSX and 'cA' or 'mA'] = m_tools[_L['Set _Arguments...']][2] + keys[not OSX and 'cA' or 'mA'] = m_tools[_L['Set Arguments...']][2] end keys[not OSX and (GUI and 'cX' or 'cmx') or 'mX'] = textadept.run.stop keys[not OSX and (GUI and 'cae' or 'mx') - or 'cme'] = m_tools[_L['_Next Error']][2] + or 'cme'] = m_tools[_L['Next Error']][2] keys[not OSX and (GUI and 'caE' or 'mX') - or 'cmE'] = m_tools[_L['_Previous Error']][2] + or 'cmE'] = m_tools[_L['Previous Error']][2] -- Bookmark. -local m_bookmark = m_tools[_L['_Bookmarks']] +local m_bookmark = m_tools[_L['Bookmarks']] keys[not OSX and (GUI and 'cf2' or 'f1') or 'mf2'] = textadept.bookmarks.toggle keys[not OSX and (GUI and 'csf2' or 'f6') or 'msf2'] = textadept.bookmarks.clear -keys.f2 = m_bookmark[_L['_Next Bookmark']][2] -keys[GUI and 'sf2' or 'f3'] = m_bookmark[_L['_Previous Bookmark']][2] +keys.f2 = m_bookmark[_L['Next Bookmark']][2] +keys[GUI and 'sf2' or 'f3'] = m_bookmark[_L['Previous Bookmark']][2] keys[GUI and 'af2' or 'f4'] = textadept.bookmarks.goto_mark -- Macros. keys.f9 = textadept.macros.record keys[GUI and 'sf9' or 'f10'] = textadept.macros.play -- Quick Open. -local m_quick_open = m_tools[_L['Quick _Open']] -keys[not OSX and 'cu' or 'mu'] = m_quick_open[_L['Quickly Open _User Home']][2] --- TODO: m_quick_open[_L['Quickly Open _Textadept Home']][2] +local m_quick_open = m_tools[_L['Quick Open']] +keys[not OSX and 'cu' or 'mu'] = m_quick_open[_L['Quickly Open User Home']][2] +-- TODO: m_quick_open[_L['Quickly Open Textadept Home']][2] keys[not OSX and (GUI and 'caO' or 'mO') - or 'cmO'] = m_quick_open[_L['Quickly Open _Current Directory']][2] + or 'cmO'] = m_quick_open[_L['Quickly Open Current Directory']][2] keys[not OSX and (GUI and 'caP' or 'cmp') or 'cmP'] = io.quick_open -- Snippets. -local m_snippets = m_tools[_L['_Snippets']] +local m_snippets = m_tools[_L['Snippets']] keys[not OSX and (GUI and 'cK' or 'mK') or 'sa\t'] = textadept.snippets._select keys['\t'] = textadept.snippets._insert keys['s\t'] = textadept.snippets._previous keys.esc = textadept.snippets._cancel_current keys[not OSX and (GUI and 'ck' or 'mk') - or 'a\t'] = m_snippets[_L['Complete Trigger _Word']][2] + or 'a\t'] = m_snippets[_L['Complete Trigger Word']][2] -- Other. -keys[not OSX and 'c ' or 'aesc'] = m_tools[_L['_Complete Symbol']][2] +keys[not OSX and 'c ' or 'aesc'] = m_tools[_L['Complete Symbol']][2] keys[GUI and 'ch' or 'mh'] = textadept.editing.show_documentation if CURSES then keys.mH = keys.mh end -- mh is used by some GUI terminals -keys[not OSX and (GUI and 'ci' or 'mI') or 'mi'] = m_tools[_L['Show St_yle']][2] +keys[not OSX and (GUI and 'ci' or 'mI') or 'mi'] = m_tools[_L['Show Style']][2] -- Buffer. -local m_buffer = textadept.menu.menubar[_L['_Buffer']] -keys[GUI and 'c\t' or 'mn'] = m_buffer[_L['_Next Buffer']][2] -keys[GUI and 'cs\t' or 'mp'] = m_buffer[_L['_Previous Buffer']][2] +local m_buffer = textadept.menu.menubar[_L['Buffer']] +keys[GUI and 'c\t' or 'mn'] = m_buffer[_L['Next Buffer']][2] +keys[GUI and 'cs\t' or 'mp'] = m_buffer[_L['Previous Buffer']][2] keys[not OSX and GUI and 'cb' or 'mb'] = ui.switch_buffer if CURSES then keys.mB = keys.mb end -- mb is used by some GUI terminals -- Indentation. -local m_indentation = m_buffer[_L['_Indentation']] --- TODO: m_indentation[_L['Tab width: _2']][2] --- TODO: m_indentation[_L['Tab width: _3']][2] --- TODO: m_indentation[_L['Tab width: _4']][2] --- TODO: m_indentation[_L['Tab width: _8']][2] +local m_indentation = m_buffer[_L['Indentation']] +-- TODO: m_indentation[_L['Tab width: 2']][2] +-- TODO: m_indentation[_L['Tab width: 3']][2] +-- TODO: m_indentation[_L['Tab width: 4']][2] +-- TODO: m_indentation[_L['Tab width: 8']][2] keys[not OSX and (GUI and 'caT' or 'mt') - or 'cT'] = m_indentation[_L['_Toggle Use Tabs']][2] + or 'cT'] = m_indentation[_L['Toggle Use Tabs']][2] if CURSES then keys.mT = keys.mt end -- mt is used by some GUI terminals keys[not OSX and (GUI and 'cai' or 'mi') or 'ci'] = textadept.editing.convert_indentation -- EOL Mode. --- TODO: m_buffer[_L['_EOL Mode']][_L['CRLF']][2] --- TODO: m_buffer[_L['_EOL Mode']][_L['LF']][2] +-- TODO: m_buffer[_L['EOL Mode']][_L['CRLF']][2] +-- TODO: m_buffer[_L['EOL Mode']][_L['LF']][2] -- Encoding. --- TODO: m_buffer[_L['E_ncoding']][_L['_UTF-8 Encoding']][2] --- TODO: m_buffer[_L['E_ncoding']][_L['_ASCII Encoding']][2] --- TODO: m_buffer[_L['E_ncoding']][_L['_CP-1252 Encoding']][2] --- TODO: m_buffer[_L['E_ncoding']][_L['UTF-1_6 Encoding']][2] +-- TODO: m_buffer[_L['Encoding']][_L['UTF-8 Encoding']][2] +-- TODO: m_buffer[_L['Encoding']][_L['ASCII Encoding']][2] +-- TODO: m_buffer[_L['Encoding']][_L['CP-1252 Encoding']][2] +-- TODO: m_buffer[_L['Encoding']][_L['UTF-16 Encoding']][2] if GUI then - keys[not OSX and 'ca\n' or 'c\n'] = m_buffer[_L['Toggle View _EOL']][2] - keys[not OSX and 'ca\\' or 'c\\'] = m_buffer[_L['Toggle _Wrap Mode']][2] - keys[not OSX and 'caS' or 'cS'] = m_buffer[_L['Toggle View White_space']][2] + keys[not OSX and 'ca\n' or 'c\n'] = m_buffer[_L['Toggle View EOL']][2] + keys[not OSX and 'ca\\' or 'c\\'] = m_buffer[_L['Toggle Wrap Mode']][2] + keys[not OSX and 'caS' or 'cS'] = m_buffer[_L['Toggle View Whitespace']][2] end keys[not OSX and GUI and 'cL' or 'mL'] = textadept.file_types.select_lexer -keys.f5 = m_buffer[_L['_Refresh Syntax Highlighting']][2] +keys.f5 = m_buffer[_L['Refresh Syntax Highlighting']][2] if CURSES then keys.cl = keys.f5 end -- View. -local m_view = textadept.menu.menubar[_L['_View']] +local m_view = textadept.menu.menubar[_L['View']] if GUI then - keys[not OSX and 'can' or 'ca\t'] = m_view[_L['_Next View']][2] - keys[not OSX and 'cap' or 'cas\t'] = m_view[_L['_Previous View']][2] - keys[not OSX and 'cas' or 'cs'] = m_view[_L['Split View _Horizontal']][2] + keys[not OSX and 'can' or 'ca\t'] = m_view[_L['Next View']][2] + keys[not OSX and 'cap' or 'cas\t'] = m_view[_L['Previous View']][2] + keys[not OSX and 'cas' or 'cs'] = m_view[_L['Split View Horizontal']][2] if not OSX then keys.cah = keys.cas end - keys[not OSX and 'cav' or 'cv'] = m_view[_L['Split View _Vertical']][2] - keys[not OSX and 'caw' or 'cw'] = m_view[_L['_Unsplit View']][2] - keys[not OSX and 'caW' or 'cW'] = m_view[_L['Unsplit _All Views']][2] - keys[not OSX and 'ca+' or 'c+'] = m_view[_L['_Grow View']][2] + keys[not OSX and 'cav' or 'cv'] = m_view[_L['Split View Vertical']][2] + keys[not OSX and 'caw' or 'cw'] = m_view[_L['Unsplit View']][2] + keys[not OSX and 'caW' or 'cW'] = m_view[_L['Unsplit All Views']][2] + keys[not OSX and 'ca+' or 'c+'] = m_view[_L['Grow View']][2] keys[not OSX and 'ca=' or 'c='] = keys[not OSX and 'ca+' or 'c+'] - keys[not OSX and 'ca-' or 'c-'] = m_view[_L['Shrin_k View']][2] + keys[not OSX and 'ca-' or 'c-'] = m_view[_L['Shrink View']][2] else keys.cmv = { - n = m_view[_L['_Next View']][2], - p = m_view[_L['_Previous View']][2], - s = m_view[_L['Split View _Horizontal']][2], - v = m_view[_L['Split View _Vertical']][2], - w = m_view[_L['_Unsplit View']][2], - W = m_view[_L['Unsplit _All Views']][2], - ['+'] = m_view[_L['_Grow View']][2], - ['-'] = m_view[_L['Shrin_k View']][2] + n = m_view[_L['Next View']][2], + p = m_view[_L['Previous View']][2], + s = m_view[_L['Split View Horizontal']][2], + v = m_view[_L['Split View Vertical']][2], + w = m_view[_L['Unsplit View']][2], + W = m_view[_L['Unsplit All Views']][2], + ['+'] = m_view[_L['Grow View']][2], + ['-'] = m_view[_L['Shrink View']][2] } if not OSX then keys.cmv.h = keys.cmv.s end keys.cmv['='] = keys.cmv['+'] end -keys[not OSX and GUI and 'c*' or 'm*'] = m_view[_L['Toggle Current _Fold']][2] +keys[not OSX and GUI and 'c*' or 'm*'] = m_view[_L['Toggle Current Fold']][2] if GUI then - keys[not OSX and 'caI' or 'cI'] = m_view[_L['Toggle Show In_dent Guides']][2] - keys[not OSX and 'caV' or 'cV'] = m_view[_L['Toggle _Virtual Space']][2] + keys[not OSX and 'caI' or 'cI'] = m_view[_L['Toggle Show Indent Guides']][2] + keys[not OSX and 'caV' or 'cV'] = m_view[_L['Toggle Virtual Space']][2] end keys[not OSX and GUI and 'c=' or 'm='] = buffer.zoom_in keys[not OSX and GUI and 'c-' or 'm-'] = buffer.zoom_out -keys[not OSX and GUI and 'c0' or 'm0'] = m_view[_L['_Reset Zoom']][2] +keys[not OSX and GUI and 'c0' or 'm0'] = m_view[_L['Reset Zoom']][2] -- Help. if GUI then - keys.f1 = textadept.menu.menubar[_L['_Help']][_L['Show _Manual']][2] - keys.sf1 = textadept.menu.menubar[_L['_Help']][_L['Show _LuaDoc']][2] + keys.f1 = textadept.menu.menubar[_L['Help']][_L['Show Manual']][2] + keys.sf1 = textadept.menu.menubar[_L['Help']][_L['Show LuaDoc']][2] end -- Movement commands. diff --git a/modules/textadept/macros.lua b/modules/textadept/macros.lua index b10d1994..123c0392 100644 --- a/modules/textadept/macros.lua +++ b/modules/textadept/macros.lua @@ -15,12 +15,12 @@ local recording, macro -- ultimately executed will be recorded in some form. local ignore events.connect(events.INITIALIZED, function() - local m_tools = textadept.menu.menubar[_L['_Tools']] + local m_tools = textadept.menu.menubar[_L['Tools']] ignore = { - textadept.menu.menubar[_L['_Search']][_L['_Find']][2], + textadept.menu.menubar[_L['Search']][_L['Find']][2], ui.find.find_incremental, - m_tools[_L['Select Co_mmand']][2], - m_tools[_L['_Macros']][_L['Start/Stop _Recording']][2] + m_tools[_L['Select Command']][2], + m_tools[_L['Macros']][_L['Start/Stop Recording']][2] } end) diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua index 5fc4f1f6..37c7cd59 100644 --- a/modules/textadept/menu.lua +++ b/modules/textadept/menu.lua @@ -53,122 +53,122 @@ end -- addition to table index number. -- @class table -- @name menubar --- @usage textadept.menu.menubar[_L['_File']][_L['_New']] --- @usage textadept.menu.menubar[_L['_File']][_L['_New']][2] = function() .. end +-- @usage textadept.menu.menubar[_L['File']][_L['New']] +-- @usage textadept.menu.menubar[_L['File']][_L['New']][2] = function() .. end local default_menubar = { { - title = _L['_File'], - {_L['_New'], buffer.new}, - {_L['_Open'], io.open_file}, - {_L['Open _Recent...'], io.open_recent_file}, - {_L['Re_load'], io.reload_file}, - {_L['_Save'], io.save_file}, - {_L['Save _As'], io.save_file_as}, + title = _L['File'], + {_L['New'], buffer.new}, + {_L['Open'], io.open_file}, + {_L['Open Recent...'], io.open_recent_file}, + {_L['Reload'], io.reload_file}, + {_L['Save'], io.save_file}, + {_L['Save As'], io.save_file_as}, {_L['Save All'], io.save_all_files}, SEPARATOR, - {_L['_Close'], io.close_buffer}, + {_L['Close'], io.close_buffer}, {_L['Close All'], io.close_all_buffers}, SEPARATOR, - {_L['Loa_d Session...'], textadept.session.load}, - {_L['Sav_e Session...'], textadept.session.save}, + {_L['Load Session...'], textadept.session.load}, + {_L['Save Session...'], textadept.session.save}, SEPARATOR, - {_L['_Quit'], quit} + {_L['Quit'], quit} }, { - title = _L['_Edit'], - {_L['_Undo'], buffer.undo}, - {_L['_Redo'], buffer.redo}, + title = _L['Edit'], + {_L['Undo'], buffer.undo}, + {_L['Redo'], buffer.redo}, SEPARATOR, - {_L['Cu_t'], buffer.cut}, - {_L['_Copy'], buffer.copy}, - {_L['_Paste'], buffer.paste}, - {_L['Paste Re_indent'], textadept.editing.paste_reindent}, - {_L['Duplicate _Line'], buffer.line_duplicate}, - {_L['_Delete'], buffer.clear}, - {_L['D_elete Word'], function() + {_L['Cut'], buffer.cut}, + {_L['Copy'], buffer.copy}, + {_L['Paste'], buffer.paste}, + {_L['Paste Reindent'], textadept.editing.paste_reindent}, + {_L['Duplicate Line'], buffer.line_duplicate}, + {_L['Delete'], buffer.clear}, + {_L['Delete Word'], function() textadept.editing.select_word() buffer:delete_back() end}, - {_L['Select _All'], buffer.select_all}, + {_L['Select All'], buffer.select_all}, SEPARATOR, - {_L['_Match Brace'], function() + {_L['Match Brace'], function() local match_pos = buffer:brace_match(buffer.current_pos, 0) if match_pos >= 0 then buffer:goto_pos(match_pos) end end}, - {_L['Complete _Word'], function() + {_L['Complete Word'], function() textadept.editing.autocomplete('word') end}, - {_L['_Highlight Word'], textadept.editing.highlight_word}, - {_L['Toggle _Block Comment'], textadept.editing.block_comment}, - {_L['T_ranspose Characters'], textadept.editing.transpose_chars}, - {_L['_Join Lines'], textadept.editing.join_lines}, - {_L['_Filter Through'], function() + {_L['Highlight Word'], textadept.editing.highlight_word}, + {_L['Toggle Block Comment'], textadept.editing.block_comment}, + {_L['Transpose Characters'], textadept.editing.transpose_chars}, + {_L['Join Lines'], textadept.editing.join_lines}, + {_L['Filter Through'], function() ui.command_entry.run(textadept.editing.filter_through, 'bash') end}, { - title = _L['_Select'], - {_L['Select between _Matching Delimiters'], sel_enc}, - {_L['Select between _XML Tags'], function() sel_enc('>', '<') end}, - {_L['Select in XML _Tag'], function() sel_enc('<', '>') end}, - {_L['Select _Word'], textadept.editing.select_word}, - {_L['Select _Line'], textadept.editing.select_line}, - {_L['Select Para_graph'], textadept.editing.select_paragraph} + title = _L['Select'], + {_L['Select between Matching Delimiters'], sel_enc}, + {_L['Select between XML Tags'], function() sel_enc('>', '<') end}, + {_L['Select in XML Tag'], function() sel_enc('<', '>') end}, + {_L['Select Word'], textadept.editing.select_word}, + {_L['Select Line'], textadept.editing.select_line}, + {_L['Select Paragraph'], textadept.editing.select_paragraph} }, { - title = _L['Selectio_n'], - {_L['_Upper Case Selection'], buffer.upper_case}, - {_L['_Lower Case Selection'], buffer.lower_case}, + title = _L['Selection'], + {_L['Upper Case Selection'], buffer.upper_case}, + {_L['Lower Case Selection'], buffer.lower_case}, SEPARATOR, - {_L['Enclose as _XML Tags'], function() + {_L['Enclose as XML Tags'], function() enc('<', '>') local pos = buffer.current_pos while buffer.char_at[pos - 1] ~= 60 do pos = pos - 1 end -- '<' buffer:insert_text(-1, '</'..buffer:text_range(pos, buffer.current_pos)) end}, - {_L['Enclose as Single XML _Tag'], function() enc('<', ' />') end}, - {_L['Enclose in Single _Quotes'], function() enc("'", "'") end}, - {_L['Enclose in _Double Quotes'], function() enc('"', '"') end}, - {_L['Enclose in _Parentheses'], function() enc('(', ')') end}, - {_L['Enclose in _Brackets'], function() enc('[', ']') end}, - {_L['Enclose in B_races'], function() enc('{', '}') end}, + {_L['Enclose as Single XML Tag'], function() enc('<', ' />') end}, + {_L['Enclose in Single Quotes'], function() enc("'", "'") end}, + {_L['Enclose in Double Quotes'], function() enc('"', '"') end}, + {_L['Enclose in Parentheses'], function() enc('(', ')') end}, + {_L['Enclose in Brackets'], function() enc('[', ']') end}, + {_L['Enclose in Braces'], function() enc('{', '}') end}, SEPARATOR, - {_L['_Move Selected Lines Up'], buffer.move_selected_lines_up}, - {_L['Move Selected Lines Do_wn'], buffer.move_selected_lines_down} + {_L['Move Selected Lines Up'], buffer.move_selected_lines_up}, + {_L['Move Selected Lines Down'], buffer.move_selected_lines_down} } }, { - title = _L['_Search'], - {_L['_Find'], function() + title = _L['Search'], + {_L['Find'], function() ui.find.in_files = false ui.find.focus() end}, - {_L['Find _Next'], ui.find.find_next}, - {_L['Find _Previous'], ui.find.find_prev}, - {_L['_Replace'], ui.find.replace}, - {_L['Replace _All'], ui.find.replace_all}, - {_L['Find _Incremental'], ui.find.find_incremental}, + {_L['Find Next'], ui.find.find_next}, + {_L['Find Previous'], ui.find.find_prev}, + {_L['Replace'], ui.find.replace}, + {_L['Replace All'], ui.find.replace_all}, + {_L['Find Incremental'], ui.find.find_incremental}, SEPARATOR, - {_L['Find in Fi_les'], function() + {_L['Find in Files'], function() ui.find.in_files = true ui.find.focus() end}, - {_L['Goto Nex_t File Found'], function() + {_L['Goto Next File Found'], function() ui.find.goto_file_found(false, true) end}, - {_L['Goto Previou_s File Found'], function() + {_L['Goto Previous File Found'], function() ui.find.goto_file_found(false, false) end}, SEPARATOR, - {_L['_Jump to'], textadept.editing.goto_line} + {_L['Jump to'], textadept.editing.goto_line} }, { - title = _L['_Tools'], - {_L['Command _Entry'], ui.command_entry.run}, - {_L['Select Co_mmand'], function() M.select_command() end}, + title = _L['Tools'], + {_L['Command Entry'], ui.command_entry.run}, + {_L['Select Command'], function() M.select_command() end}, SEPARATOR, - {_L['_Run'], textadept.run.run}, - {_L['_Compile'], textadept.run.compile}, - {_L['Set _Arguments...'], function() + {_L['Run'], textadept.run.run}, + {_L['Compile'], textadept.run.compile}, + {_L['Set Arguments...'], function() if not buffer.filename then return end local run_commands = textadept.run.run_commands local compile_commands = textadept.run.compile_commands @@ -183,7 +183,7 @@ local default_menubar = { utf8_args[i] = args:iconv('UTF-8', _CHARSET) end local button, utf8_args = ui.dialogs.inputbox{ - title = _L['Set _Arguments...']:gsub('_', ''), informative_text = { + title = _L['Set Arguments...']:gsub('_', ''), informative_text = { _L['Command line arguments'], _L['For Run:'], _L['For Compile:'] }, text = utf8_args, width = not CURSES and 400 or nil } @@ -195,61 +195,59 @@ local default_menubar = { utf8_args[i]:iconv(_CHARSET, 'UTF-8') end end}, - {_L['Buil_d'], textadept.run.build}, - {_L['S_top'], textadept.run.stop}, - {_L['_Next Error'], function() textadept.run.goto_error(false, true) end}, - {_L['_Previous Error'], function() + {_L['Build'], textadept.run.build}, + {_L['Stop'], textadept.run.stop}, + {_L['Next Error'], function() textadept.run.goto_error(false, true) end}, + {_L['Previous Error'], function() textadept.run.goto_error(false, false) end}, SEPARATOR, { - title = _L['_Bookmarks'], - {_L['_Toggle Bookmark'], textadept.bookmarks.toggle}, - {_L['_Clear Bookmarks'], textadept.bookmarks.clear}, - {_L['_Next Bookmark'], function() - textadept.bookmarks.goto_mark(true) - end}, - {_L['_Previous Bookmark'], function() + title = _L['Bookmarks'], + {_L['Toggle Bookmark'], textadept.bookmarks.toggle}, + {_L['Clear Bookmarks'], textadept.bookmarks.clear}, + {_L['Next Bookmark'], function() textadept.bookmarks.goto_mark(true) end}, + {_L['Previous Bookmark'], function() textadept.bookmarks.goto_mark(false) end}, - {_L['_Goto Bookmark...'], textadept.bookmarks.goto_mark}, + {_L['Goto Bookmark...'], textadept.bookmarks.goto_mark}, }, { - title = _L['_Macros'], - {_L['Start/Stop _Recording'], textadept.macros.record}, - {_L['_Play'], textadept.macros.play}, + title = _L['Macros'], + {_L['Start/Stop Recording'], textadept.macros.record}, + {_L['Play'], textadept.macros.play}, SEPARATOR, - {_L['Sa_ve...'], textadept.macros.save}, - {_L['_Load...'], textadept.macros.load}, + {_L['Save...'], textadept.macros.save}, + {_L['Load...'], textadept.macros.load}, }, { - title = _L['Quick _Open'], - {_L['Quickly Open _User Home'], function() io.quick_open(_USERHOME) end}, - {_L['Quickly Open _Textadept Home'], function() io.quick_open(_HOME) end}, - {_L['Quickly Open _Current Directory'], function() + title = _L['Quick Open'], + {_L['Quickly Open User Home'], function() io.quick_open(_USERHOME) end}, + {_L['Quickly Open Textadept Home'], function() io.quick_open(_HOME) end}, + {_L['Quickly Open Current Directory'], function() if buffer.filename then io.quick_open(buffer.filename:match('^(.+)[/\\]')) end end}, - {_L['Quickly Open Current _Project'], io.quick_open}, + {_L['Quickly Open Current Project'], io.quick_open}, }, { - title = _L['_Snippets'], - {_L['_Insert Snippet...'], textadept.snippets._select}, - {_L['_Expand Snippet/Next Placeholder'], textadept.snippets._insert}, - {_L['_Previous Snippet Placeholder'], textadept.snippets._previous}, - {_L['_Cancel Snippet'], textadept.snippets._cancel_current}, + title = _L['Snippets'], + {_L['Insert Snippet...'], textadept.snippets._select}, + {_L['Expand Snippet/Next Placeholder'], textadept.snippets._insert}, + {_L['Previous Snippet Placeholder'], textadept.snippets._previous}, + {_L['Cancel Snippet'], textadept.snippets._cancel_current}, SEPARATOR, - {_L['Complete Trigger _Word'], function() + {_L['Complete Trigger Word'], function() textadept.editing.autocomplete('snippets') end} }, SEPARATOR, - {_L['_Complete Symbol'], function() + {_L['Complete Symbol'], function() textadept.editing.autocomplete(buffer:get_lexer(true)) end}, - {_L['Show _Documentation'], textadept.editing.show_documentation}, - {_L['Show St_yle'], function() + {_L['Show Documentation'], textadept.editing.show_documentation}, + {_L['Show Style'], function() local char = buffer:text_range(buffer.current_pos, buffer:position_after(buffer.current_pos)) if char == '' then return end -- end of buffer @@ -263,92 +261,92 @@ local default_menubar = { end} }, { - title = _L['_Buffer'], - {_L['_Next Buffer'], function() view:goto_buffer(1) end}, - {_L['_Previous Buffer'], function() view:goto_buffer(-1) end}, - {_L['_Switch to Buffer...'], ui.switch_buffer}, + title = _L['Buffer'], + {_L['Next Buffer'], function() view:goto_buffer(1) end}, + {_L['Previous Buffer'], function() view:goto_buffer(-1) end}, + {_L['Switch to Buffer...'], ui.switch_buffer}, SEPARATOR, { - title = _L['_Indentation'], - {_L['Tab width: _2'], function() set_indentation(2) end}, - {_L['Tab width: _3'], function() set_indentation(3) end}, - {_L['Tab width: _4'], function() set_indentation(4) end}, - {_L['Tab width: _8'], function() set_indentation(8) end}, + title = _L['Indentation'], + {_L['Tab width: 2'], function() set_indentation(2) end}, + {_L['Tab width: 3'], function() set_indentation(3) end}, + {_L['Tab width: 4'], function() set_indentation(4) end}, + {_L['Tab width: 8'], function() set_indentation(8) end}, SEPARATOR, - {_L['_Toggle Use Tabs'], function() + {_L['Toggle Use Tabs'], function() buffer.use_tabs = not buffer.use_tabs events.emit(events.UPDATE_UI) -- for updating statusbar end}, - {_L['_Convert Indentation'], textadept.editing.convert_indentation} + {_L['Convert Indentation'], textadept.editing.convert_indentation} }, { - title = _L['_EOL Mode'], + title = _L['EOL Mode'], {_L['CRLF'], function() set_eol_mode(buffer.EOL_CRLF) end}, {_L['LF'], function() set_eol_mode(buffer.EOL_LF) end} }, { - title = _L['E_ncoding'], - {_L['_UTF-8 Encoding'], function() set_encoding('UTF-8') end}, - {_L['_ASCII Encoding'], function() set_encoding('ASCII') end}, - {_L['_CP-1252 Encoding'], function() set_encoding('CP1252') end}, - {_L['UTF-1_6 Encoding'], function() set_encoding('UTF-16LE') end} + title = _L['Encoding'], + {_L['UTF-8 Encoding'], function() set_encoding('UTF-8') end}, + {_L['ASCII Encoding'], function() set_encoding('ASCII') end}, + {_L['CP-1252 Encoding'], function() set_encoding('CP1252') end}, + {_L['UTF-16 Encoding'], function() set_encoding('UTF-16LE') end} }, SEPARATOR, - {_L['Toggle View _EOL'], function() + {_L['Toggle View EOL'], function() buffer.view_eol = not buffer.view_eol end}, - {_L['Toggle _Wrap Mode'], function() + {_L['Toggle Wrap Mode'], function() local first_visible_line = buffer.first_visible_line local display_line = buffer:visible_from_doc_line(first_visible_line) buffer.wrap_mode = buffer.wrap_mode == 0 and buffer.WRAP_WHITESPACE or 0 buffer:line_scroll(0, first_visible_line - display_line) end}, - {_L['Toggle View White_space'], function() + {_L['Toggle View Whitespace'], function() buffer.view_ws = buffer.view_ws == 0 and buffer.WS_VISIBLEALWAYS or 0 end}, SEPARATOR, - {_L['Select _Lexer...'], textadept.file_types.select_lexer}, - {_L['_Refresh Syntax Highlighting'], function() buffer:colourise(0, -1) end} + {_L['Select Lexer...'], textadept.file_types.select_lexer}, + {_L['Refresh Syntax Highlighting'], function() buffer:colourise(0, -1) end} }, { - title = _L['_View'], - {_L['_Next View'], function() ui.goto_view(1) end}, - {_L['_Previous View'], function() ui.goto_view(-1) end}, + title = _L['View'], + {_L['Next View'], function() ui.goto_view(1) end}, + {_L['Previous View'], function() ui.goto_view(-1) end}, SEPARATOR, - {_L['Split View _Horizontal'], function() view:split() end}, - {_L['Split View _Vertical'], function() view:split(true) end}, - {_L['_Unsplit View'], function() view:unsplit() end}, - {_L['Unsplit _All Views'], function() while view:unsplit() do end end}, - {_L['_Grow View'], function() + {_L['Split View Horizontal'], function() view:split() end}, + {_L['Split View Vertical'], function() view:split(true) end}, + {_L['Unsplit View'], function() view:unsplit() end}, + {_L['Unsplit All Views'], function() while view:unsplit() do end end}, + {_L['Grow View'], function() if view.size then view.size = view.size + buffer:text_height(0) end end}, - {_L['Shrin_k View'], function() + {_L['Shrink View'], function() if view.size then view.size = view.size - buffer:text_height(0) end end}, SEPARATOR, - {_L['Toggle Current _Fold'], function() + {_L['Toggle Current Fold'], function() buffer:toggle_fold(buffer:line_from_position(buffer.current_pos)) end}, SEPARATOR, - {_L['Toggle Show In_dent Guides'], function() + {_L['Toggle Show Indent Guides'], function() local off = buffer.indentation_guides == 0 buffer.indentation_guides = off and buffer.IV_LOOKBOTH or 0 end}, - {_L['Toggle _Virtual Space'], function() + {_L['Toggle Virtual Space'], function() local off = buffer.virtual_space_options == 0 buffer.virtual_space_options = off and buffer.VS_USERACCESSIBLE or 0 end}, SEPARATOR, - {_L['Zoom _In'], buffer.zoom_in}, - {_L['Zoom _Out'], buffer.zoom_out}, - {_L['_Reset Zoom'], function() buffer.zoom = 0 end} + {_L['Zoom In'], buffer.zoom_in}, + {_L['Zoom Out'], buffer.zoom_out}, + {_L['Reset Zoom'], function() buffer.zoom = 0 end} }, { - title = _L['_Help'], - {_L['Show _Manual'], function() open_page(_HOME..'/doc/manual.html') end}, - {_L['Show _LuaDoc'], function() open_page(_HOME..'/doc/api.html') end}, + title = _L['Help'], + {_L['Show Manual'], function() open_page(_HOME..'/doc/manual.html') end}, + {_L['Show LuaDoc'], function() open_page(_HOME..'/doc/api.html') end}, SEPARATOR, - {_L['_About'], function() + {_L['About'], function() ui.dialogs.msgbox({ title = 'Textadept', text = _RELEASE, informative_text = _COPYRIGHT, icon_file = _HOME..'/core/images/ta_64x64.png' @@ -365,15 +363,15 @@ local default_menubar = { -- @name context_menu -- @usage textadept.menu.context_menu[#textadept.menu.context_menu + 1] = {...} local default_context_menu = { - {_L['_Undo'], buffer.undo}, - {_L['_Redo'], buffer.redo}, + {_L['Undo'], buffer.undo}, + {_L['Redo'], buffer.redo}, SEPARATOR, - {_L['Cu_t'], buffer.cut}, - {_L['_Copy'], buffer.copy}, - {_L['_Paste'], buffer.paste}, - {_L['_Delete'], buffer.clear}, + {_L['Cut'], buffer.cut}, + {_L['Copy'], buffer.copy}, + {_L['Paste'], buffer.paste}, + {_L['Delete'], buffer.clear}, SEPARATOR, - {_L['Select _All'], buffer.select_all} + {_L['Select All'], buffer.select_all} } --- @@ -383,12 +381,12 @@ local default_context_menu = { -- @class table -- @name tab_context_menu local default_tab_context_menu = { - {_L['_Close'], io.close_buffer}, + {_L['Close'], io.close_buffer}, SEPARATOR, - {_L['_Save'], io.save_file}, - {_L['Save _As'], io.save_file_as}, + {_L['Save'], io.save_file}, + {_L['Save As'], io.save_file_as}, SEPARATOR, - {_L['Re_load'], io.reload_file}, + {_L['Reload'], io.reload_file}, } -- Table of proxy tables for menus. diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua index 047adcca..52471ed7 100644 --- a/modules/textadept/run.lua +++ b/modules/textadept/run.lua @@ -290,7 +290,7 @@ function M.build(root_directory) if lfs.attributes(root_directory..'/'..build_file) then local button, utf8_command = ui.dialogs.inputbox{ title = _L['Command'], informative_text = root_directory, - text = build_command, button1 = _L['_OK'], button2 = _L['_Cancel'] + text = build_command, button1 = _L['OK'], button2 = _L['Cancel'] } if button == 1 then command = utf8_command:iconv(_CHARSET, 'UTF-8') end break |