outline level numbering is wacked?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

outline level numbering is wacked?

Sam Roberts-2
(sending again now that I am subscribed, sorry if it appears twice)

I don't know, maybe I am using it wrong, but it sure doesn't make sense to me!

The coloring is also a screwed up, since it seems to be following the
numbering.

I'm quite enjoying vimoutliner mode other than this.


Here's what I see (NOTES is attached), lines starting with -- are comments:

=======================================
-NOTES
-  Data structure
-    objc is the module table
-      ; objc = {
4      ;   class = lua_objc_lookup_class

-- why is the whole preformatted thing not at the same level, 4?
4      ;   __lua_objc_ids = {
4      ;     <light userdara of value ptr> = <light userdata of id>
4      ;   }
-    id (an obj-c object) is represented as a table:
-      ; id = {}
4      ; id->metatable = {
4      ;   __index = lua_objc_method_lookup
4      ;   __gc    = lua_objc_release
4      ;   __lua_objc_id = <light userdata of id>
4      ; }
3      _ FIXME id uses {}, not ud, so __gc doesn't work!
-- why is this at level 3, its level 4!

-    string, number, and boolean all have the same metatable as an id, minus the __lua_objc_id
-      : its presence is used as a flag, if there is a metatable for the value, its "pointer"
4      : is looked up in objc.__lua_objc_ids, to find an id for this value
-      _ FIXME this doesn't work,
-- why not at level 4, like the line above?


-        _ id is randomly lost


-- why not at level 5?

-          : NSStrings that compare equal will have the same lua pointer
-        _ no garbage collection on this table, it is a memory leak!
-          : not sure how this could be fixed
6      : Why is all this done, anyhow, why not attach appropriate metatables to userdata?

-- level 6? this level was 4 a little while ago!

-  Todo
2    _ use full userdata instead of tables for id

-- how come level 2 is numbered now, but didn't used to be?
-- also, this is level 3, not 2?

2    _ allow NSArray/NSDictionary, NSNumber, NSString, etc., to behave more luaish?
2    _ We could cache results from NSSelectorFromString() - benchmark it...
2    _ Why does an NSAutoreasePool lie and say  respondsToSelector:@selector(retain) is true?
 
 vim:ft=vo_base:ts=2:sw=2:
=======================



_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner

NOTES (1K) Download Attachment
.vimoutlinerrc (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: outline level numbering is wacked?

David T Harris
You have to make certain that you hit tab every tab you want
to create a new level.  If you just hit enter, every
new line will be on the same level as your previous line.
If you start backspacing on a line, then levels get
messed up.  You can fix this by going to the line that's messed
up in command mode.  Hit "dw" to make the content of the line
go the beginning of that current line.  Then hit tab
until the content is at the right location.

_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: outline level numbering is wacked?

Sam Roberts-2
Quoting [hidden email], on Sat, Mar 10, 2007 at 08:06:18PM -0500:
> You have to make certain that you hit tab every tab you want
> to create a new level.  If you just hit enter, every
> new line will be on the same level as your previous line.
> If you start backspacing on a line, then levels get
> messed up.

How are you supposed to get back out a level without backspacing, is there some
other way?

> You can fix this by going to the line that's messed
> up in command mode.  Hit "dw" to make the content of the line
> go the beginning of that current line.  Then hit tab
> until the content is at the right location.

I don't think that made any difference.

I think I'm seeing two things:
- any line  that has a ; or a : has an indent level 1 more than I would
  expect based on the number of tabs
- and indent levels for a : area seem to follow the previous line,
  disregarding the number of tabs entirely, see the last line below

In the below, every two leading spaces is actually a TAB character.

===================================================
-NOTES
-  Data structure
-    objc is the module table
3      this is level 3
-      ; but shouldn't this be level 3?
4      ; why is it level4?
-      _ i guess this is back at 3
4        _ because this is 4
4        _ this is 4
-        _ this is 4
-          : this became 6..., because its got the +1 text area effect
6      : but how come this is 6?
 
 vim:ft=vo_base:ts=2:sw=2:

_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: outline level numbering is wacked?

Steve Litt
On Sunday 11 March 2007 03:35, Sam Roberts wrote:
> Quoting [hidden email], on Sat, Mar 10, 2007 at
08:06:18PM -0500:
> > You have to make certain that you hit tab every tab you want
> > to create a new level.  If you just hit enter, every
> > new line will be on the same level as your previous line.
> > If you start backspacing on a line, then levels get
> > messed up.
>
> How are you supposed to get back out a level without backspacing, is there
> some other way?

If you're in Insert Mode, backspacing is exactly how you promote a headline.
You use Tab to demote.

If you're in Edit Mode, use << to promote (or >> to demote). It promotes the
current headline, or if the current headline is collapsed, it promotes the
collapsed tree. You can also select a bunch of headlines, use < to promote or
> to demote.

By the way, I read but didn't understand your original post. Could you please
submit a 2 or 3 line outline that reveals one symptom, so we can try to
reproduce it?

Thanks

SteveT
_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: outline level numbering is wacked?

Sam Roberts-2
Quoting [hidden email], on Sun, Mar 11, 2007 at 10:10:01AM -0400:
> By the way, I read but didn't understand your original post. Could you please
> submit a 2 or 3 line outline that reveals one symptom, so we can try to
> reproduce it?

==== save as p.otl ===
level 0
        level 1
                level 2
                        level 3
                                : level 4
                                : level 4
: level 4
==============

This appears as:

===vim screenshot====
-level 0
-  level 1
-    level 2
-      level 3
-        : level 4
5        : level 4
5: level 4
=====================

The last line is clearly at level 0, but it is labelled "5".


=== save as n.otl ===
level 0
        level 1
        ; level 1
        ; level 1
                level 2
                level 2
=============

This appears as:

========vim screenshot========
-level 0
|  level 1
-  ; level 1
2  ; level 1
-    level 2
2    level 2
==============================

The 3rd and 4th line are clearly at level 1, but the 4th line is labelled "2".

Cheers,
Sam

_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: outline level numbering is wacked?

Steve Litt
How did you get the numbers on the left?

Thanks

SteveT

On Sunday 11 March 2007 17:14, Sam Roberts wrote:

> Quoting [hidden email], on Sun, Mar 11, 2007 at 10:10:01AM -0400:
> > By the way, I read but didn't understand your original post. Could you
> > please submit a 2 or 3 line outline that reveals one symptom, so we can
> > try to reproduce it?
>
> ==== save as p.otl ===
> level 0
> level 1
> level 2
> level 3
>
> : level 4
> : level 4
> :
> : level 4
>
> ==============
>
> This appears as:
>
> ===vim screenshot====
> -level 0
> -  level 1
> -    level 2
> -      level 3
> -        : level 4
> 5        : level 4
> 5: level 4
> =====================
>
> The last line is clearly at level 0, but it is labelled "5".
>
>
> === save as n.otl ===
> level 0
> level 1
> ; level 1
> ; level 1
> level 2
> level 2
> =============
>
> This appears as:
>
> ========vim screenshot========
> -level 0
>
> |  level 1
>
> -  ; level 1
> 2  ; level 1
> -    level 2
> 2    level 2
> ==============================
>
> The 3rd and 4th line are clearly at level 1, but the 4th line is labelled
> "2".
>
> Cheers,
> Sam
>
> _______________________________________________
> VimOutliner mailing list
> [hidden email]
> http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: outline level numbering is wacked?

David T Harris




On Sun, 11 Mar 2007, Steve Litt wrote:

> How did you get the numbers on the left?
Those numbers appear if you're using version
7.0 of vim
_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: outline level numbering is wacked?

Sam Roberts-2
In reply to this post by Steve Litt
Quoting [hidden email], on Sun, Mar 11, 2007 at 05:48:07PM -0400:
> How did you get the numbers on the left?

Huh? I'm completely flumuxed, its like we don't even use the same editor.

I didn't "get" the numbers on the left, vimoutliner put them there. Its the
"foldcolumn" (:help foldcolumn").

Do you not expect the first column on the left in a terminal to be used by vim
and vimoutliner to show the fold level?  Is this some kind of gvim/vim in a
terminal miscommunication? Does gvim do something differently?

To answer your question literally:

I run vim in an xterm. I open the .otl files I sent you (p.otl and n.otl).  I
copy the relevant part of the xterm with the mouse. I paste that into the copy
of vim running in my mailer (with :set paste).

So, it's exactly what I see in my terminal window.  When you open, for example,
the p.otl file I showed in my email, it doesn't look like the screenshot I
included? Like this, for example?

=======THIS IS THE TOP OF MY XTERM WINDOW===============================================================|
-level 0
-  level 1
-    level 2
-      level 3
-        : level 4
5        : level 4
5: level 4
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
 ~                                                                                                      
"p.otl" 7L, 76C                                                                        1,1           All
===================BOTTOM OF XTERM =====================================================================|


_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: outline level numbering is wacked?

Steve Litt
On Sunday 11 March 2007 22:02, Sam Roberts wrote:
> Quoting [hidden email], on Sun, Mar 11, 2007 at 05:48:07PM -0400:
> > How did you get the numbers on the left?
>
> Huh? I'm completely flumuxed, its like we don't even use the same editor.
>
> I didn't "get" the numbers on the left, vimoutliner put them there. Its the
> "foldcolumn" (:help foldcolumn").

OK, now I see.

>
> Do you not expect the first column on the left in a terminal to be used by
> vim and vimoutliner to show the fold level?  

No. I think one upgrade of Vim put those there, but either the VO distro got
rid of it, or I put something in my .vimrc to get rid of it.

Anyway, now that I can reproduce your problem. With foldcolumn=1, mine looks
exactly like yours. With foldcolumn=3 and 5 it looks even more bizarre. All
three screenshots are attached...

Turns out the results you get happen when foldmethod=expr. If you switch
foldmethod=indent, all those columns are filled with lines.

I never use foldcolumn, so I can't say whether the numbers are an intentional
feature of VO or just a Vim side effect.

SteveT

_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner

f1.jpg (35K) Download Attachment
f3.jpg (36K) Download Attachment
f5.jpg (37K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: outline level numbering is wacked?

Noel Henson
In reply to this post by Sam Roberts-2
Watch the ':' in front of 'level 4'.

Noel

On Sunday 11 March 2007 14:14, Sam Roberts wrote:
> Quoting [hidden email], on Sun, Mar 11, 2007 at
10:10:01AM -0400:

> > By the way, I read but didn't understand your original post. Could you
> > please submit a 2 or 3 line outline that reveals one symptom, so we
> > can try to reproduce it?
>
> ==== save as p.otl ===
> level 0
> level 1
> level 2
> level 3
>
> : level 4
> : level 4
> :
> : level 4
>
> ==============
>
> This appears as:
>
> ===vim screenshot====
> -level 0
> -  level 1
> -    level 2
> -      level 3
> -        : level 4
> 5        : level 4
> 5: level 4
> =====================
>
> The last line is clearly at level 0, but it is labelled "5".
>
>
> === save as n.otl ===
> level 0
> level 1
> ; level 1
> ; level 1
> level 2
> level 2
> =============
>
> This appears as:
>
> ========vim screenshot========
> -level 0
>
> |  level 1
>
> -  ; level 1
> 2  ; level 1
> -    level 2
> 2    level 2
> ==============================
>
> The 3rd and 4th line are clearly at level 1, but the 4th line is
> labelled "2".
>
> Cheers,
> Sam
>
> _______________________________________________
> VimOutliner mailing list
> [hidden email]
> http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner

--

------------------------------------------------------------------
  Noel Henson
  www.noels-lab.com Chips, firmware and embedded systems
  www.vimoutliner.org Work fast. Think well.

_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: outline level numbering is wacked?

Sam Roberts-2
In reply to this post by Steve Litt
Quoting [hidden email], on Sun, Mar 11, 2007 at 11:43:02PM -0400:

> > Do you not expect the first column on the left in a terminal to be used by
> > vim and vimoutliner to show the fold level?  
>
> No. I think one upgrade of Vim put those there, but either the VO distro got
> rid of it, or I put something in my .vimrc to get rid of it.
>
> Anyway, now that I can reproduce your problem. With foldcolumn=1, mine looks
> exactly like yours. With foldcolumn=3 and 5 it looks even more bizarre. All
> three screenshots are attached...
>
> Turns out the results you get happen when foldmethod=expr. If you switch
> foldmethod=indent, all those columns are filled with lines.
>
> I never use foldcolumn, so I can't say whether the numbers are an intentional
> feature of VO or just a Vim side effect.

Thanks, that points at whats going on.

I don't have any foldsettings in my personal config, so I'm just using
what .vim/ftplugin/vo_base.vim sets at about line 80:

 foldcolumn=1
 foldmethod=expr
 foldexpr=MyFoldLevel(v:lnum)

I don't know enough vimscript to understand the MyFoldLevel function,
but it looks like it's not entirely correct.

And actually, I'm not too sure what its purpose is, since when I use
foldmethod=indent, it looks "right" - which makes sense, since
vimoutliner uses leading indents to indicate depth, just counting the
indent should be an easy way to get fold depth, shouldn't it?

Anyhow, I've put "setlocal foldmethod=indent" in my
.vim/after/ftplugin/vo_base.vim, and all is well, but someone who
understands these things might want to look at MyFoldLevel(), what I saw
was what anybody with a vanilla vim7 running in a terminal would see.

Thanks,
Sam

_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner