pkulchenko / ZeroBraneStudio

Lightweight Lua-based IDE for Lua with code completion, syntax highlighting, live coding, remote debugger, and code analyzer; supports Lua 5.1, 5.2, 5.3, 5.4, LuaJIT and other Lua interpreters on Windows, macOS, and Linux
http://studio.zerobrane.com/
Other
2.62k stars 518 forks source link

Allow to edit output console #1036

Closed moteus closed 4 years ago

moteus commented 4 years ago

My use case is to be able copy full stacktrace from logfile and paste it to the output cosole to be able to navigate in the project code. I use it in the SciTE, and also i found that some times I also need to edit some output as whell.

pkulchenko commented 4 years ago

@moteus, I'm not sure it warrants changes in the IDE (I couldn't come up with a good UI for it), but you can definitely add a menu item to paste to the Output window using something like this:

package {
  onMenuOutput = function(self, menu, editor)
    local idpaste = ID(self.fname..".output.paste")
    local function paste(event)
      local ro = editor:GetReadOnly()
      editor:SetReadOnly(false)
      editor:PasteDyn()
      editor:GetReadOnly(ro)
    end
    menu:Append(idpaste, "Paste from Clipboard")
    editor:Connect(idpaste, wx.wxEVT_COMMAND_MENU_SELECTED, paste)
  end
}

You can turn off ReadOnly status in a similar way.

moteus commented 4 years ago

At first thanks for the code snipped - it works. But why just not to add Read only flag to the config. I have no problem with editable console. In Scite it is even possible tu run system commands from it - so it is analog for shell.

pkulchenko commented 4 years ago

@moteus, let me think about it. I think disabling read-only status is probably a bit too much (as it would allow users to mess up the output), but read-only should be only set once, so the user can easily change it (once) if desired. I'll review the code to make sure it's not explicitly set to RO outside of the initialization code.