Re: [Github-comments] [geany/geany] Multiple carets, selections, insertion points and paste (#1141)

2019-01-05 Thread Ryan Wiedemann
Sorry, I have stopped working on this, and I probably should have said 
something. If someone else wants to go forward with this, hopefully the gist I 
linked to above which shows how to enable the scintilla feature would be 
helpful. 

> On Jan 4, 2019, at 10:41 AM, João Paulo Pulga  
> wrote:
> 
> Any news in this? I will like to see this feature in Geany
> 
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub, or mute the thread.


-- 
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-451680217

Re: [Github-comments] [geany/geany] Multiple carets, selections, insertion points and paste (#1141)

2017-12-21 Thread Ryan Wiedemann
@sagarchalise That plugin relies on geany providing the functions 
`sci_set_selection_mode` and `sci_get_selection_mode`, that is geany already 
supporting rectangle selections. I suppose geany could expose the underlying 
functionality from scintilla for plugins and just not in its own GUI and let a 
plugin handle it. This might actually be a good way to get testing for multiple 
selection corner cases: users can opt-in by installing the plugin, with the 
expectation that some things might be weird/broken. Eventually multi-edit-mode 
could be moved into geany proper.

I'm not sure how to handle the mouse portion in this scenario though.

-- 
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-353529690

Re: [Github-comments] [geany/geany] Multiple carets, selections, insertion points and paste (#1141)

2017-11-17 Thread Ryan Wiedemann
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] Debugging Geany itself (#1688)

2017-11-15 Thread Ryan Wiedemann
@elextr following your suggestion, it is working now. As you mentioned, GDB 
doesn't find the files, even after they are added to the search path with 
`dir`, until after the program starts running. But they're available after 
`(gdb) start` so that's fine. 

Seems like this should be added to the documentation. Maybe something like

> Because most of Geany is a library, in order to use GDB, you'll need to 
> install the version of Geany you want to debug. You can install to a 
> different directory in order to not overwrite an existing install with 
> `./configure --prefix `. You'll also need to tell GDB about 
> where the source files are with GDB's `dir` command. Most source files won't 
> be loaded until after Geany starts running, but you can run `(gdb) start` to 
> break at the start of main and set breakpoints etc. from there.

in the GDB section of HACKING?

-- 
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/1688#issuecomment-344718552

[Github-comments] [geany/geany] Debugging Geany itself (#1688)

2017-11-14 Thread Ryan Wiedemann
I've been trying  to address #1141 and come to a point where the next logical 
step seems to be to step through Geany's / Scintilla's code in order to 
understand what is happening. Has someone else gotten some sort of debugger 
working on this codebase before? I've tried to get GDB working but I can't get 
it to find the source files.

### What I've tried so far
I read [`HACKING`](https://github.com/geany/geany/blob/master/HACKING) and then 
ran `CFLAGS='-g -O0' ./autogen.sh --disable-html-docs` to get debug symbols, 
and ran `make`. I then tried running `gdb src/geany`. GDB complained that 
`src/geany` was not an executable. I examined `src/geany` and found it was in 
fact a shell script. After a bit of digging  I found the `src/.libs/` folder 
which contained an executable which if I ran it directly opened up a Geany 
instance. So I tried running `gdb /src/.libs/geany` which seemed to work except 
that GDB only knows about 
[main.c](https://github.com/geany/geany/blob/2a2ae728341d12b7cea29b671beb08e441f62d95/src/main.c)
 and its header file. I looked up how to tell GDB about where source files are 
and I found [this page of the 
manual](https://sourceware.org/gdb/onlinedocs/gdb/Source-Path.html). I then ran 
`dir src` inside GDB and that added the correct folder to the search path, but 
GDB still couldn't find the source files.

I haven't really used GDB before, so a) I might be missing something regarding 
operating GDB itself, and b) if someone has a way to debug Geany using another 
method, that's fine with me!

-- 
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/1688

Re: [Github-comments] [geany/geany] Multiple carets, selections, insertion points and paste (#1141)

2017-11-14 Thread Ryan Wiedemann
I just tried adding the result of SCI_GETMULTIPLESELECTION to the printouts, 
and once it's set it to true, it remains true.

-- 
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-344471435

Re: [Github-comments] [geany/geany] Multiple carets, selections, insertion points and paste (#1141)

2017-11-13 Thread Ryan Wiedemann
I've got a branch [here](https://github.com/Ryan1729/geany/tree/ryan1729debug) 
that callsSCI_ADDSELECTION on ctrl-click, and calls SCI_ROTATESELECTION on 
ctrl-right-click. Mysteriously, if you ctrl-click then ctrl-right-click 
somewhere else, by the time the right click happens, the number of selections 
is back down to 1. So I also quickly co-opted the dubug mode for the `SSM` 
macro to print out the selection count when every message is sent to Scintilla, 
(though that macro anyway.) Surprisingly, the selection count goes back to 1 
before the first other message is sent! I find this extremely odd since the 
only ways to remove the other selections with the Scintilla API, as far as I 
can tell, are in the section which I only added wrappers for in that branch.

Unless someone knows some weird thing the code is doing that wold cause this, 
(setting the selection outside the Scintilla API?!) I suppose I'll have to try 
getting GDB working.





-- 
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-344122726

Re: [Github-comments] [geany/geany] work on adding multi-select (#1687)

2017-11-13 Thread Ryan Wiedemann
Closed #1687.

-- 
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/pull/1687#event-1339949470

Re: [Github-comments] [geany/geany] work on adding multi-select (#1687)

2017-11-13 Thread Ryan Wiedemann
> If you just want to ask a question its probably better to leave the code in a 
> branch your github fork and point to it from an issue, rather than making a 
> pull request.

Fair enough. I've seen some other projects put work in progress stuff in pull 
requests, but if you folks prefer pointing to branches from issues, that's fine 
with me.

-- 
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/pull/1687#issuecomment-344116529

Re: [Github-comments] [geany/geany] work on adding multi-select (#1687)

2017-11-13 Thread Ryan Wiedemann
This is currently not working. I've assigned adding a selection to ctrl-click, 
and rotating the selection, (making the nest selection the main selection, 
which I expected to make the selection show up in the UI,) to ctrl-right-click.

I've also had it print out how many selections there are after each of those 
steps. If you ctrl-click then ctrl-right-click, by the time you get to the 
ctrl-right-click, Scintilla says there is only 1 selection!

-- 
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/pull/1687#issuecomment-344108974

[Github-comments] [geany/geany] work on adding multi-select (#1687)

2017-11-13 Thread Ryan Wiedemann
add some multiselect wrappers, set multiple selection to true and call 
sci_add_selection on ctrl-click
You can view, comment on, or merge this pull request online at:

  https://github.com/geany/geany/pull/1687

-- Commit Summary --

  * add some multiselect wrappers, set multiple selection to true and call 
aci_add_selection on ctrl-click

-- File Changes --

M src/editor.c (26)
M src/sciwrappers.c (84)
M src/sciwrappers.h (17)

-- Patch Links --

https://github.com/geany/geany/pull/1687.patch
https://github.com/geany/geany/pull/1687.diff

-- 
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/pull/1687


Re: [Github-comments] [geany/geany] Multiple carets, selections, insertion points and paste (#1141)

2017-11-13 Thread Ryan Wiedemann
Just to be absolutely clear what we're talking about, here's a gif recording of 
an unconfigured SciTE 4.0.2:

![scite_multiple_selections](https://user-images.githubusercontent.com/2133026/32747877-772038a2-c877-11e7-97cd-4a47153ef1b3.gif)

In the gif I `Ctrl-click` twice (unfortunately you can't see my mouse,) to make 
two additional selections, perform some edits, then simply left click to go 
back to a single selection.

I guess I was assuming Scintila handled more of the GUI, rather than, as 
appears to be the case, just managing the editor state.

@AdamDanischewski Those seem like good suggestions. assuming extra selections 
are actually working, just not showing in the UI, SCI_ROTATESELECTION should 
allow a quick demonstration that will actually show up. I'll get started on 
that.

-- 
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-344057141

Re: [Github-comments] [geany/geany] Multiple carets, selections, insertion points and paste (#1141)

2017-11-12 Thread Ryan Wiedemann
I had assumed that it was built in to Scintilla since [that docs page I 
mentioned 
before](http://www.scintilla.org/ScintillaDoc.html#MultipleSelectionAndVirtualSpace)
 [1] seems to be about Scintilla only and it explicitly mentions `Ctrl` in 
conjunction with the mouse. I had also tried `Ctrl-click` in SciTE and that 
worked as expected. After a cursory `grep` through the latest Scintilla and 
SciTE, I didn't find `Ctrl-click` logic in either of them. There's some kind of 
autogenerated interface in SciTE which makes things like this hard to search 
for there, though. I did stumble across the logic for the selection adding 
behaviour bound to `Ctrl-D` in Sublime Text. Altogether that suggests to me 
that the `Ctrl-click` behaviour is probably in SciTE, not built-in`to Scintilla.

So I've now tried calling `SCI_ADDSELECTION` on `Ctrl-click`, in the same place 
I removed the code from, but it still doesn't seem to do anything. I've 
confirmed it makes it to the right part of the big switch statement in the 
local copy of Scintilla though. 

[Here's the 
diff](https://gist.github.com/Ryan1729/2244914f0ac7856fed42f8379fb4cd36).




[1] Regarding the link, I meant to do something [`like 
this`](http://www.scintilla.org/ScintillaDoc.html#MultipleSelectionAndVirtualSpace).
 I've put the backticks inside the square brackets this time. I knew there was 
a way that it worked.

-- 
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-343828519

Re: [Github-comments] [geany/geany] Multiple carets, selections, insertion points and paste (#1141)

2017-11-12 Thread Ryan Wiedemann
This feature is just about the only thing holding me back from switching away 
from another editor for everything, so I thought I would take a stab at it. I 
cloned master and added a wrapper for 
`[SCI_SETMULTIPLESELECTION](http://www.scintilla.org/ScintillaDoc.html#MultipleSelectionAndVirtualSpace)`
 in `sciwrappers.c` and unconditionally called it in  `create_new_sci`, 
(presumably the final version should be behind a checkbox or something.) But 
that didn't appear to do anything, (specifically I tried Ctrl-clicking to place 
multiple cursors.) Just by searching "geany ctrl click" I found [this 
discussion 
thread](https://lists.geany.org/pipermail/users/2012-May/008026.html) that 
mentions that Ctrl-clicking is hardcoded to goto-tag and find-matching-brace 
depending where you click. So I found [the part of the code that does 
that](https://github.com/geany/geany/blob/dd58ab6f49e8b382d9278c3ebc533f08b8aec84e/src/editor.c#L316-L327)
 and removed it. But Ctrl-clicking still doesn't work. Per comments above I 
expected some parts not to play nicely with multiple selections, but I hoped 
what I did would be enough to get it working some of the time! I managed to 
make the small changes I did by just `grep`ping trough the code and checking 
that functions were called when I thought they were being called. Does anyone 
else with more knowledge of the codebase have any ideas what else might cause 
Ctrl-clicking not to work?

FWIW, [further 
on](https://lists.geany.org/pipermail/users/2012-May/008041.html) in that 
discussion I linked to, an `enable-multiselection` branch was mentioned. Now I 
don't know the history of this project, but that discussion is from 2012. Is 
there any chance that branch would be even slightly relevant to the current 
codebase, assuming the author still has it and can be contacted?

-- 
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-343777950