Commit Graph

21 Commits

Author SHA1 Message Date
mamekoro
1b97f8f954 fix: set window height only when cfg.position is bottom or top (#14)
According to `:help topleft` and `:help botright`, these commands creates a window with the full height of the Vim window when used with `vnew`, so we don't need to update the `height` variable when using these commands.
2024-12-08 13:52:27 +02:00
Amr Bashir
365593534e fix: fix attempt to call global toggle (a nil value) (#12)
* fix: assign functions to `M` (module)

* call toggle and update using M.<function>
2024-08-16 07:08:40 +03:00
Stephen Waits
74a5e989e3 fix: clear buffer before updating with new markdown (#8)
Before: Given two sets of hover documentation, a) longer text (more lines) and b) shorter text (fewer lines).. when moving from a) to b), the extra lines from a remain in the buffer.

After: With this change, the buffer is cleared before adding new hover text, thus removing the excess trailing lines from any previous hover text.
2023-10-19 20:41:59 +03:00
amrbashir
a7ba30f8d5 fix: define update function before usage, fixes #7 2023-02-13 16:30:20 +02:00
amrbashir
601d7f6a2e feat: add update_mode option and :DocsViewUpdate, closes #6 2023-02-12 00:41:55 +02:00
amrbashir
6981376235 chore: fix formatting 2023-01-28 00:43:55 +02:00
amrbashir
79c518a9d7 feat: support top for position
closes #5
2023-01-28 00:42:39 +02:00
Manpreet Singh
f16573fe8a fix: prevent continuous textDocument/hover error when hover is not supported by any LSP (#4) 2022-10-07 13:46:46 +02:00
jmp
ea36462bb8 feat, refactor: add "bottom" position opt, update to Lua API command creation (#2)
* refactor: use Lua API for user command

    • remove "plugin" dir
    • make toggle() local

* feat: add "bottom" as valid "position" opt

    If "bottom" is given as "position" configuration value, open
    the docs window at the bottom of the window. Adding the "height"
    option complicates setting the window dimensions, e.g. if we are
    opening a split on the sides but also change the height of the
    window, it will resize "prev_win" as well. As a consequence, we
    want to "reset" the width or height vals back to the current win
    dimension depending on the position we choose.

    Associated refactors:
        • add default "height" value in default configuration
        • rename user and default configuration tables for clarity
        • programatically set default configuration table

* refactor: cleanup after change request

    • use tbl_extend() to produce a new configuration table from
      the default cfg and user cfg

    • choose local variables over updating the default cfg when
      updating height and width inside of toggle() based on the
      chosen window position

    • move the default cfg table inside of setup()

* Update README.md

Add GIF displaying functionality

* include demo.gif in the repo
2022-06-21 03:46:43 +02:00
amrbashir
64a4756f5b fix: don't force close the docs view window 2022-05-29 14:52:20 +02:00
amrbashir
7150b700c2 ci: add formatting check ci 2022-05-15 14:37:47 +02:00
amrbashir
2321d1f1f7 chore: formatting 2022-05-15 10:55:24 +02:00
amrbashir
66cb6a423f fix: disable autocmd when buf is closed 2022-05-15 10:28:13 +02:00
amrbashir
4d491dc47f feat: unlist docs view buffer from buffer list 2022-05-15 04:45:27 +02:00
amrbashir
e30462dff6 feat: toggle docs view instead of just showing it 2022-05-14 13:53:41 +02:00
amrbashir
bd033385d2 fix: override defaults only if explicitly defined in user config 2022-05-13 21:47:34 +02:00
amrbashir
f5768fa866 feat: add setup function 2022-05-13 21:00:25 +02:00
amrbashir
f49bcc50f0 refactor: change open function to show 2022-05-13 18:44:08 +02:00
amrbashir
c0abec2b1b chore: rename files 2022-05-13 18:02:21 +02:00
amrbashir
763ea41355 chore: remove unused function 2022-05-13 17:55:24 +02:00
amrbashir
71b231bb24 init 2022-05-13 17:38:49 +02:00