Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)
You should not set the lexer directly, set the Geany filetype instead. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/issues/646#issuecomment-345417127
[Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)
I added small script: ```lua --[[ Copy selected text to new tab 2017.11.18 --]] local s = geany.selection(); if (s == "") then geany.message("No text is selected!"); elseif (s == nil) then geany.message("There is no open document!"); else --SCI_GETLEXER local l = geany.scintilla(4002); geany.newfile(); geany.selection(s); --SCI_SETLEXER geany.scintilla(4001, l); geany.status("Lua-script: Copy selected text to new tab."); end ``` ```SCI_GETLEXER```works fine, all values (```SCLEX_*```) were correctly received, but ```SCI_SETLEXER``` is not working. Why? It's bug or not implemented? Xubuntu 17.10 x64, Geany 1.31, I also checked current Git versions. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/issues/646
Re: [Github-comments] [geany/geany] Multiple carets, selections, insertion points and paste (#1141)
IMO a few things are need to be resolved for this to progress: 1. As @AdamDanischewski said, some UI control is needed. The prefect solution IMO is to extend the keybindings UI to allow binding to mouse buttons (with modifiers) as well, so called "clickbindings". Some mice have many buttons and these could be bound by the user to suit their use-case, while other users may keep the current ctrl-click and bind the multiple select elsewhere and others go for interapp compatibility. Giving the user control takes the heat out of the debate about backward compatibility vs interapp commonality. This would need a bit of work because the current keybindings are based on `gtk_accellerator` which does not handle clicks IIUC, but I think its just MMOP to have the click handler use bindings instead of being hard coded and to store and retrieve click to action mappings, eg in `clickbindings.conf` like `keybindings.conf`. 2. A plan is needed to introduce multiple select into Geany. As has been said elsewhere, none of Geany is written to support multiple selects. It would be my recommendation that multiple selects be introduced progressively instead of as one big lump. In practice the project does poorly with big lumps because it doesn't have the effort available to review and test them. But before _any_ multiple select capability is introduced it must be checked that _no_ other Geany and core plugin functionality is affected by their presence and any problems fixed. Then the basic ability to make multiple selections and type in them, as @Ryan1729 has here, can be added and contributions solicited for making other Geany functions multiple select aware when it makes sense for that. 3. The ability to style the secondary selections can be added, Scintilla can do it, so the settings "just" need to be added to Geany and appropriate colour schemes. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1141#issuecomment-345410419
Re: [Github-comments] [geany/geany] Multiple carets, selections, insertion points and paste (#1141)
Since the current default behavior is different, it may be argued to not make it a default. Yet the functionality seems to be much better and I personally would prefer to see Geany remain consistent with other editors that offer this same functionality. It is a quirk in my opinion that Geany using Scintilla defaults to a different functionality than what the other Scintilla editors have as standard with regards to multi-caret on Ctrl-click. I vote to make the new Ctrl-click functionality standard in accordance with the other Scintilla editors. Btw: you are in the same situation, I was in, with regards to fixing it yet not being able to add it to the user interface. Hopefully elextr knows how to route this to the appropriate parties for implementation. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1141#issuecomment-345402564
Re: [Github-comments] [geany/geany] Multiple carets, selections, insertion points and paste (#1141)
I've now got ctrl-click multiple selections working, (I can make multiple selections and type into all of them at once) on my [debugging branch](https://github.com/Ryan1729/geany/tree/ryan1729debug). Note that that branch simply deletes the old ctrl-click functionality, (and has a bunch of printouts besides), so it' is not suitable to add to the main codebase, but it works as a proof of concept. So the question now seems to be how should the settings for ctrl-clicking be handled? The natural thing to do right now seems (to me) to be a set of radio buttons, (and a corresponding enum) that allows selecting between the old functionality (goto-tag and find-matching-brace), adding a selection, and not doing anything on ctrl-click at all. However, that old discussion thread mentioned the idea of mouse bindings, (so the user could bind arbitrary actions to mouse inputs,) which seems like a reasonable idea. If that's ever going to happen, then we should probably think about that when deciding how this setting works. If we go with my enum proposal then later mouse bindings get added, then either user's configuration files break or we have one of two undesirable situations : this enum overrides the keybindings, meaning the user might set mouse bindings and not understand why they need to set the enum to "None" or an additional setting of "Allow keybinding", or the other situation where the keybindings override the enum and if a user binds something to ctrl-shift-click and is surprised that ctrl-click stops doing what they expect. Then again, would not having either setting override each other be best? If a user is surprised that ctrl-clicking adds a selection, in addition to whatever they set it to do, then hopefully that would prompt them to look in the settings to turn that off? Maybe someone else has a better idea that avoids even that problem? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1141#issuecomment-345379372
Re: [Github-comments] [geany/geany] Multiple carets, selections, insertion points and paste (#1141)
Textadept is blazing fast, but I miss two features: 1. a "word/character counter" (not just for the file but also for a selection) 2. a "find and mark-all" (preferentially like Geany's Ctrl+shift+M) I currently use Visual Studio Code, because it has all the features I use and has many useful extensions. The downside is that its not as fast as Geany or Textadept. But its faster than any other text editor with similar functions. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1141#issuecomment-345302992
Re: [Github-comments] [geany/geany] Multiple carets, selections, insertion points and paste (#1141)
Kind of like textadept now that I've played around with it, you have to a hack a colorizer (theme) to get the color scheme to Geany though. Copy and modify a theme in the themes directory under the source directory (exploded tar ball). Presuming you named your cloned theme to be "your-new-theme". Add this to your ~/.textadept/init.lua file: ui.set_theme(not CURSES and 'your-new-theme') Then modify the colors and type Ctrl-E for a command window in textadept and enter: reset() Keep modifying it to your preference (hint you can choose more than the colors listed (e.g. colors.red works), once you get the color scheme you like it's not that different from Geany, and it seems a lot faster. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1141#issuecomment-345283901
Re: [Github-comments] [geany/geany] Multiple carets, selections, insertion points and paste (#1141)
@elextr It does say that it uses Scintilla as the core text editing component, when I first browsed the code it looks like mainly lua, looking closer I see some calls that create a Scintilla document. See textadept.c line no. 1355. ``` /** * Creates a new Scintilla document and adds it to the Lua state. * Generates 'buffer_before_switch' and 'buffer_new' events. * @param doc Almost always zero, except for the first Scintilla view created, * in which its doc pointer would be given here since it already has a * pre-created buffer. * @see lL_adddoc */ static void new_buffer(sptr_t doc) { if (!doc) { doc = SS(focused_view, SCI_CREATEDOCUMENT, 0, 0); // create the new document lL_event(lua, "buffer_before_switch", -1); lL_adddoc(lua, doc); lL_gotodoc(lua, focused_view, -1, FALSE); } else lL_adddoc(lua, doc), SS(focused_view, SCI_ADDREFDOCUMENT, 0, doc); #if GTK ... ``` https://foicica.com/textadept/TECHNOLOGY.html -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1141#issuecomment-345281595
Re: [Github-comments] [geany/geany] Multiple carets, selections, insertion points and paste (#1141)
Textadept appears to use ScintillaGTK, not Scintilla directly, so it comes in a library rather than included source code. That also means the API may be different. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1141#issuecomment-345248863
Re: [Github-comments] [geany/geany] Multiple carets, selections, insertion points and paste (#1141)
@diohja Textadept does seem to have the feature yet it doesn't look like it's really using Scintilla. It includes ScintillaLua a lexer for Scintilla. The Scintilla functionality appears to have been recreated in Lua. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1141#issuecomment-345245883
Re: [Github-comments] [geany/geany] Open file in geany in current desktop? (#1025)
Maybe the --socket-file option can help, as documenten on [geany.org](https://www.geany.org/manual/current/#command-line-options) -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1025#issuecomment-345174801