From fbc37f138a5d70f1b212b9de9959a0816481edcf Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Tue, 18 Jun 2024 20:50:58 +0200 Subject: 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 --- runtime/doc/builtin.txt | 5 +++-- runtime/doc/popup.txt | 20 ++++++++++++++++---- runtime/doc/tags | 1 + runtime/doc/usr_41.txt | 1 + runtime/doc/version9.txt | 3 ++- 5 files changed, 23 insertions(+), 7 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index a82453109e..0061e9efc6 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -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} diff --git a/runtime/doc/popup.txt b/runtime/doc/popup.txt index 1ad4fb9f07..b9e992b04c 100644 --- a/runtime/doc/popup.txt +++ b/runtime/doc/popup.txt @@ -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. diff --git a/runtime/doc/tags b/runtime/doc/tags index 56385a8442..ae8320520a 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -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()* diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index 60d0d1e60e..a54a991f13 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -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 diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt index 5b5bdede12..86dfe6da4d 100644 --- a/runtime/doc/version9.txt +++ b/runtime/doc/version9.txt @@ -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: ~ -- cgit v1.2.3