Scite Buffer Switch |
|
|
For those people who would like to have a version of Scite which has the z-order buffer switching and don't mind using old version, they can grab version 1.59. But for those who require some of the features and bug fixes on latest SciTE, grab [my build of SciTE with z-order buffer switching] (last build for version 1.68) -- Dody Suria Wijaya |
buffers.zorder.switching=1 mode but it was unstable). This script presents a drop-down list of opened buffers in recently-used order. The method is to watch the OnOpen and OnSwitchFile events.
This will bind Ctrl+K to the function do_buffer_list.
command.name.4.*=Switch Buffers command.4.*=do_buffer_list command.subsystem.4.*=3 command.mode.4.*=savebefore:no command.shortcut.4.*=Ctrl+K
Put this in your startup script, or set ext.lua.startup.script.
--switch_buffers.lua --drops down a list of buffers, in recently-used order local buffers = {} local append = table.insert local function buffer_switch(f) --- swop the new current buffer with the last one! local idx for i,file in ipairs(buffers) do if file == f then idx = i; break end end if idx then table.remove(buffers,idx) table.insert(buffers,1,f) else append(buffers,f) end end function OnOpen(f) buffer_switch(f) end function OnSwitchFile(f) buffer_switch(f) end function do_buffer_list() local s = '' local sep = ';' local n = table.getn(buffers) for i = 2,n-1 do s = s..buffers[i]..sep end s = s..buffers[n] _UserListSelection = fn editor.AutoCSeparator = string.byte(sep) editor:UserListShow(12,s) editor.AutoCSeparator = string.byte(' ') end function OnUserListSelection(t,str) if t == 12 then scite.Open(str) return true else return false end end