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

Automatically set foldcolumn #93

Merged
merged 3 commits into from
Aug 18, 2017
Merged

Automatically set foldcolumn #93

merged 3 commits into from
Aug 18, 2017

Conversation

benknoble
Copy link
Owner

Description

Tweak the autofoldcolumn functionality

Related Issue

None...

Motivation and Context

Solves the problem of beeping unnecessarily and being not modular.

How Has This Been Tested?

Behavior

Open files with folds and without folds, or create and delete them, and watch as the fold column appears and disappears.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have tested my feature as described in CONTRIBUTING.

Prelim work on fixing my autofold feature

This should probably eventually turn into it's own plugin.
The pattern ?* requires there to be an actual character in the filename,
I believe, as it wasn't matching when I do :new.

The fix to reset belloff was that I simply didn't understand eval option
syntax.
Now it has parameters that control what to set foldcolumn to, and
returns the value for you to use rather than setting foldcolumn itself.

This could be extended into a plugin Auto Fold Column, with autoloaded functions
that detect folds, return the right values (based on global variables,
options passed in, and sane defaults), and easy to set up with a simple

:call AutoFoldColumn() " Use defaults or global vars
:call AutoFoldColumn(col, def) " Use the variables passed in

AutoFoldColumn would set up the auto command.

Need to google if Vim has a concept of default parameters.
@benknoble benknoble self-assigned this Aug 18, 2017
@benknoble benknoble added the vim label Aug 18, 2017
@benknoble benknoble added this to the Version 1.2 milestone Aug 18, 2017
@benknoble benknoble merged commit 95ed8b2 into vimrc Aug 18, 2017
@benknoble benknoble deleted the autofoldcolumn branch August 18, 2017 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant