Hi John, My intent was to have Leo consistently put the cursor where it was when the string was copied to the clipboard, no matter the destination. If I select the string right to left and the cursor is at the beginning of the string when I Ctrl-C, then the cursor should be at the beginning of the string when I hit Ctrl-V, whether the insertion point is at the head of a selection or if it is at the beginning of a new line in a different node.
Chris On Thu, Nov 26, 2015 at 7:40 AM, john lunzer <[email protected]> wrote: > It seems to be something to do with whether the cursor is at the beginning >> of a selection or not. When it is on a new line, the cursor always goes to >> the end. When it is at the head of a selection, it sticks to the front of >> the pasted string. >> > > This is the exact and only behavior I implemented. Only when a selection > is present before a paste and only when the cursor is at the beginning of a > selection will the cursor stay at the beginning of the pasted string. Very > subtle change, which is why I made it default. > > Would you please describe the additional behavior you're looking for > again, phrased differently or elaborated from your original description? > > On Wednesday, November 25, 2015 at 12:32:05 PM UTC-5, Chris George wrote: >> >> Hi Terry and John, >> >> Testing on a vanilla instance of Leo. (Thanks Terry) >> >> Select a string by click-drag right to left with the mouse or Shift-Arrow >> key. Ctrl-C to copy it with the cursor at the beginning of the string. >> >> Navigate to the end of the document. Hit enter. Ctrl-V to paste. >> >> Shift-Home to go to the beginning of the string. Ctrl-V to paste. >> >> This behavior is exactly the same in my production instance of Leo so it >> doesn't have anything to do with settings. It seems to be something to do >> with whether the cursor is at the beginning of a selection or not. When it >> is on a new line, the cursor always goes to the end. When it is at the head >> of a selection, it sticks to the front of the pasted string. >> >> Chris >> >> >> On Wednesday, November 25, 2015 at 8:34:34 AM UTC-8, Terry Brown wrote: >>> >>> On Wed, 25 Nov 2015 08:22:00 -0800 (PST) >>> Chris George <[email protected]> wrote: >>> >>> > Hi John, >>> > >>> > Thanks for all the work. My Python/Qt/OS is the same as your test >>> > environment. For me the cursor still *always *goes to the end of the >>> > string on paste, no matter how I select the string. >>> > >>> > So it must be something in my settings. I pull from git every single >>> > time I start Leo, it is baked into my start-up script. I will try >>> > downloading from github and running a vanilla install of Leo and >>> > report back. >>> >>> You can do: >>> >>> HOME=/tmp python launchLeo.py >>> >>> to get a vanilla Leo environment, if that helps. >>> >>> Cheers -Terry >>> >>> > Chris >>> > >>> > On Wednesday, November 25, 2015 at 7:45:58 AM UTC-8, john lunzer >>> > wrote: >>> > > >>> > > I just tested a fresh install on a fresh virtual machine (Linux >>> > > Mint 17.2 KDE, which is a great Leo test environment). Booted into >>> > > the Live ISO and didn't download or install anything except for Leo >>> > > from github. >>> > > >>> > > Leo 5.1-final, build 20151122092056, Sun Nov 22 09:20:56 CST 2015 >>> > > Not running from a git repo >>> > > Python 2.7.6, PyQt version 4.8.6 >>> > > >>> > > *My changes are working*. My understanding of the desired behavior >>> > > was that when text was highlighted that if a paste was executed >>> > > that the cursor would stay either at the beginning or end of the >>> > > pasted string following a paste corresponding to where the where >>> > > the cursor was in the original selection. In cases where no text is >>> > > selected/highlighted the cursor always goes to the end of the >>> > > pasted string. That was my understanding and what I implemented. >>> > > >>> > > If you would like a *second* setting in which the cursor always >>> > > stays at the beginning of the pasted string whether text was >>> > > previously selected or not I can also implement that but it will >>> > > not be default behavior. >>> > > >>> > > On Sunday, November 22, 2015 at 10:16:56 AM UTC-5, john lunzer >>> > > wrote: >>> > >> >>> > >> I'm going to install a linux virtual machine on my windows >>> > >> computer and test this out with a fresh install. >>> > >> >>> > >> On Friday, November 20, 2015 at 7:34:00 PM UTC-5, john lunzer >>> > >> wrote: >>> > >>> >>> > >>> Okay, thanks for testing it out. The behavior *does* work for me, >>> > >>> so I'm not having an issue on my end. I'll try to take a look it >>> > >>> at as soon as I can. Maybe not this weekend, but I'm off next >>> > >>> week so should have some time. >>> > >>> >>> > >>> Edward or Terry, if you have any ideas on why it might now be >>> > >>> working on machines other than my own I would appreciate it. I'm >>> > >>> thinking it might have something to do with how I do my check: >>> > >>> >>> > >>> I'm getting the setting in the LeoFrame constructor with: >>> > >>> >>> > >>> self.cursorStay = c.config.getBool("cursor_stay_on_paste", >>> > >>> default = True) >>> > >>> >>> > >>> >>> > >>> And my check consists of: >>> > >>> >>> > >>> if self.cursorStay and wname.startswith('body') >>> > >>> >>> > >>> >>> > >>> I'm guessing that the constructor is firing properly and setting >>> > >>> self.cursorStay otherwise I'd probably be getting an attribute >>> > >>> error. And since the default is True it should be True. So I >>> > >>> wonder if my understanding what wname gets set to is causing the >>> > >>> problem. >>> > >>> >>> > >>> On Friday, November 20, 2015 at 6:24:34 PM UTC-5, lewis wrote: >>> > >>>> >>> > >>>> I can confirm it makes no difference on a windows machine. The >>> > >>>> cursor always lands on the right with Global settings and @bool >>> > >>>> cursor_stay_on_paste = True in myLeoSettings.leo. >>> > >>>> >>> > >>>> Leo Log Window >>> > >>>> Leo 5.1-final, build 20151120111022, Fri Nov 20 11:10:22 CST 2015 >>> > >>>> Git repo info: branch = master, commit = a9465468020e >>> > >>>> Python 3.4.3, PyQt version 5.5.1 >>> > >>>> Windows 7 AMD64 (build 6.1.7601) SP1 >>> > >>>> >>> > >>>> Regards >>> > >>>> Lewis >>> > >>>> >>> > >>> >>> > >>> >> -- > You received this message because you are subscribed to the Google Groups > "leo-editor" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/leo-editor. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
