From 8d29321eeba9f77dcd3aaaa9fd504d5f736463e7 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 13 Oct 2010 21:31:35 -0400 Subject: Fix switch buffers dialog bug when cancelling; core/gui.lua --- core/gui.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/gui.lua b/core/gui.lua index 3baba198..fabd7ec2 100644 --- a/core/gui.lua +++ b/core/gui.lua @@ -59,7 +59,7 @@ function gui.switch_buffer() items[#items + 1] = dirty..filename:match('[^/\\]+$') items[#items + 1] = filename end - local out = + local response = gui.dialog('filteredlist', '--title', locale.SWITCH_BUFFERS, '--button1', 'gtk-ok', @@ -67,6 +67,6 @@ function gui.switch_buffer() '--no-newline', '--columns', 'Name', 'File', '--items', items) - local i = tonumber(out:match('%-?%d+$')) - if i and i >= 0 then view:goto_buffer(i + 1, true) end + local ok, i = response:match('(%-?%d+)\n(%d+)$') + if ok and ok ~= '2' then view:goto_buffer(tonumber(i) + 1, true) end end -- cgit v1.2.3