diff options
author | 2010-10-13 21:31:35 -0400 | |
---|---|---|
committer | 2010-10-13 21:31:35 -0400 | |
commit | 8d29321eeba9f77dcd3aaaa9fd504d5f736463e7 (patch) | |
tree | 1dd59aab2968f3d3409040ec2bf13763d7bb3b9f | |
parent | 858adad304d20d1f3bf4d46ccdfa898b21920be2 (diff) | |
download | textadept-8d29321eeba9f77dcd3aaaa9fd504d5f736463e7.tar.gz textadept-8d29321eeba9f77dcd3aaaa9fd504d5f736463e7.zip |
Fix switch buffers dialog bug when cancelling; core/gui.lua
-rw-r--r-- | core/gui.lua | 6 |
1 files changed, 3 insertions, 3 deletions
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 |