diff options
author | 2012-06-22 15:22:25 -0400 | |
---|---|---|
committer | 2012-06-22 15:22:25 -0400 | |
commit | 73699db214f70901d642866f4233fbc99fa792a6 (patch) | |
tree | 9ee6e9d5bc02f377fadd4c99dd055527097768bb | |
parent | 4bca2f464a111f8561cc69d79b0a202be1da4d48 (diff) | |
download | textadept-73699db214f70901d642866f4233fbc99fa792a6.tar.gz textadept-73699db214f70901d642866f4233fbc99fa792a6.zip |
Resize most filteredlists to fit the ncurses screen.
-rw-r--r-- | core/file_io.lua | 3 | ||||
-rw-r--r-- | core/gui.lua | 3 | ||||
-rw-r--r-- | modules/textadept/keys.lua | 3 | ||||
-rw-r--r-- | modules/textadept/menu.lua | 5 | ||||
-rw-r--r-- | modules/textadept/snapopen.lua | 3 | ||||
-rw-r--r-- | modules/textadept/snippets.lua | 3 |
6 files changed, 11 insertions, 9 deletions
diff --git a/core/file_io.lua b/core/file_io.lua index 18b7b919..36417661 100644 --- a/core/file_io.lua +++ b/core/file_io.lua @@ -353,6 +353,7 @@ end) -- @see recent_files -- @name open_recent_file function io.open_recent_file() - local i = gui.filteredlist(_L['Open'], _L['File'], io.recent_files, true) + local i = gui.filteredlist(_L['Open'], _L['File'], io.recent_files, true, + NCURSES and { '--width', gui.size[1] - 2 } or '') if i then io.open_file(io.recent_files[i + 1]) end end diff --git a/core/gui.lua b/core/gui.lua index 778f3539..cb9aa1d9 100644 --- a/core/gui.lua +++ b/core/gui.lua @@ -108,7 +108,8 @@ function gui.switch_buffer() items[#items + 1] = (buffer.dirty and '*' or '')..basename items[#items + 1] = filename end - local i = gui.filteredlist(_L['Switch Buffers'], columns, items, true) + local i = gui.filteredlist(_L['Switch Buffers'], columns, items, true, + NCURSES and { '--width', gui.size[1] - 2 } or '') if i then view:goto_buffer(i + 1) end end diff --git a/modules/textadept/keys.lua b/modules/textadept/keys.lua index 3f6a1f70..4c9d68a0 100644 --- a/modules/textadept/keys.lua +++ b/modules/textadept/keys.lua @@ -328,7 +328,8 @@ keys[not OSX and (not NCURSES and 'cai' or 'mi') -- TODO: { utils.set_encoding, 'ISO-8859-1' } -- TODO: { utils.set_encoding, 'MacRoman' } -- TODO: { utils.set_encoding, 'UTF-16LE' } -keys[not OSX and 'cL' or 'mL'] = m_textadept.mime_types.select_lexer +keys[not OSX and not NCURSES and 'cL' + or 'mL'] = m_textadept.mime_types.select_lexer keys.f5 = { buffer.colourise, buffer, 0, -1 } if NCURSES then keys.cl = keys.f5 end diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua index 675428b4..e18d0d02 100644 --- a/modules/textadept/menu.lua +++ b/modules/textadept/menu.lua @@ -326,10 +326,7 @@ local columns = { _L['Command'], _L['Key Command'] } -- @name select_command function M.select_command() local i = gui.filteredlist(_L['Run Command'], columns, items, true, - NCURSES and { - '--width', gui.size[1] - 2, - '--height', gui.size[2] - 2, - } or '') + NCURSES and { '--width', gui.size[1] - 2 } or '') if i then keys.run_command(commands[i + 1], type(commands[i + 1])) end end diff --git a/modules/textadept/snapopen.lua b/modules/textadept/snapopen.lua index 67da1ff1..dd379d48 100644 --- a/modules/textadept/snapopen.lua +++ b/modules/textadept/snapopen.lua @@ -157,8 +157,9 @@ function M.open(utf8_paths, filter, exclude_PATHS, exclude_FILTER, depth) M.MAX), '--button1', _L['_OK']) end + local width = NCURSES and { '--width', gui.size[1] - 2 } or '' local utf8_filenames = gui.filteredlist(_L['Open'], _L['File'], list, false, - '--select-multiple') or '' + '--select-multiple', width) or '' for filename in utf8_filenames:gmatch('[^\n]+') do io.open_file(filename) end end diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua index 3674a079..5f08895e 100644 --- a/modules/textadept/snippets.lua +++ b/modules/textadept/snippets.lua @@ -235,7 +235,8 @@ function M._select() end local i = gui.filteredlist(_L['Select Snippet'], { _L['Trigger'], _L['Scope'], _L['Snippet Text'] }, - t, true, '--output-column', '2') + t, true, '--output-column', '2', + NCURSES and { '--width', gui.size[1] - 2 } or '') if i then M._insert(t[(i + 1) * 3]) end end |