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.6k stars 519 forks source link

Consider adding SCI_MOVESELECTEDLINESUP and SCI_MOVESELECTEDLINESDOWN in defaults #1130

Closed jaykyburz closed 2 years ago

jaykyburz commented 2 years ago

I added this to my local config.

local SCI_MOVESELECTEDLINESUP = 2620
local SCI_MOVESELECTEDLINESDOWN = 2621
editor.keymap[#editor.keymap+1] = {wxstc.wxSTC_KEY_UP, wxstc.wxSTC_SCMOD_CTRL+wxstc.wxSTC_SCMOD_SHIFT, SCI_MOVESELECTEDLINESUP}
editor.keymap[#editor.keymap+1] = {wxstc.wxSTC_KEY_DOWN, wxstc.wxSTC_SCMOD_CTRL+wxstc.wxSTC_SCMOD_SHIFT, SCI_MOVESELECTEDLINESDOWN}
moteus commented 2 years ago

Default short keys for these functions are Alt+Up/Down. But if they not defined explicitly in config may be it worth to add

pkulchenko commented 2 years ago

@jaykyburz, these constants are defined as wxstc.wxSTC_CMD_MOVESELECTEDLINESUP and wxstc.wxSTC_CMD_MOVESELECTEDLINESDOWN. All the commands that can be bound to keystrokes start with wxSTC_CMD_.

jaykyburz commented 2 years ago

Great thanks. Sorry I didn't see those bindings. I'm trying to focus on my project and not getting too distracted by customizing my ide :)

pkulchenko commented 2 years ago

np; let me know if you run into any other issues.

jaykyburz commented 2 years ago

since you asked :)

One thing I keep finding myself doing is double clicking a word to selected it, then pressing quote key expecting the word to be wrapped by quotes. Default behavior is just to replace the selection with the quote character. I didn't see a plugin for this behavior.

I also spent some time trying to get autodelimiter working but I'm doing something wrongI did see the warning about disabling the autodelimiter package to avoid conflicts, so I assume its in the right place.

pkulchenko commented 2 years ago

Default behavior is just to replace the selection with the quote character. I didn't see a plugin for this behavior.

I suspect you were looking for https://github.com/pkulchenko/ZeroBranePackage/blob/master/autodelimitersurroundselection.lua, which is intended to do just this. It conflicts with the regular autodelimiter plugin, hence the message you may be seeing. You only need to install the former if you want to quote the selected text. If you still can't get it to work, let me know and I'll take a quick look.

jaykyburz commented 2 years ago

This one works very well, thanks very much.

I did see one small bug when I was testing just now, that it takes two undo steps to undo a surroundselection action. A very minor issue that I could try and debug and submit a fix for later in the week. I'd love to be able to contribute something one day.

Anyhow thanks again so much for ZeroBrane and the great support here on Github as well.

jaykyburz commented 2 years ago

OKOK one more. Is there a package for auto inserting an end after a then or do?

pkulchenko commented 2 years ago

I don't think there is, but you can take a stab at it using the logic from the autodelimiter plugin. There is also more complex snippets plugin that I need to merge.