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

Only catches inactive window when I have more than 2 buffers #50

Open
EdmundsEcho opened this issue Nov 15, 2020 · 4 comments
Open

Only catches inactive window when I have more than 2 buffers #50

EdmundsEcho opened this issue Nov 15, 2020 · 4 comments

Comments

@EdmundsEcho
Copy link

Nice work on this plugin. I was using an older one, but found your approach easier to configure and adjust "on the fly". This is a useful plugin and feature.

I had this problem with the other plugin as well, but never got around to documenting it until now. The problem persists for only those two, first opened buffers. I also noticed that the window will not dim if using the same buffer in both windows. Is that by design?

Here is the info report... let me know what else I can send you.

{
  "version": "0.0.5",
  "features": {
    "has_vimr": 0,
    "has_gui_running": 0,
    "has_nvim": 1,
    "has_sign_group": 1,
    "has_gui_version": 0,
    "has_gui": 0,
    "has_python3": 1,
    "has_sign_\npriority": 1,
    "has_python": 0
  },
  "python": {
    "original_background": "dark",
    "signs_priority": 31,
    "base_fg24b_last": "#e3e0d7",
    "base_fg256": [
      255,
      255,
      255
    ],
    "base_bg24b": [
      0,
      0,
      0
    ],
    "base_hi": [
      [
        255,
        255,
        255
      ],
      [
        0,
        0,
        0
      ],
      [
        227,
        224,
        215
      ],
      [
        0,
        0,
        0
      ],
      null
    ],
    "fade_priority": "10",
    "signs_group_text": " group=vimade ",
    "ENABLE_SIGNS": 8,
    "term\n_bg": "#000000",
    "is_nvim": true,
    "base_fg_exp24b": "#E3E0D7",
    "DISABLE_SIGNS": 16,
    "normal_fg24b": "#e3e0d7",
    "basegroups": [
      "Folded",
      "Search",
      "SignColumn",
      "LineNr",
      "\nCursorLine",
      "CursorLineNr",
      "DiffAdd",
      "DiffChange",
      "DiffDelete",
      "DiffText",
      "FoldColumn",
      "Whitespace"
    ],
    "term_fg": "#FFFFFF",
    "enable_scroll": 0,
    "background": "dark",
    "base_bg256": [
      0,
      0,
      0
    ],
    "group_diff": 1,
    "termguicolors": true,
    "term_response": false,
    "features": {
      "has_vimr": "0",
      "has_gui_running": "0",
      "has_nvim": "1",
      "has_gui_\nversion": "0",
      "has_sign_group": "1",
      "has_python3": "1",
      "has_sign_priority": "1",
      "has_gui": "0",
      "has_python": "0"
    },
    "col_buf_size": 5,
    "base_fg_exp256": "231",
    "signs_\npriority_text": " priority=31 ",
    "normal_fg256": "",
    "normal_bg24b": "",
    "fade_minimap": 1,
    "BASEGROUPS": 32,
    "normalnc_id": "47",
    "base_bg256_last": "#000000",
    "row_buf_s\nize": 0,
    "base_bg_exp24b": "#000000",
    "enable_basegroups": 1,
    "base_fade24b": "#9e9c96",
    "base_fg256_last": "#FFFFFF",
    "colorscheme": "\nwombat256mod",
    "signs_retention_pe\nriod": 4000,
    "base_fg24b": [
      227,
      224,
      215
    ],
    "group_scrollbind": 0,
    "base_bg_exp256": "16",
    "normal_bg256": "",
    "signs_id": 13102,
    "normal_id": "59",
    "base_fade256": "188",
    "base_bg24b_last": "#000000",
    "fade_level": 0.7,
    "is_term": true,
    "enable_signs": 1,
    "basegroups_faded": [
      [
        "vimade_23",
        " ctermfg=59",
        " ctermbg=16",
        " guifg=#545454",
        "\nguibg=#131313",
        ""
      ],
      [
        "vimade_9",
        " ctermfg=94",
        " ctermbg=16",
        " guifg=#7f5312",
        " guibg=#22201d",
        ""
      ],
      [
        "vimade_29",
        " ctermfg=59",
        "",
        " guifg=#404040",
        "",
        ""
      ],
      [
        "vima\nde_12",
        " ctermfg=59",
        "",
        " guifg=#404040",
        "",
        ""
      ],
      [
        "vimade_43",
        " ctermfg=102",
        " ctermbg=16",
        " guifg=#71706b",
        " guibg=#191917",
        ""
      ],
      [
        "vimade_13",
        " ctermfg=101",
        "\n",
        " guifg=#7f7f2f",
        "",
        ""
      ],
      [
        "vimade_25",
        " ctermfg=102",
        " ctermbg=17",
        " guifg=#71706b",
        " guibg=#150635",
        ""
      ],
      [
        "vimade_26",
        " ctermfg=102",
        " ctermbg=16",
        " guifg=#7\n1706b",
        " guibg=#1c151b",
        ""
      ],
      [
        "vimade_27",
        " ctermfg=16",
        " ctermbg=59",
        " guifg=#121212",
        " guibg=#1f1c34",
        ""
      ],
      [
        "vimade_28",
        " ctermfg=102",
        " ctermbg=53",
        " guifg=#7\n1706b",
        " guibg=#390c37",
        ""
      ],
      [
        "vimade_24",
        " ctermfg=59",
        " ctermbg=16",
        " guifg=#545454",
        " guibg=#131313",
        ""
      ],
      [
        "vimade_46",
        " ctermfg=59",
        "",
        " guifg=#404040",
        "",
        ""
      ]
    ]
  },
  "other": {
    "background": "dark",
    "vimade_running": 1,
    "vimade_error_count": 0,
    "colorscheme": "\nwombat256mod",
    "vimade_timer": 2,
    "normal_hi": [
      "#e3e0d7",
      "",
      ""
    ],
    "t_Co": "256",
    "normal_id": 59,
    "vimade_loaded": 1,
    "vimade_paused": 0,
    "vimade_py_cmd": "py3",
    "syntax": "javascript.jsx"
  },
  "config": {
    "enablesigns": 1,
    "signspriority": 31,
    "fadelevel": "0.7",
    "enablescroll": 0,
    "$extended": 1,
    "normalid": 59,
    "basebg": "",
    "usecursorhold": 0,
    "fadepriority": 10,
    "colbufsize": 5,
    "fademinimap": 1,
    "__back\nground": "dark",
    "signsid": 13100,
    "basefg": "",
    "__colorscheme": "\nwombat256mod",
    "enablebasegroups": 1,
    "normalncid": 47,
    "groupscrollbind": 0,
    "signsretentionperiod": 4000,
    "__termguicolors": 1,
    "rowbufsize": 0,
    "detecttermcolors": 0,
    "basegroups": [
      "Folded",
      "Search",
      "SignColumn",
      "LineNr",
      "CursorLine",
      "CursorLineNr",
      "DiffAdd",
      "Di\nffChange",
      "DiffDelete",
      "DiffText",
      "FoldColumn",
      "Whitespace"
    ],
    "groupdiff": 1,
    "enablefocusfading": 0,
    "checkinterval": 500
  }
}
@TaDaa
Copy link
Owner

TaDaa commented Nov 16, 2020

I think you mentioned two issues, but the first one isn't clicking with me atm (Mondays!), so let me know if this doesn't answer the question:

Buffers are linked by design to show where changes are occurring and to avoid the performance hit for recomputing active windows. There should be a way to optimize this in vimade, but I've kind of been leaning towards to making a GUI at some point

However, if you want to try fading windows instead of buffers the below has worked for some (although performance is going to be pretty cpu dependent and there might be some side effects). Let me know though...maybe this should just be a feature toggle :

augroup SemiDimPerWin
au!
au WinLeave * call OnWinLeave()
au WinEnter * call OnWinEnter()
au! TextChangedI,TextChanged * call UpdateBufferAsync()
augroup END


function! OnWinEnter ()
    VimadeFadeActive
    VimadeWinDisable
endfunction
function! OnWinLeave ()
    VimadeWinEnable
endfunction

function! UpdateBufferAsync ()
    if exists('g:update_vimade')
        return
    endif
    let g:update_vimade = timer_start(1, 'DoUpdateBuffer') "change the timer value from 1 to whatever to help with performance
endfunction

function! DoUpdateBuffer (w)
    unlet g:update_vimade
    call vimade#BufDisable()
    call vimade#BufEnable()
endfunction

@EdmundsEcho
Copy link
Author

Here are the dynamics I'm describing. There are two tmux panels: top and bottom. The top panel is a vim :vsplit with a different buffer in each.

VimDim_dynamics_2 mov

The issue: When I toggle between the vim splits, the first split does not change. This is true when the second (the right split), is active.

This dynamic in contrast to toggling between tmux panes. This dynamic is effected by iTerm. In this case, the behavior is as I would expect.

Note: Please ignore the fact that what the dimming effect is. I will eventually figure out how to accomplish the "dimming" effect given that I use a transparent background.

Does that help?

- E

@TaDaa
Copy link
Owner

TaDaa commented Nov 23, 2020

Still trying:) - -Would you mind just screenshotting the frame in particular that has the issue? I should be be able to have a better idea based on where the cursor is located and which windows are faded.

One thing I do see is that the the buffer is not faded when toggling down to the bottom tmux pane. Was this part of the issue (this can be fixed by using enablefocusfading, but requires following installing tmux-plugins/vim-tmux-focus-events and enabling set -g focus-events on in tmux.conf)

@EdmundsEcho
Copy link
Author

Ah. I wonder if you are not seeing the changes in background. I will send you screenshot with more contrast later in the week. In the meantime, I have the focus-events plugin working with tmux. It is working as expected. The active window is the one with the cyan rectangle cursor.

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

2 participants