Skip to content

fix(#1270): open_on_setup_file does not override open_on_setup, hijack_directories does not override startup behaviour #1618

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

Merged

Conversation

alex-courtis
Copy link
Member

@alex-courtis alex-courtis commented Oct 2, 2022

Investigating #1270 and found some bugs and inconsistencies:

Bugs: open_on_setup_file overrides open_on_setup

Inconsistencies: hijack_directories overrides open_on_setup. Not necessarily a bug, however this behaviour has been updated to match the documentation.

Documentation has been clarified.

…k_directories does not override startup behaviour
@alex-courtis
Copy link
Member Author

Test cases:

defaults

  • file
  • dir
  • empty
  • none

open_on_setup

  • file
  • dir
  • empty
  • none

open_on_setup_file

  • file
  • dir
  • empty
  • none

open_on_setup, open_on_setup_file

  • file
  • dir
  • empty
  • none

open_on_setup, ignore_buffer_on_setup

  • file
  • dir
  • empty
  • none

open_on_setup_file, ignore_ft_on_setup

  • file ft match
  • file
  • dir
  • empty
    none

open_on_setup, ignore_ft_on_setup

  • file ft match
  • file
  • dir
  • empty
  • none

@alex-courtis
Copy link
Member Author

If we were building from scratch today, I'd define options like these, however that is way too disruptive a change to make:

  startup = {
    open = {
      always = false,
      dir = false,
      file = false,
      empty = false,
    },
    focus_tree = {
      always = false,
      dir = false,
      file = false,
      empty = false,
    },
    ignore_ft = {
    }
  }

@kyazdani42
Copy link
Member

kyazdani42 commented Oct 3, 2022

i have edge case testing for open on setup also:

  • man man with export MANPAGER="nvim +Man!" or git operations with nvim.
  • lazy loading, but this shouldn't be affected.

@alex-courtis
Copy link
Member Author

alex-courtis commented Oct 4, 2022

  • man man with export MANPAGER="nvim +Man!"

This doesn't open the tree unless:

    ignore_buffer_on_setup = true,
    open_on_setup = true,

git operations with nvim

The tree will be opened when open_on_setup_file = true. I've never actually noticed this, but now you point it out I do...

This can be stopped via:

		ignore_ft_on_setup = {
			"gitcommit"
		},

Perhaps we could add that as a default.

I think I'm missing something...

@kyazdani42
Copy link
Member

thats good then, the behavior might be the same as before.

Copy link
Member

@kyazdani42 kyazdani42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets try this, if users complain we can just revert.

@alex-courtis
Copy link
Member Author

Unfortunately this change has been reverted due to many regressions: #1668

A new mechanism to control startup behaviour is under way: #1669

@alex-courtis alex-courtis deleted the 1270-open_on_setup_file-overriding-open_on_setup branch December 16, 2022 04:38
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

Successfully merging this pull request may close these issues.

2 participants