1
0
forked from aniani/vim

patch 9.1.0500: cannot switch buffer in a popup

Problem:  cannot switch buffer in a popup
          (Yggdroot)
Solution: add popup_setbuf() function

fixes: #15006
closes: #15026

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2024-06-18 20:50:58 +02:00
parent 23c5ebeb95
commit fbc37f138a
17 changed files with 224 additions and 7 deletions

View File

@@ -153,8 +153,8 @@ diff_filler({lnum}) Number diff filler lines about {lnum}
diff_hlID({lnum}, {col}) Number diff highlighting at {lnum}/{col}
digraph_get({chars}) String get the |digraph| of {chars}
digraph_getlist([{listall}]) List get all |digraph|s
digraph_set({chars}, {digraph}) Boolean register |digraph|
digraph_setlist({digraphlist}) Boolean register multiple |digraph|s
digraph_set({chars}, {digraph}) Bool register |digraph|
digraph_setlist({digraphlist}) Bool register multiple |digraph|s
echoraw({expr}) none output {expr} as-is
empty({expr}) Number |TRUE| if {expr} is empty
environ() Dict return environment variables
@@ -429,6 +429,7 @@ popup_menu({what}, {options}) Number create a popup window used as a menu
popup_move({id}, {options}) none set position of popup window {id}
popup_notification({what}, {options})
Number create a notification popup window
popup_setbuf({id}, {buf}) Bool set the buffer for the popup window {id}
popup_setoptions({id}, {options})
none set options for popup window {id}
popup_settext({id}, {text}) none set the text of popup window {id}

View File

@@ -1,4 +1,4 @@
*popup.txt* For Vim version 9.1. Last change: 2024 Jun 08
*popup.txt* For Vim version 9.1. Last change: 2024 Jun 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -186,6 +186,7 @@ Manipulating a popup window:
|popup_move()| change the position and size of a popup
|popup_setoptions()| override options of a popup
|popup_settext()| replace the popup buffer contents
|popup_setbuf()| set the buffer for the popup window
Closing popup windows:
|popup_close()| close one popup
@@ -574,6 +575,18 @@ popup_notification({what}, {options}) *popup_notification()*
Return type: |Number|
popup_setbuf({id}, {buf}) *popup_setbuf()*
Set buffer {buf} to be displayed in popup win {id}. For the
use of {buf}, see |bufname()| function.
May change window size or position to adjust for the size
of the buffer text.
Can also be used as a |method|: >
GetPopup()->popup_setbuf(bufnr('foobar'))
<
Return type: |vim9-boolean|
popup_setoptions({id}, {options}) *popup_setoptions()*
Override options in popup {id} with entries in {options}.
These options can be set:
@@ -613,9 +626,8 @@ popup_setoptions({id}, {options}) *popup_setoptions()*
popup_settext({id}, {text}) *popup_settext()*
Set the text of the buffer in popup win {id}. {text} is the
same as supplied to |popup_create()|, except that a buffer
number is not allowed.
Set the text of the buffer in popup win {id}. {text} is
a string or a list of strings to be displayed in the popup.
Does not change the window size or position, other than caused
by the different text.

View File

@@ -9433,6 +9433,7 @@ popup_menu() popup.txt /*popup_menu()*
popup_menu-shortcut-example popup.txt /*popup_menu-shortcut-example*
popup_move() popup.txt /*popup_move()*
popup_notification() popup.txt /*popup_notification()*
popup_setbuf() popup.txt /*popup_setbuf()*
popup_setoptions() popup.txt /*popup_setoptions()*
popup_settext() popup.txt /*popup_settext()*
popup_show() popup.txt /*popup_show()*

View File

@@ -1319,6 +1319,7 @@ Popup window: *popup-window-functions*
popup_move() change the position and size of a popup
popup_setoptions() override options of a popup
popup_settext() replace the popup buffer contents
popup_setbuf() set the popup buffer
popup_close() close one popup
popup_clear() close all popups
popup_filter_menu() select from a list of items

View File

@@ -1,4 +1,4 @@
*version9.txt* For Vim version 9.1. Last change: 2024 Jun 17
*version9.txt* For Vim version 9.1. Last change: 2024 Jun 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -41586,6 +41586,7 @@ Functions: ~
|getregionpos()| get a list of positions for a region
|matchbufline()| all the matches of a pattern in a buffer
|matchstrlist()| all the matches of a pattern in a List of strings
|popup_setbuf()| switch to a different buffer in a popup
Autocommands: ~