aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2010-10-13 21:31:35 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2010-10-13 21:31:35 -0400
commit8d29321eeba9f77dcd3aaaa9fd504d5f736463e7 (patch)
tree1dd59aab2968f3d3409040ec2bf13763d7bb3b9f
parent858adad304d20d1f3bf4d46ccdfa898b21920be2 (diff)
downloadtextadept-8d29321eeba9f77dcd3aaaa9fd504d5f736463e7.tar.gz
textadept-8d29321eeba9f77dcd3aaaa9fd504d5f736463e7.zip
Fix switch buffers dialog bug when cancelling; core/gui.lua
-rw-r--r--core/gui.lua6
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