|
From: Dale A. <da...@gr...> - 2012-04-17 20:02:11
|
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
>
>
|