nvimdev / dashboard-nvim

vim dashboard
MIT License
2.36k stars 193 forks source link

[Bugs] Several Issues With Telescope... #65

Closed ahmedkhalf closed 2 years ago

ahmedkhalf commented 3 years ago

Hello, I am experiencing several issues with telescope and I am not sure if the problem is from dashboard or telescope itself.

  1. number and sign column are not visible after using telescope: Steps to reproduce:

    1. set number and set signcolumn=yes in init.vim
    2. select a a recently opened file from dashboard-nvim
    3. to your horror, when the file is open, it does not have a number and sign column
  2. Pressing escape when telescope is on creates an empty buffer and closes dashboard-nvim Expected behavior: Pressing escape should return me to the dashboard-nvim and not creates an empty buffer...

  3. Pressing ctrl-j & ctrl-k does not bring my cursor up or down in telescope but instead write the ctrl character in the text box.

ahmedkhalf commented 3 years ago

I have successfully identified why 1 and 2 are happening: terminal size?! When my terminal occupies half the screen, bug 1 and 2 appear, but when terminal covers my full screen, bug 1 and 2 are gone...

ChristianChiarulli commented 3 years ago

@ahmedkhalf I think it is definitely due to the empty buffer created by telescope, hence why nobuflisted had an effect on the issue.

glepnir commented 3 years ago

with telescope right?

glepnir commented 3 years ago

check there https://github.com/nvim-telescope/telescope.nvim/issues/377

glepnir commented 3 years ago

it's an known issue of telescope . when you reduce the window size you will see this issue.

ronisbr commented 3 years ago

I just found an "acceptable" workaround until Telescope fix the issue. Add to your telescope configuration:

    layout_defaults = {
      flex = {
        flip_columns = 130
      }
    },
    layout_strategy = 'flex',

Hence, if the window is narrow, then the preview will be shown on top. If the preview window is shown, then this bug does not happen.

akinsho commented 3 years ago

Just adding this to help the debugging efforts.

I don't think this issue is entirely about telescope. Although I'm new to the party and could be wrong. I just started using this plugin and noticed my settings were being removed so I used verbose set <affected-setting>? for example verbose set signcolumn? just after opening a buffer with telescope coming from dashboard.

The output of that is

signcolumn=auto
        Last set from ~/.local/share/nvim/site/pack/packer/start/dashboard-nvim/autoload/dashboard.vim line 40

this line here sets a bunch of local setting like signcolumn=no, nonumber norelativenumber etc. The problem with this is that telescope at least not sure if any other picker does this re-uses the same window when it opens the selection, so all the window options remain the same. If I open a new window it uses the settings from my init.lua instead so the problem goes away.

I think not being super hot on vimscript that the values of the user's options should be saved before setting dashboard's settings and then on close of dashboard via an autocommand maybe the original user settings should be re-applied.

I know this function I pointed at is essentially the same as in startify but it also has the same problem i.e. if you open a buffer from telescope from startify init.lua setting don't get applied to the window.

glepnir commented 2 years ago

hmm does this issue still exist?

ronisbr commented 2 years ago

@glepnir Welcome back!!

glepnir commented 2 years ago

hello :)