|
From: Steve C. <sjc...@gm...> - 2012-04-17 20:09:39
|
Wow. That was quick, and quite affective. I work with java, but haven't
done any jEdit bean shell scripting. I'll try to use this as a launch
point to write a macro that doesn't ignore the scroll bar/cursor events,
but ignores events that cause the automatic jump to the left. This lock is
a little too affective. You should call it "Horizontal vice grip". lol
Thanks for the script,
Steve
On Tue, Apr 17, 2012 at 3:37 PM, Dale Anson <da...@gr...> wrote:
> The macro below will lock the horizontal scroll bar. Run it again to
> unlock it. Copy it to your jEdit Settings/macro directory. To find your
> jEdit Settings directory from jEdit, go to the Utilities menu, mouse over
> the Settings Directory, and the actual directory location will be the first
> menu item. Name the macro file name Toggle_Horizontal_Scroll_Lock.bsh. Then
> you can run it from the macros menu or assign a shortcut to it.
>
> Let me know if you have any problems with this.
>
> Dale
>
> ~~~~~
>
>
> import org.gjt.sp.jedit.textarea.ScrollListener;
> import org.gjt.sp.jedit.textarea.TextArea;
>
> String clientKey = "macro_horizontal_scroll_lock";
>
> toggleHorizontalLock() {
> ScrollListener scrollListener =
> (ScrollListener)textArea.getClientProperty(clientKey);
> if (scrollListener == null) {
> // scrolling not locked, set to locked
> int offset = textArea.getHorizontalOffset();
> scrollListener = new ScrollListener() {
> public void scrolledHorizontally(TextArea ta) {
> ta.setHorizontalOffset(offset);
> }
> public void scrolledVertically(TextArea ta){}
> };
> textArea.putClientProperty(clientKey, scrollListener);
> textArea.addScrollListener(scrollListener);
> }
> else {
> // locked, unlock scrolling
> textArea.removeScrollListener(scrollListener);
> textArea.putClientProperty(clientKey, null);
> }
> }
>
> toggleHorizontalLock();
>
>
> ~~~~~
>
> On Tue, Apr 17, 2012 at 10:47 AM, Steve Curtis <sjc...@gm...> wrote:
>
>> When viewing a log file with a jagged right margin, is there a way to
>> lock the horizontal scrolling such that the view does not jump to the left
>> when the longest line no longer reaches the right most view boundary?
>>
>> Thanks,
>> Steve
>>
>>
>> ------------------------------------------------------------------------------
>> Better than sec? Nothing is better than sec when it comes to
>> monitoring Big Data applications. Try Boundary one-second
>> resolution app monitoring today. Free.
>> http://p.sf.net/sfu/Boundary-dev2dev
>> --
>> -----------------------------------------------
>> jEdit Users' List
>> jEd...@li...
>> https://lists.sourceforge.net/lists/listinfo/jedit-users
>>
>>
>
|