Discussion:
[ jEdit-devel ] Fwd: Elastic tabstops implementation for jedit
(too old to reply)
goodfella
2010-10-19 21:24:51 UTC
Permalink
Hi ,
I had a discussion with Nick Gravgaard (the inventor of elastic tabstops)
about my elastic tabstops implementation for jedit.
I also talked about the indentation issue noticed by Eric.Please see the
mail chain of the discussion below.
Best Regards,
Anshal

---------- Forwarded message ----------
From: <***@nickgravgaard.com>
Date: Wed, Oct 20, 2010 at 2:13 AM
Subject: Re: Elastic tabstops implementation for jedit
To: goodfella <***@gmail.com>


Hi again Anshal.

It looks good :) but it doesn't seem to use a minimum width and padding
width. On my Java applet, try typing a couple of characters in the empty
cell before "doSomethingComplicated();". As long as the text is thinner
than the minimum width value the cell won't stretch (a cell's width is
max(text_width, minimum_width) + padding_width). On your implementation,
typing anything makes it grow (presumably you're just using text_width +
tab_width).

If you don't want to use explicit pixel values you could do what Code
Browser does, which is something like, if tabs are set to 8 characters,
makes the minimum width 6 "m"s, and the padding width 2 "m"s, so an
empty cell is as wide as what the user has set tabs to be.

I think this makes it more usable and more attractive. It also means
that some text can be typed into a cell without things moving all the
time.

Another thing - after watching that video it seems that one thing that
was confusing the user was when he was unindenting a block of code. What
most editors (jEdit included) do when a user unidents a range of lines
of text, is iterate through the selected lines and remove the first tab
(let's ignore spaces for now) on each line. If there is no tab it just
leaves the line alone. That is what jEdit is doing, but because there
was a tab after a wide bit of text on a line that did not start with a
tab, the text on the other lines shifted to the right to fit the wide
piece of text. That is correct behaviour.

All in all though, congratulations - this looks great! When will this
feature be released so that people can use it and I can start telling
people about it?
Nick
Hi Nick,
Thanks for your comments :)
I have attached two zip files containing jedit.jar and modes folder.
Please
extract them parallel to each other i.e. jedit.jar and modes folder MUST
be
located in the same folder .
and run the command
java -jar jedit.jar
This should start jedit.Elastic tabstops are disabled by default .
1)globally inside- Utilities>Global Options>Editing by ticking the
checkbox
"Indent using elastic tabstops".(This setting always persists )
2)on a per buffer basis inside - Utilities>Buffer Options> by ticking the
checkbox "Indent using elastic tabstops" .(This setting is lost once the
buffer is closed)
Please try it out and let me know how it goes.
Yes I verified this beahviour in the Java applet on your site and also in
the Code Browser editor.
I will be forwarding you some mail chains feel free to air your views in
them.
Best Regards,
Anshal
Hi Anshal,
It's great to hear you've implemented elastic tabstops for JEdit :) I
would love to try it out - what's the easiest way for me to do that?
Eric Berry
2010-10-19 22:31:24 UTC
Permalink
Mmmk. I'm glad it's the correct behavior, and that you've implemented it
according to his spec, but I can guarantee you that jEdit's users with code
blocks like mine (which are very common) are going to have serious issues
with it when they unindent. They will complain about it, and they won't care
if it's technically correct, it'll still look wrong to them, and they will
think it's a bug in jEdit because it's not the normal behavior.

That being said, I do like the feature and I do want to see it integrated in
the core, and as I said earlier: This particular issue makes the feature
somewhat unusable for me personally, but that doesn't mean it's the same for
others.

I played around with it some more, and it looks like if I add a blank lines
like so:
[code]
* {

margin: 0;
padding: 0;

}
[/code]

Where the blank lines have no tabs on them at all, then unindenting the
'margin' line only affects the 'padding' line, but leaves the rest of the
code blocks alone. While, not ideal, and goes against our coding style, it's
a work around I'm willing to use. The 'padding' line still indents oddly,
I'd expect it to start moving back to the left as I unindent the 'margin'
line.

Also, while this feature didn't make it to the next jEdit 4.4 release, there
are daily builds available:
http://www.tellurianring.com/projects/jedit-daily/index.php?dir=jEdit

The latest ones have it, and you can use the UpdaterPlugin to update to the
latest daily builds from within jEdit.

I'm hoping to convince others to do a 4.5 final release half way through
2011, and elastic tabstops will definitely be a part of that one.

Cheers, and thanks for all your hard work on this.

Eric
Post by goodfella
Hi ,
I had a discussion with Nick Gravgaard (the inventor of elastic tabstops)
about my elastic tabstops implementation for jedit.
I also talked about the indentation issue noticed by Eric.Please see the
mail chain of the discussion below.
Best Regards,
Anshal
---------- Forwarded message ----------
Date: Wed, Oct 20, 2010 at 2:13 AM
Subject: Re: Elastic tabstops implementation for jedit
Hi again Anshal.
It looks good :) but it doesn't seem to use a minimum width and padding
width. On my Java applet, try typing a couple of characters in the empty
cell before "doSomethingComplicated();". As long as the text is thinner
than the minimum width value the cell won't stretch (a cell's width is
max(text_width, minimum_width) + padding_width). On your implementation,
typing anything makes it grow (presumably you're just using text_width +
tab_width).
If you don't want to use explicit pixel values you could do what Code
Browser does, which is something like, if tabs are set to 8 characters,
makes the minimum width 6 "m"s, and the padding width 2 "m"s, so an
empty cell is as wide as what the user has set tabs to be.
I think this makes it more usable and more attractive. It also means
that some text can be typed into a cell without things moving all the
time.
Another thing - after watching that video it seems that one thing that
was confusing the user was when he was unindenting a block of code. What
most editors (jEdit included) do when a user unidents a range of lines
of text, is iterate through the selected lines and remove the first tab
(let's ignore spaces for now) on each line. If there is no tab it just
leaves the line alone. That is what jEdit is doing, but because there
was a tab after a wide bit of text on a line that did not start with a
tab, the text on the other lines shifted to the right to fit the wide
piece of text. That is correct behaviour.
All in all though, congratulations - this looks great! When will this
feature be released so that people can use it and I can start telling
people about it?
Nick
Hi Nick,
Thanks for your comments :)
I have attached two zip files containing jedit.jar and modes folder.
Please
extract them parallel to each other i.e. jedit.jar and modes folder MUST
be
located in the same folder .
and run the command
java -jar jedit.jar
This should start jedit.Elastic tabstops are disabled by default .
1)globally inside- Utilities>Global Options>Editing by ticking the
checkbox
"Indent using elastic tabstops".(This setting always persists )
2)on a per buffer basis inside - Utilities>Buffer Options> by ticking the
checkbox "Indent using elastic tabstops" .(This setting is lost once the
buffer is closed)
Please try it out and let me know how it goes.
Yes I verified this beahviour in the Java applet on your site and also in
the Code Browser editor.
I will be forwarding you some mail chains feel free to air your views in
them.
Best Regards,
Anshal
Hi Anshal,
It's great to hear you've implemented elastic tabstops for JEdit :) I
would love to try it out - what's the easiest way for me to do that?
Nick Gravgaard
2010-10-19 23:08:15 UTC
Permalink
Post by Eric Berry
it'll still look wrong to them, and they will
think it's a bug in jEdit because it's not the normal behavior.
If I understood correctly, elastic tabstops will not be enabled by
default. Anyone who comes across the feature will have enabled it
explicitly. They will know it is not normal default behaviour.

There's a growing number of people using elastic tabstops in the
different editors that have support for it, and I haven't heard of
anyone unindenting code all the way to the left so they force text to
shift columns and then get confused by it. If people don't like this
feature they don't have to use it. It seems however that most people do
like it once they've used it for a bit and got a feel for how it works.

Cheers,
Nick
Nick Gravgaard
2010-10-19 23:20:04 UTC
Permalink
On Tue, 19 Oct 2010 15:31 -0700, "Eric Berry" <***@gmail.com>
wrote:1
Post by Eric Berry
I played around with it some more, and it looks like if I add a blank lines
[code]
* {
margin: 0;
padding: 0;
}
[/code]
Where the blank lines have no tabs on them at all, then unindenting the
'margin' line only affects the 'padding' line, but leaves the rest of the
code blocks alone. While, not ideal, and goes against our coding style, it's
a work around I'm willing to use. The 'padding' line still indents oddly,
I'd expect it to start moving back to the left as I unindent the 'margin'
line.
Imagine colouring in the different column blocks in the same way as the
coloured diagram at
http://nickgravgaard.com/elastictabstops/#solution
Does that help?
Post by Eric Berry
Also, while this feature didn't make it to the next jEdit 4.4 release, there
http://www.tellurianring.com/projects/jedit-daily/index.php?dir=jEdit
The latest ones have it, and you can use the UpdaterPlugin to update to the
latest daily builds from within jEdit.
I'm hoping to convince others to do a 4.5 final release half way through
2011, and elastic tabstops will definitely be a part of that one.
Good stuff. Is it too early for me to give some publicity to this?

Nick
Eric Berry
2010-10-19 23:57:13 UTC
Permalink
Post by Nick Gravgaard
Imagine colouring in the different column blocks in the same way as the
coloured diagram at
http://nickgravgaard.com/elastictabstops/#solution
Does that help?
It does, thank you. It's still an odd behavior that differs greatly from
jEdit's normal behavior. It will take some getting used to and explaining.
It definitely works and looks better when applied to the whole document.

Anshal, could you please update jEdit's help docs to include a link to
Nick's documentation? It'd be great if we could include that animated gif he
created, and if it's ok with him. It won't be animated (I don't think), but
I think it would be very helpful.
Post by Nick Gravgaard
Post by Eric Berry
Also, while this feature didn't make it to the next jEdit 4.4 release, there
http://www.tellurianring.com/projects/jedit-daily/index.php?dir=jEdit
The latest ones have it, and you can use the UpdaterPlugin to update to the
latest daily builds from within jEdit.
I'm hoping to convince others to do a 4.5 final release half way through
2011, and elastic tabstops will definitely be a part of that one.
Good stuff. Is it too early for me to give some publicity to this?
Nick
Up to you. Always good to have jEdit publicity. :)

Are the UpdaterPlugin, and daily builds enough for at least the next 6-8
months? I can only suggest a 4.5 release mid-way through next year, can't
guarantee it'll happen.
--
Learn from the past. Live in the present. Plan for the future.
Blog: http://www.townsfolkdesigns.com/blogs/elberry
jEdit <http://www.jedit.org> - Programmer's Text Editor
Bazaar <http://bazaar.canonical.com> - Version Control for Humans
Matthieu Casanova
2010-10-20 10:21:08 UTC
Permalink
Hi,
I have two issues with Elastic tabstops feature :

In an empty buffer without elastic tabstop, paste this

AliceBlue { return new ColorToken(yychar,yychar + yylength(), "0xF0F8FF"); }
AntiqueWhite { return new ColorToken(yychar,yychar + yylength(), "0xFAEBD7"); }
Aqua { return new ColorToken(yychar,yychar + yylength(), "0x00FFFF"); }
Aquamarine { return new ColorToken(yychar,yychar + yylength(), "0x7FFFD4"); }
Azure { return new ColorToken(yychar,yychar + yylength(), "0xF0FFFF"); }
Beige { return new ColorToken(yychar,yychar + yylength(), "0xF5F5DC"); }
Bisque { return new ColorToken(yychar,yychar + yylength(), "0xFFE4C4"); }
Black { return new ColorToken(yychar,yychar + yylength(), "0x000000"); }
BlanchedAlmond { return new ColorToken(yychar,yychar + yylength(),
"0xFFEBCD"); }
Blue { return new ColorToken(yychar,yychar + yylength(), "0x0000FF"); }
BlueViolet { return new ColorToken(yychar,yychar + yylength(), "0x8A2BE2"); }
Brown { return new ColorToken(yychar,yychar + yylength(), "0xA52A2A"); }
BurlyWood { return new ColorToken(yychar,yychar + yylength(), "0xDEB887"); }
CadetBlue { return new ColorToken(yychar,yychar + yylength(), "0x5F9EA0"); }

Then activate the elastic tabstops, it works fine.
Select lines 3 4 and 5 and unindent then indent, elastic tabstops will
fail to reindent correctly.
And if you paste the same text in a buffer that has elastic tabstops,
you get an exception

The duplicate line macro also creates exceptions

Matthieu
Post by Eric Berry
Post by Nick Gravgaard
Imagine colouring in the different column blocks in the same way as the
coloured diagram at
http://nickgravgaard.com/elastictabstops/#solution
Does that help?
It does, thank you. It's still an odd behavior that differs greatly from
jEdit's normal behavior. It will take some getting used to and explaining.
It definitely works and looks better when applied to the whole document.
Anshal, could you please update jEdit's help docs to include a link to
Nick's documentation? It'd be great if we could include that animated gif he
created, and if it's ok with him. It won't be animated (I don't think), but
I think it would be very helpful.
Post by Nick Gravgaard
Post by Eric Berry
Also, while this feature didn't make it to the next jEdit 4.4 release, there
http://www.tellurianring.com/projects/jedit-daily/index.php?dir=jEdit
The latest ones have it, and you can use the UpdaterPlugin to update to the
latest daily builds from within jEdit.
I'm hoping to convince others to do a 4.5 final release half way through
2011, and elastic tabstops will definitely be a part of that one.
Good stuff. Is it too early for me to give some publicity to this?
Nick
Up to you. Always good to have jEdit publicity. :)
Are the UpdaterPlugin, and daily builds enough for at least the next 6-8
months? I can only suggest a 4.5 release mid-way through next year, can't
guarantee it'll happen.
--
Learn from the past. Live in the present. Plan for the future.
Blog: http://www.townsfolkdesigns.com/blogs/elberry
jEdit <http://www.jedit.org> - Programmer's Text Editor
Bazaar <http://bazaar.canonical.com> - Version Control for Humans
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
--
-----------------------------------------------
jEdit Developers' List
https://lists.sourceforge.net/lists/listinfo/jedit-devel
Shlomy Reinstein
2010-10-20 11:35:11 UTC
Permalink
Hi,

1. If you copy the lines from the email, you are likely to get spaces
instead of tabs. So after pasting the below text into a new buffer, replace
all "\s+" with "\t" using a Regular Expression replacement to get the
desired effect.
2. As soon as I change the buffer to use elastic tabstops, I get the
following exception, and the text area becomes empty (due to the exception,
nothing is painted).

Shlomy

1:32:00 PM [AWT-EventQueue-0] [error] ExtensionManager: Error repainting
line range {0,25}:
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager:
java.lang.IllegalArgumentException: {ELSTIC TABSTOP}CORRUPT
DATA@{1287574320995}
& Thread : AW
T-EventQueue-0 :Cannot find the size for tab at offset 0in line 0while
searching in
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager:
ColumnBlock[startLine : 0 ,endLine : 15 ,columnBlockWidth : 0.0] LINES:
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ColumnBlock.throwException(ColumnBlock.java:335)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ColumnBlock.getColumnBlock(ColumnBlock.java:236)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ElasticTabstopsTabExpander.nextTabStop(ElasticTabstopsTabExpande
r.java:46)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.syntax.Chunk.init(Chunk.java:369)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.syntax.DisplayTokenHandler.initChunk(DisplayTokenHandler.java:226)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.syntax.DisplayTokenHandler.merge(DisplayTokenHandler.java:251)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.syntax.DisplayTokenHandler.handleToken(DisplayTokenHandler.java:130)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.syntax.TokenMarker.markTokens(TokenMarker.java:250)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.buffer.JEditBuffer.markTokens(JEditBuffer.java:1383)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ChunkCache.lineToChunkList(ChunkCache.java:789)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ChunkCache.updateChunksUpTo(ChunkCache.java:671)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ChunkCache.getLineInfo(ChunkCache.java:256)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ExtensionManager.paintScreenLineRange(ExtensionManager.java:104)

1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.TextAreaPainter.paint(TextAreaPainter.java:869)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.JComponent.paintToOffscreen(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.RepaintManager.paint(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.JComponent._paintImmediately(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.JComponent.paintImmediately(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown
Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.event.InvocationEvent.dispatch(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventQueue.dispatchEvent(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.run(Unknown Source)

On Wed, Oct 20, 2010 at 12:21 PM, Matthieu Casanova
Post by Matthieu Casanova
Hi,
In an empty buffer without elastic tabstop, paste this
AliceBlue { return new ColorToken(yychar,yychar + yylength(),
"0xF0F8FF"); }
AntiqueWhite { return new ColorToken(yychar,yychar + yylength(),
"0xFAEBD7"); }
Aqua { return new ColorToken(yychar,yychar + yylength(),
"0x00FFFF"); }
Aquamarine { return new ColorToken(yychar,yychar + yylength(),
"0x7FFFD4"); }
Azure { return new ColorToken(yychar,yychar + yylength(),
"0xF0FFFF"); }
Beige { return new ColorToken(yychar,yychar + yylength(),
"0xF5F5DC"); }
Bisque { return new ColorToken(yychar,yychar + yylength(),
"0xFFE4C4"); }
Black { return new ColorToken(yychar,yychar + yylength(),
"0x000000"); }
BlanchedAlmond { return new ColorToken(yychar,yychar + yylength(),
"0xFFEBCD"); }
Blue { return new ColorToken(yychar,yychar + yylength(),
"0x0000FF"); }
BlueViolet { return new ColorToken(yychar,yychar + yylength(),
"0x8A2BE2"); }
Brown { return new ColorToken(yychar,yychar + yylength(),
"0xA52A2A"); }
BurlyWood { return new ColorToken(yychar,yychar + yylength(),
"0xDEB887"); }
CadetBlue { return new ColorToken(yychar,yychar + yylength(),
"0x5F9EA0"); }
Then activate the elastic tabstops, it works fine.
Select lines 3 4 and 5 and unindent then indent, elastic tabstops will
fail to reindent correctly.
And if you paste the same text in a buffer that has elastic tabstops,
you get an exception
The duplicate line macro also creates exceptions
Matthieu
Post by Eric Berry
Post by Nick Gravgaard
Imagine colouring in the different column blocks in the same way as the
coloured diagram at
http://nickgravgaard.com/elastictabstops/#solution
Does that help?
It does, thank you. It's still an odd behavior that differs greatly from
jEdit's normal behavior. It will take some getting used to and
explaining.
Post by Eric Berry
It definitely works and looks better when applied to the whole document.
Anshal, could you please update jEdit's help docs to include a link to
Nick's documentation? It'd be great if we could include that animated gif
he
Post by Eric Berry
created, and if it's ok with him. It won't be animated (I don't think),
but
Post by Eric Berry
I think it would be very helpful.
Post by Nick Gravgaard
Post by Eric Berry
Also, while this feature didn't make it to the next jEdit 4.4 release, there
http://www.tellurianring.com/projects/jedit-daily/index.php?dir=jEdit
The latest ones have it, and you can use the UpdaterPlugin to update
to
Post by Eric Berry
Post by Nick Gravgaard
Post by Eric Berry
the
latest daily builds from within jEdit.
I'm hoping to convince others to do a 4.5 final release half way
through
Post by Eric Berry
Post by Nick Gravgaard
Post by Eric Berry
2011, and elastic tabstops will definitely be a part of that one.
Good stuff. Is it too early for me to give some publicity to this?
Nick
Up to you. Always good to have jEdit publicity. :)
Are the UpdaterPlugin, and daily builds enough for at least the next 6-8
months? I can only suggest a 4.5 release mid-way through next year, can't
guarantee it'll happen.
--
Learn from the past. Live in the present. Plan for the future.
Blog: http://www.townsfolkdesigns.com/blogs/elberry
jEdit <http://www.jedit.org> - Programmer's Text Editor
Bazaar <http://bazaar.canonical.com> - Version Control for Humans
------------------------------------------------------------------------------
Post by Eric Berry
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
--
-----------------------------------------------
jEdit Developers' List
https://lists.sourceforge.net/lists/listinfo/jedit-devel
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
--
-----------------------------------------------
jEdit Developers' List
https://lists.sourceforge.net/lists/listinfo/jedit-devel
Dale Anson
2010-10-20 13:27:09 UTC
Permalink
That looks like the same error I was getting a couple of days ago, but I
couldn't figure out how to reproduce.

Also, I replied to the other thread on elastic tab stops that rectangular
selection does not work when elastic tab stops are turned on.

Dale
Post by Shlomy Reinstein
Hi,
1. If you copy the lines from the email, you are likely to get spaces
instead of tabs. So after pasting the below text into a new buffer, replace
all "\s+" with "\t" using a Regular Expression replacement to get the
desired effect.
2. As soon as I change the buffer to use elastic tabstops, I get the
following exception, and the text area becomes empty (due to the exception,
nothing is painted).
Shlomy
1:32:00 PM [AWT-EventQueue-0] [error] ExtensionManager: Error repainting
& Thread : AW
T-EventQueue-0 :Cannot find the size for tab at offset 0in line 0while
searching in
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ColumnBlock.throwException(ColumnBlock.java:335)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ColumnBlock.getColumnBlock(ColumnBlock.java:236)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ElasticTabstopsTabExpander.nextTabStop(ElasticTabstopsTabExpande
r.java:46)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.syntax.Chunk.init(Chunk.java:369)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.syntax.DisplayTokenHandler.initChunk(DisplayTokenHandler.java:226)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.syntax.DisplayTokenHandler.merge(DisplayTokenHandler.java:251)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.syntax.DisplayTokenHandler.handleToken(DisplayTokenHandler.java:130)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.syntax.TokenMarker.markTokens(TokenMarker.java:250)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.buffer.JEditBuffer.markTokens(JEditBuffer.java:1383)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ChunkCache.lineToChunkList(ChunkCache.java:789)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ChunkCache.updateChunksUpTo(ChunkCache.java:671)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ChunkCache.getLineInfo(ChunkCache.java:256)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ExtensionManager.paintScreenLineRange(ExtensionManager.java:104)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.TextAreaPainter.paint(TextAreaPainter.java:869)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.JComponent.paintToOffscreen(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.RepaintManager.paint(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.JComponent._paintImmediately(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.JComponent.paintImmediately(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown
Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.event.InvocationEvent.dispatch(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventQueue.dispatchEvent(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.run(Unknown Source)
On Wed, Oct 20, 2010 at 12:21 PM, Matthieu Casanova <
Post by Matthieu Casanova
Hi,
In an empty buffer without elastic tabstop, paste this
AliceBlue { return new ColorToken(yychar,yychar + yylength(),
"0xF0F8FF"); }
AntiqueWhite { return new ColorToken(yychar,yychar + yylength(),
"0xFAEBD7"); }
Aqua { return new ColorToken(yychar,yychar + yylength(),
"0x00FFFF"); }
Aquamarine { return new ColorToken(yychar,yychar + yylength(),
"0x7FFFD4"); }
Azure { return new ColorToken(yychar,yychar + yylength(),
"0xF0FFFF"); }
Beige { return new ColorToken(yychar,yychar + yylength(),
"0xF5F5DC"); }
Bisque { return new ColorToken(yychar,yychar + yylength(),
"0xFFE4C4"); }
Black { return new ColorToken(yychar,yychar + yylength(),
"0x000000"); }
BlanchedAlmond { return new ColorToken(yychar,yychar + yylength(),
"0xFFEBCD"); }
Blue { return new ColorToken(yychar,yychar + yylength(),
"0x0000FF"); }
BlueViolet { return new ColorToken(yychar,yychar + yylength(),
"0x8A2BE2"); }
Brown { return new ColorToken(yychar,yychar + yylength(),
"0xA52A2A"); }
BurlyWood { return new ColorToken(yychar,yychar + yylength(),
"0xDEB887"); }
CadetBlue { return new ColorToken(yychar,yychar + yylength(),
"0x5F9EA0"); }
Then activate the elastic tabstops, it works fine.
Select lines 3 4 and 5 and unindent then indent, elastic tabstops will
fail to reindent correctly.
And if you paste the same text in a buffer that has elastic tabstops,
you get an exception
The duplicate line macro also creates exceptions
Matthieu
Post by Eric Berry
Post by Nick Gravgaard
Imagine colouring in the different column blocks in the same way as the
coloured diagram at
http://nickgravgaard.com/elastictabstops/#solution
Does that help?
It does, thank you. It's still an odd behavior that differs greatly from
jEdit's normal behavior. It will take some getting used to and
explaining.
Post by Eric Berry
It definitely works and looks better when applied to the whole document.
Anshal, could you please update jEdit's help docs to include a link to
Nick's documentation? It'd be great if we could include that animated
gif he
Post by Eric Berry
created, and if it's ok with him. It won't be animated (I don't think),
but
Post by Eric Berry
I think it would be very helpful.
Post by Nick Gravgaard
Post by Eric Berry
Also, while this feature didn't make it to the next jEdit 4.4
release,
Post by Eric Berry
Post by Nick Gravgaard
Post by Eric Berry
there
http://www.tellurianring.com/projects/jedit-daily/index.php?dir=jEdit
Post by Eric Berry
Post by Nick Gravgaard
Post by Eric Berry
The latest ones have it, and you can use the UpdaterPlugin to update
to
Post by Eric Berry
Post by Nick Gravgaard
Post by Eric Berry
the
latest daily builds from within jEdit.
I'm hoping to convince others to do a 4.5 final release half way
through
Post by Eric Berry
Post by Nick Gravgaard
Post by Eric Berry
2011, and elastic tabstops will definitely be a part of that one.
Good stuff. Is it too early for me to give some publicity to this?
Nick
Up to you. Always good to have jEdit publicity. :)
Are the UpdaterPlugin, and daily builds enough for at least the next 6-8
months? I can only suggest a 4.5 release mid-way through next year,
can't
Post by Eric Berry
guarantee it'll happen.
--
Learn from the past. Live in the present. Plan for the future.
Blog: http://www.townsfolkdesigns.com/blogs/elberry
jEdit <http://www.jedit.org> - Programmer's Text Editor
Bazaar <http://bazaar.canonical.com> - Version Control for Humans
------------------------------------------------------------------------------
Post by Eric Berry
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that
run
Post by Eric Berry
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
--
-----------------------------------------------
jEdit Developers' List
https://lists.sourceforge.net/lists/listinfo/jedit-devel
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
--
-----------------------------------------------
jEdit Developers' List
https://lists.sourceforge.net/lists/listinfo/jedit-devel
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
--
-----------------------------------------------
jEdit Developers' List
https://lists.sourceforge.net/lists/listinfo/jedit-devel
goodfella
2010-10-20 21:20:01 UTC
Permalink
Hi,
I submitted a fix (Tracker:Patches > 3091530 ) for the exception coming on

turning off elastic tabstops >pasting text> turning on Elastic tabstops

Can somebody apply this please ?
Post by Dale Anson
Post by Matthieu Casanova
The duplicate line macro also creates exceptions
Matthieu , can you please check whether this exception is still coming
(after applying the above patch) as I am not getting it.
Post by Dale Anson
Post by Matthieu Casanova
Also, I replied to the other thread on elastic tab stops that rectangular
selection does not work when elastic tab stops are turned on.

Rectangular Selection does not work with elastic tabstops as it has been
implemented using character offsets and not absolute screen positions (this
is the same reason for it not working properly with variable width fonts
).Size of tab character varies for every line in case of elastic tabstops
.So basically in case of elastic tabstops for a random integer n

space taken by "n" characters of line no. 1 != space taken by "n" characters
of line no. 2 !=space taken by "n" characters of line no. 3

and so on ( if these n characters have a tab in between them )

Regards,
Anshal
Post by Dale Anson
That looks like the same error I was getting a couple of days ago, but I
couldn't figure out how to reproduce.
Also, I replied to the other thread on elastic tab stops that rectangular
selection does not work when elastic tab stops are turned on.
Dale
Post by Matthieu Casanova
Hi,
1. If you copy the lines from the email, you are likely to get spaces
instead of tabs. So after pasting the below text into a new buffer, replace
all "\s+" with "\t" using a Regular Expression replacement to get the
desired effect.
2. As soon as I change the buffer to use elastic tabstops, I get the
following exception, and the text area becomes empty (due to the exception,
nothing is painted).
Shlomy
1:32:00 PM [AWT-EventQueue-0] [error] ExtensionManager: Error repainting
& Thread : AW
T-EventQueue-0 :Cannot find the size for tab at offset 0in line 0while
searching in
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ColumnBlock.throwException(ColumnBlock.java:335)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ColumnBlock.getColumnBlock(ColumnBlock.java:236)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ElasticTabstopsTabExpander.nextTabStop(ElasticTabstopsTabExpande
r.java:46)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.syntax.Chunk.init(Chunk.java:369)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.syntax.DisplayTokenHandler.initChunk(DisplayTokenHandler.java:226)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.syntax.DisplayTokenHandler.merge(DisplayTokenHandler.java:251)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.syntax.DisplayTokenHandler.handleToken(DisplayTokenHandler.java:130)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.syntax.TokenMarker.markTokens(TokenMarker.java:250)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.buffer.JEditBuffer.markTokens(JEditBuffer.java:1383)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ChunkCache.lineToChunkList(ChunkCache.java:789)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ChunkCache.updateChunksUpTo(ChunkCache.java:671)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ChunkCache.getLineInfo(ChunkCache.java:256)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ExtensionManager.paintScreenLineRange(ExtensionManager.java:104)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.TextAreaPainter.paint(TextAreaPainter.java:869)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.JComponent.paintToOffscreen(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.RepaintManager.paint(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.JComponent._paintImmediately(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.JComponent.paintImmediately(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown
Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.event.InvocationEvent.dispatch(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventQueue.dispatchEvent(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.run(Unknown Source)
On Wed, Oct 20, 2010 at 12:21 PM, Matthieu Casanova <
Post by Matthieu Casanova
Hi,
In an empty buffer without elastic tabstop, paste this
AliceBlue { return new ColorToken(yychar,yychar +
yylength(), "0xF0F8FF"); }
AntiqueWhite { return new ColorToken(yychar,yychar +
yylength(), "0xFAEBD7"); }
Aqua { return new ColorToken(yychar,yychar + yylength(),
"0x00FFFF"); }
Aquamarine { return new ColorToken(yychar,yychar +
yylength(), "0x7FFFD4"); }
Azure { return new ColorToken(yychar,yychar + yylength(),
"0xF0FFFF"); }
Beige { return new ColorToken(yychar,yychar + yylength(),
"0xF5F5DC"); }
Bisque { return new ColorToken(yychar,yychar + yylength(),
"0xFFE4C4"); }
Black { return new ColorToken(yychar,yychar + yylength(),
"0x000000"); }
BlanchedAlmond { return new ColorToken(yychar,yychar + yylength(),
"0xFFEBCD"); }
Blue { return new ColorToken(yychar,yychar + yylength(),
"0x0000FF"); }
BlueViolet { return new ColorToken(yychar,yychar +
yylength(), "0x8A2BE2"); }
Brown { return new ColorToken(yychar,yychar + yylength(),
"0xA52A2A"); }
BurlyWood { return new ColorToken(yychar,yychar +
yylength(), "0xDEB887"); }
CadetBlue { return new ColorToken(yychar,yychar +
yylength(), "0x5F9EA0"); }
Then activate the elastic tabstops, it works fine.
Select lines 3 4 and 5 and unindent then indent, elastic tabstops will
fail to reindent correctly.
And if you paste the same text in a buffer that has elastic tabstops,
you get an exception
The duplicate line macro also creates exceptions
Matthieu
Post by Eric Berry
Post by Nick Gravgaard
Imagine colouring in the different column blocks in the same way as
the
Post by Eric Berry
Post by Nick Gravgaard
coloured diagram at
http://nickgravgaard.com/elastictabstops/#solution
Does that help?
It does, thank you. It's still an odd behavior that differs greatly
from
Post by Eric Berry
jEdit's normal behavior. It will take some getting used to and
explaining.
Post by Eric Berry
It definitely works and looks better when applied to the whole
document.
Post by Eric Berry
Anshal, could you please update jEdit's help docs to include a link to
Nick's documentation? It'd be great if we could include that animated
gif he
Post by Eric Berry
created, and if it's ok with him. It won't be animated (I don't think),
but
Post by Eric Berry
I think it would be very helpful.
Post by Nick Gravgaard
Post by Eric Berry
Also, while this feature didn't make it to the next jEdit 4.4
release,
Post by Eric Berry
Post by Nick Gravgaard
Post by Eric Berry
there
http://www.tellurianring.com/projects/jedit-daily/index.php?dir=jEdit
Post by Eric Berry
Post by Nick Gravgaard
Post by Eric Berry
The latest ones have it, and you can use the UpdaterPlugin to update
to
Post by Eric Berry
Post by Nick Gravgaard
Post by Eric Berry
the
latest daily builds from within jEdit.
I'm hoping to convince others to do a 4.5 final release half way
through
Post by Eric Berry
Post by Nick Gravgaard
Post by Eric Berry
2011, and elastic tabstops will definitely be a part of that one.
Good stuff. Is it too early for me to give some publicity to this?
Nick
Up to you. Always good to have jEdit publicity. :)
Are the UpdaterPlugin, and daily builds enough for at least the next
6-8
Post by Eric Berry
months? I can only suggest a 4.5 release mid-way through next year,
can't
Post by Eric Berry
guarantee it'll happen.
--
Learn from the past. Live in the present. Plan for the future.
Blog: http://www.townsfolkdesigns.com/blogs/elberry
jEdit <http://www.jedit.org> - Programmer's Text Editor
Bazaar <http://bazaar.canonical.com> - Version Control for Humans
------------------------------------------------------------------------------
Post by Eric Berry
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that
run
Post by Eric Berry
across multiple browsers and platforms. Download your free trials
today!
Post by Eric Berry
http://p.sf.net/sfu/adobe-dev2dev
--
-----------------------------------------------
jEdit Developers' List
https://lists.sourceforge.net/lists/listinfo/jedit-devel
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
--
-----------------------------------------------
jEdit Developers' List
https://lists.sourceforge.net/lists/listinfo/jedit-devel
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
--
-----------------------------------------------
jEdit Developers' List
https://lists.sourceforge.net/lists/listinfo/jedit-devel
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
--
-----------------------------------------------
jEdit Developers' List
https://lists.sourceforge.net/lists/listinfo/jedit-devel
Shlomy Reinstein
2010-10-20 21:22:19 UTC
Permalink
Hi Anshal,

Do you think you can fix rectangular selection to work the right way? So it
can support both variable-width fonts and elastic tabstops? We got several
bug reports for that in the past (for the font problem).

Shlomy
Post by goodfella
Hi,
I submitted a fix (Tracker:Patches > 3091530 ) for the exception coming on
turning off elastic tabstops >pasting text> turning on Elastic tabstops
Can somebody apply this please ?
Post by Dale Anson
Post by Matthieu Casanova
The duplicate line macro also creates exceptions
Matthieu , can you please check whether this exception is still coming
(after applying the above patch) as I am not getting it.
Post by Dale Anson
Post by Matthieu Casanova
Also, I replied to the other thread on elastic tab stops that rectangular
selection does not work when elastic tab stops are turned on.
Rectangular Selection does not work with elastic tabstops as it has been
implemented using character offsets and not absolute screen positions (this
is the same reason for it not working properly with variable width fonts
).Size of tab character varies for every line in case of elastic tabstops
.So basically in case of elastic tabstops for a random integer n
space taken by "n" characters of line no. 1 != space taken by "n"
characters of line no. 2 !=space taken by "n" characters of line no. 3
and so on ( if these n characters have a tab in between them )
Regards,
Anshal
Post by Dale Anson
That looks like the same error I was getting a couple of days ago, but I
couldn't figure out how to reproduce.
Also, I replied to the other thread on elastic tab stops that rectangular
selection does not work when elastic tab stops are turned on.
Dale
Post by Matthieu Casanova
Hi,
1. If you copy the lines from the email, you are likely to get spaces
instead of tabs. So after pasting the below text into a new buffer, replace
all "\s+" with "\t" using a Regular Expression replacement to get the
desired effect.
2. As soon as I change the buffer to use elastic tabstops, I get the
following exception, and the text area becomes empty (due to the exception,
nothing is painted).
Shlomy
1:32:00 PM [AWT-EventQueue-0] [error] ExtensionManager: Error repainting
& Thread : AW
T-EventQueue-0 :Cannot find the size for tab at offset 0in line 0while
searching in
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ColumnBlock.throwException(ColumnBlock.java:335)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ColumnBlock.getColumnBlock(ColumnBlock.java:236)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ElasticTabstopsTabExpander.nextTabStop(ElasticTabstopsTabExpande
r.java:46)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.syntax.Chunk.init(Chunk.java:369)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.syntax.DisplayTokenHandler.initChunk(DisplayTokenHandler.java:226)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.syntax.DisplayTokenHandler.merge(DisplayTokenHandler.java:251)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.syntax.DisplayTokenHandler.handleToken(DisplayTokenHandler.java:130)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.syntax.TokenMarker.markTokens(TokenMarker.java:250)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.buffer.JEditBuffer.markTokens(JEditBuffer.java:1383)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ChunkCache.lineToChunkList(ChunkCache.java:789)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ChunkCache.updateChunksUpTo(ChunkCache.java:671)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ChunkCache.getLineInfo(ChunkCache.java:256)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.ExtensionManager.paintScreenLineRange(ExtensionManager.java:104)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
org.gjt.sp.jedit.textarea.TextAreaPainter.paint(TextAreaPainter.java:869)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.JComponent.paintToOffscreen(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.RepaintManager.paint(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.JComponent._paintImmediately(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.JComponent.paintImmediately(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown
Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.event.InvocationEvent.dispatch(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventQueue.dispatchEvent(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
1:32:01 PM [AWT-EventQueue-0] [error] ExtensionManager: at
java.awt.EventDispatchThread.run(Unknown Source)
On Wed, Oct 20, 2010 at 12:21 PM, Matthieu Casanova <
Post by Matthieu Casanova
Hi,
In an empty buffer without elastic tabstop, paste this
AliceBlue { return new ColorToken(yychar,yychar +
yylength(), "0xF0F8FF"); }
AntiqueWhite { return new ColorToken(yychar,yychar +
yylength(), "0xFAEBD7"); }
Aqua { return new ColorToken(yychar,yychar + yylength(),
"0x00FFFF"); }
Aquamarine { return new ColorToken(yychar,yychar +
yylength(), "0x7FFFD4"); }
Azure { return new ColorToken(yychar,yychar + yylength(),
"0xF0FFFF"); }
Beige { return new ColorToken(yychar,yychar + yylength(),
"0xF5F5DC"); }
Bisque { return new ColorToken(yychar,yychar + yylength(),
"0xFFE4C4"); }
Black { return new ColorToken(yychar,yychar + yylength(),
"0x000000"); }
BlanchedAlmond { return new ColorToken(yychar,yychar + yylength(),
"0xFFEBCD"); }
Blue { return new ColorToken(yychar,yychar + yylength(),
"0x0000FF"); }
BlueViolet { return new ColorToken(yychar,yychar +
yylength(), "0x8A2BE2"); }
Brown { return new ColorToken(yychar,yychar + yylength(),
"0xA52A2A"); }
BurlyWood { return new ColorToken(yychar,yychar +
yylength(), "0xDEB887"); }
CadetBlue { return new ColorToken(yychar,yychar +
yylength(), "0x5F9EA0"); }
Then activate the elastic tabstops, it works fine.
Select lines 3 4 and 5 and unindent then indent, elastic tabstops will
fail to reindent correctly.
And if you paste the same text in a buffer that has elastic tabstops,
you get an exception
The duplicate line macro also creates exceptions
Matthieu
Post by Eric Berry
Post by Nick Gravgaard
Imagine colouring in the different column blocks in the same way as
the
Post by Eric Berry
Post by Nick Gravgaard
coloured diagram at
http://nickgravgaard.com/elastictabstops/#solution
Does that help?
It does, thank you. It's still an odd behavior that differs greatly
from
Post by Eric Berry
jEdit's normal behavior. It will take some getting used to and
explaining.
Post by Eric Berry
It definitely works and looks better when applied to the whole
document.
Post by Eric Berry
Anshal, could you please update jEdit's help docs to include a link to
Nick's documentation? It'd be great if we could include that animated
gif he
Post by Eric Berry
created, and if it's ok with him. It won't be animated (I don't
think), but
Post by Eric Berry
I think it would be very helpful.
Post by Nick Gravgaard
Post by Eric Berry
Also, while this feature didn't make it to the next jEdit 4.4
release,
Post by Eric Berry
Post by Nick Gravgaard
Post by Eric Berry
there
http://www.tellurianring.com/projects/jedit-daily/index.php?dir=jEdit
Post by Eric Berry
Post by Nick Gravgaard
Post by Eric Berry
The latest ones have it, and you can use the UpdaterPlugin to
update to
Post by Eric Berry
Post by Nick Gravgaard
Post by Eric Berry
the
latest daily builds from within jEdit.
I'm hoping to convince others to do a 4.5 final release half way
through
Post by Eric Berry
Post by Nick Gravgaard
Post by Eric Berry
2011, and elastic tabstops will definitely be a part of that one.
Good stuff. Is it too early for me to give some publicity to this?
Nick
Up to you. Always good to have jEdit publicity. :)
Are the UpdaterPlugin, and daily builds enough for at least the next
6-8
Post by Eric Berry
months? I can only suggest a 4.5 release mid-way through next year,
can't
Post by Eric Berry
guarantee it'll happen.
--
Learn from the past. Live in the present. Plan for the future.
Blog: http://www.townsfolkdesigns.com/blogs/elberry
jEdit <http://www.jedit.org> - Programmer's Text Editor
Bazaar <http://bazaar.canonical.com> - Version Control for Humans
------------------------------------------------------------------------------
Post by Eric Berry
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that
run
Post by Eric Berry
across multiple browsers and platforms. Download your free trials
today!
Post by Eric Berry
http://p.sf.net/sfu/adobe-dev2dev
--
-----------------------------------------------
jEdit Developers' List
https://lists.sourceforge.net/lists/listinfo/jedit-devel
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
--
-----------------------------------------------
jEdit Developers' List
https://lists.sourceforge.net/lists/listinfo/jedit-devel
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
--
-----------------------------------------------
jEdit Developers' List
https://lists.sourceforge.net/lists/listinfo/jedit-devel
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
--
-----------------------------------------------
jEdit Developers' List
https://lists.sourceforge.net/lists/listinfo/jedit-devel
Nick Gravgaard
2010-11-04 13:08:20 UTC
Permalink
Hi Anshal,

I didn't hear anything back concerning my point about using minimum
width and padding width values.

To clarify:

Where text_width is the width of the widest piece of text in each
vertical run of cells, instead of using:
text_width_px + tab_width_px
you should set each cell's width in that run to:
max(text_width_px, minimum_width_px) + padding_width_px

If you don't want to have text fields for minimum width and padding
width in the Options GUI, I would strongly recommend doing what Code
Browser does - derive minimum width and padding width from the user's
tab_width something like this:
tab_width_px = tab_width_chars * m_width_px
padding_width_px = 2 * m_width_px
minimum_width_px = tab_width_px - padding_width_px

In the code above, tab_width_chars is the "tab width" that the user's
specified in characters, m_width_px is the pixel width of an 'M' (what
typographers call an "em" - see also: "em-quads") in whichever font the
user's chosen. Perhaps jEdit already has an amount of pixels it uses for
the width of an unspecified character, in which case you should probably
use that instead.

Please ask if you're not sure what I mean. I'm really looking forward to
seeing elastic tabstops in jEdit, but it's important that it's done
right.

Cheers,
Nick
Post by goodfella
Hi ,
I had a discussion with Nick Gravgaard (the inventor of elastic tabstops)
about my elastic tabstops implementation for jedit.
I also talked about the indentation issue noticed by Eric.Please see the
mail chain of the discussion below.
Best Regards,
Anshal
---------- Forwarded message ----------
Date: Wed, Oct 20, 2010 at 2:13 AM
Subject: Re: Elastic tabstops implementation for jedit
Hi again Anshal.
It looks good :) but it doesn't seem to use a minimum width and padding
width. On my Java applet, try typing a couple of characters in the empty
cell before "doSomethingComplicated();". As long as the text is thinner
than the minimum width value the cell won't stretch (a cell's width is
max(text_width, minimum_width) + padding_width). On your implementation,
typing anything makes it grow (presumably you're just using text_width +
tab_width).
If you don't want to use explicit pixel values you could do what Code
Browser does, which is something like, if tabs are set to 8 characters,
makes the minimum width 6 "m"s, and the padding width 2 "m"s, so an
empty cell is as wide as what the user has set tabs to be.
I think this makes it more usable and more attractive. It also means
that some text can be typed into a cell without things moving all the
time.
Another thing - after watching that video it seems that one thing that
was confusing the user was when he was unindenting a block of code. What
most editors (jEdit included) do when a user unidents a range of lines
of text, is iterate through the selected lines and remove the first tab
(let's ignore spaces for now) on each line. If there is no tab it just
leaves the line alone. That is what jEdit is doing, but because there
was a tab after a wide bit of text on a line that did not start with a
tab, the text on the other lines shifted to the right to fit the wide
piece of text. That is correct behaviour.
All in all though, congratulations - this looks great! When will this
feature be released so that people can use it and I can start telling
people about it?
Nick
Hi Nick,
Thanks for your comments :)
I have attached two zip files containing jedit.jar and modes folder.
Please
extract them parallel to each other i.e. jedit.jar and modes folder MUST
be
located in the same folder .
and run the command
java -jar jedit.jar
This should start jedit.Elastic tabstops are disabled by default .
1)globally inside- Utilities>Global Options>Editing by ticking the
checkbox
"Indent using elastic tabstops".(This setting always persists )
2)on a per buffer basis inside - Utilities>Buffer Options> by ticking the
checkbox "Indent using elastic tabstops" .(This setting is lost once the
buffer is closed)
Please try it out and let me know how it goes.
Yes I verified this beahviour in the Java applet on your site and also in
the Code Browser editor.
I will be forwarding you some mail chains feel free to air your views in
them.
Best Regards,
Anshal
Hi Anshal,
It's great to hear you've implemented elastic tabstops for JEdit :) I
would love to try it out - what's the easiest way for me to do that?
Alan Ezust
2010-12-08 18:42:23 UTC
Permalink
What happened in the end? I think it was committed to jEdit, but I
can't see anything about it mentioned in CHANGES.txt or the
documentation.
Shouldn't it be documented somewhere? If someone wants to give me a
paragraph or two and tell me where to put it, I can handle the
docbook/XML part. But someone needs to explain it to me as if I don't
know what elastic tabstops is (which is true).
Alan Ezust
2010-12-08 18:48:07 UTC
Permalink
oops. nevermind, I see it is in the docs. just not in the CHANGES. I
will fix that.
Post by Alan Ezust
What happened in the end? I think it was committed to jEdit, but I
can't see anything about it mentioned in CHANGES.txt or the
documentation.
Shouldn't it be documented somewhere? If someone wants to give me a
paragraph or two and tell me where to put it, I can handle the
docbook/XML part. But someone needs to explain it to me as if I don't
know what elastic tabstops is (which is true).
Loading...