Re: move to next blank line?

2010-05-12 Thread Marek Stepanek

On 12.05.2010 09:47, Roland Küffner wrote:

Am 12.05.2010 um 02:06 schrieb wallabadah:


I have not used AppleScript before - but it appears to be an ideal
solution in this case. I started by recording, then a little bit of
editing. I prefer to have the wrap around option turned off in this
case, and used a regular expression for finding whitespace-only lines.

Here's my version for the sake of completeness:

'next blank line' - assigned to control-option-down arrow
tell application BBEdit
find ^[[:space:]]*$ searching in (text 1 of window 1) options
{search mode:grep, starting at top:false, wrap around:false,
backwards:false, case sensitive:false, match words:false, extend
selection:false} with selecting match
end tell


Just to tinker a little further on this. I tried your pattern. It seems that it 
has problems catching the last line break on multiple empty lines (I have no 
idea why). I tried some variations of the pattern and found this to be more to 
my liking:

(?s)^\s+

Together with the
select insertion point after found object of result
line this takes me directly to column zero of the next block. Exactly what I 
wanted - of course YMMV on that.

Thanks for bringing this topic up. I already used this new custom shortcuts 
several times since yesterday :-)

Roland





Hello all!



I would not bother with an Apple script. My suggestion: do it with 
BBEdit short cuts (and BBEdit is famous for it, why not use it?):


1. select the line feed of a not empty line and drag your mouse to the 
beginning of the next empty line. Now the end of the full line and the 
empty line are selected.


2. Hit cmd + E (Now the search pattern is into the find field)

3. Hit cmd + G (for the next empty line)

4. Hit cmd + shift + G (for the previous empty line)


Greetings from Munich



marek

--
You received this message because you are subscribed to the 
BBEdit Talk discussion group on Google Groups.

To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email supp...@barebones.com rather than posting to the group.


Re: move to next blank line?

2010-05-12 Thread Karl Pfeiffer


Quoting Roland Küffner medienmeis...@googlemail.com:



Thanks for bringing this topic up. I already used this new custom   
shortcuts several times since yesterday :-)


Roland

--



Es ist vorteilshaft, ein Helfer zu sein. (It is preferable and useful  
to be a helper!)



 k.


Schumpeterstraße 15 / 8
4040 Linz
(karl.pfeif...@jku.at)

http://grillparzerhof.at




This message was sent using IMP, the Internet Messaging Program.

--
You received this message because you are subscribed to the 
BBEdit Talk discussion group on Google Groups.

To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email supp...@barebones.com rather than posting to the group.


Re: move to next blank line?

2010-05-11 Thread wallabadah
Thanks Roland,

I have not used AppleScript before - but it appears to be an ideal
solution in this case. I started by recording, then a little bit of
editing. I prefer to have the wrap around option turned off in this
case, and used a regular expression for finding whitespace-only lines.

Here's my version for the sake of completeness:

'next blank line' - assigned to control-option-down arrow
tell application BBEdit
find ^[[:space:]]*$ searching in (text 1 of window 1) options
{search mode:grep, starting at top:false, wrap around:false,
backwards:false, case sensitive:false, match words:false, extend
selection:false} with selecting match
end tell

'previous blank line' - assigned to control-option-up arrow
tell application BBEdit
find ^[[:space:]]*$ searching in (text 1 of window 1) options
{search mode:grep, starting at top:false, wrap around:false,
backwards:true, case sensitive:false, match words:false, extend
selection:false} with selecting match
end tell

Will.

On May 11, 6:26 pm, Roland Küffner medienmeis...@googlemail.com
wrote:
 Hi, Will

 you might consider recording an applescript and doing an appropriate search 
 to achieve this functionality. You can then assign a shortcut to that script.

 Something like:

 tell application BBEdit
         find \\r\\r\\s* searching in (text 1 of window 1) options {search 
 mode:grep, starting at top:false, wrap around:true, case sensitive:false, 
 match words:false, extend selection:false} with selecting match
         select insertion point after found object of result
 end tell

 Maybe you have to tweak the search pattern a little to your liking but it 
 might be what you are looking for.

 Regards,
 Roland

 Am 11.05.2010 um 01:06 schrieb wallabadah:





  Hi all,

  Does anyone know of a keyboard shortcut for moving the cursor position
  up or down to the next blank (or space/tab only) line? I know it's
  possible to move to start/end of a file (command-up/down arrow), by a
  page at a time (option up/down arrow) and obviously by a line at a
  time.
  I think this would be useful for moving around source files where
  'blocks' of code are separated by blank lines. Perhaps it's possible
  using one of the emacs key bindings?

  cheers,

  Will.

  --
  You received this message because you are subscribed to the
  BBEdit Talk discussion group on Google Groups.
  To post to this group, send email to bbedit@googlegroups.com
  To unsubscribe from this group, send email to
  bbedit+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/bbedit?hl=en
  If you have a feature request or would like to report a problem,
  please email supp...@barebones.com rather than posting to the group.

 --
 You received this message because you are subscribed to the
 BBEdit Talk discussion group on Google Groups.
 To post to this group, send email to bbedit@googlegroups.com
 To unsubscribe from this group, send email to
 bbedit+unsubscr...@googlegroups.com
 For more options, visit this group 
 athttp://groups.google.com/group/bbedit?hl=en
 If you have a feature request or would like to report a problem,
 please email supp...@barebones.com rather than posting to the group.

-- 
You received this message because you are subscribed to the 
BBEdit Talk discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email supp...@barebones.com rather than posting to the group.