Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Allow spaces between headings #31

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

ralesi commented Mar 2, 2012

I sometimes like to have spaces in between headings to make the structure more obvious. The current implementation of s:OrgSubtreeLastLine_l will search for the next star at the same level and subtract one. However, with this algorithm, you get this problem:

*** Headings 1
*** Heading 2
**** SubHead1

**** ^
*** Heading3

This fix skips over all blank lines to give the desired behavior:

*** Headings 1
*** Heading 2
**** SubHead1
**** ^

*** Heading3
Owner

hsitz commented Mar 2, 2012

On Fri, Mar 2, 2012 at 12:31 PM, Rich Alesi
reply@reply.github.com
wrote:

-- Commit Summary --

  • Allow spaces between headings

-- File Changes --

M ftplugin/org.vim (16856)

-- Patch Links --

 https://github.com/hsitz/VimOrganizer/pull/31.patch
 https://github.com/hsitz/VimOrganizer/pull/31.diff

Rich -- Thanks a lot, that functionality would be good to have, but I
may change it to be an option (or have option not to have it).
Unfortunately, the diff file for your changes seems to have flagged
every line and it's hard for me to see what changes are. Are changes
simple enough to give me a quick look via copy and past?

-- Herb

ralesi commented Mar 2, 2012

That teaches me to not try the edit and fork functionality within Github. From now on, I'll just make my own branch for pull requests

Starts at line 1314

if l:lastline != 0 
    let l:lastline -= 1
+    while getline(l:lastline) =~ '^$'
+        let l:lastline -= 1
+    endwhile
else
    let l:lastline = line("$")
endif
return l:lastline
Owner

hsitz commented Mar 2, 2012

On Fri, Mar 2, 2012 at 1:51 PM, Rich Alesi
reply@reply.github.com
wrote:

That teaches me to not try the edit and fork functionality within Github.  From now on, I'll just make my own branch for pull requests

I think it must be related from my having pushed up from
Windows machine.

Starts at line 1314

   if l:lastline != 0
       let l:lastline -= 1
   +    while getline(l:lastline) =~ '^$'
   +        let l:lastline -= 1
   +    endwhile
   else
       let l:lastline = line("$")
   endif
   return l:lastline

My first thought is this will cause issues with the section-moving
commands (e.g.., <c-a-[up-down-left-right]>) which depend on same
function to find end of block to move. I assume we don't want to
leave stay blank lines when moving sections. Hopefully that's only
issue and further changes to accommodate that are simple. . .

-- Herb

@ralesi ralesi closed this Jul 24, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment