Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single bullet point folds in itself #5

Closed
mhep opened this issue Dec 13, 2013 · 8 comments
Closed

Single bullet point folds in itself #5

mhep opened this issue Dec 13, 2013 · 8 comments

Comments

@mhep
Copy link

mhep commented Dec 13, 2013

First off, thank you for making workflowish available, it is very helpful!

Yet I've been encountering an issue, for which I hope there may be an easy solution. I will append my .vimrc, incase the issue lies there:

Whenever I write a bullet point which goes over my linebreak, it automatically continues on the following line. Yet when I fold a bullet point, every bullet point, which is longer than one line, folds as well. I've added two images to highlight what's happening.

vim1
vim2

Is there anyway to stop folding lines when they belong to one bullet point?

Thanks a lot!

set tw=100
set autoindent
set formatoptions=tcq
set com=fb:*
set formatlistpat=^\\s*[0-9*]\\+[\\]:.)}\\t\ ]\\s*
set spell
set spelllang=de
colorscheme synic
set fileencoding=utf8
execute pathogen#infect()
syntax on
filetype plugin indent on

EDIT

I've been able to stop the issue from repeating itself by adding the following lines to my .vimrc:

autocmd BufWinLeave *.* mkview
autocmd BufWinEnter *.* silent loadview
@floer32
Copy link
Collaborator

floer32 commented Oct 27, 2015

@lukaszkorecki @Mahaha should we just add the EDIT solution to readme? i.e.


Installation

Install with pathogen

Configuration tweak recommended

This fixes an edge-case with folding bullets. We recommend you add this to your .vimrc:

autocmd BufWinLeave *.* mkview
autocmd BufWinEnter *.* silent loadview

@lukaszkorecki
Copy link
Owner

@hangtwenty @Mahaha @flugsio any reason why it can't be included in the workflowish code?

@floer32
Copy link
Collaborator

floer32 commented Oct 27, 2015

@lukaszkorecki Well, I don't have the command of Vim or Vimscript or (doing a ton of things to your vim that might interact with each other), to know whether that's a risky change or not. I'll defer to you or @Mahaha on what's best.

I don't mind making the code change when we know what is best

@lukaszkorecki
Copy link
Owner

@hangtwenty me neither :-), I think this shouldn't mess up too many things:

autocmd BufWinLeave *.wofl mkview
autocmd BufWinEnter *.wofl silent loadview

To address this without much risk it's best to update the README with that snippet and link to this issue.

@flugsio
Copy link
Collaborator

flugsio commented Oct 28, 2015

I don't like the workaround. If I understand the issue correctly, bullets spanning multiple lines should never be foldable? (maybe with a toggle)

Currently, there is no "multiline" bullets. Every line is a bullet/item regardless of what characters it begins with. They are foldable if they have lines under them with at least 1 full indent (2 spaces for example).

Another workaround is to use less indent for the next lines. This can be accomplished in multiple ways, for example using only 1 space, or prefix with some other character that is at the same indent.

* first
  * second bullet which continues
  \ on the next line
  _ starting with random character
   or less indent
   like this
  * third
    * third child

One solution is to not only check the indents, but also the characters to determine foldlevels. To add this feature in the code, it would need to scan the contents around every line and either compute relative to previous indentlevels or scan all the way to the root. For longer files this could cause a significant slowdown. Here is the relevant function

if next_indent > this_indent

@lukaszkorecki
Copy link
Owner

Ok, that sounds way too complicated fix for an edge case.

Lets add that snippet to the readme and link to this issue.

lukaszkorecki added a commit that referenced this issue Oct 30, 2015
Fix for #5, also Pathogen installation note
@floer32
Copy link
Collaborator

floer32 commented Nov 12, 2015

@lukaszkorecki close it up?

@lukaszkorecki
Copy link
Owner

@hangtwenty done 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants