To: vim_dev@googlegroups.com Subject: Patch 8.1.1628 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.1628 Problem: Popup window functions not in list of functions. Solution: Add popup window functins to the list of functions. Reorganise the popup window help. Files: runtime/doc/eval.txt, runtime/doc/popup.txt, runtime/doc/usr_41.txt *** ../vim-8.1.1627/runtime/doc/eval.txt 2019-07-04 15:39:23.819386002 +0200 --- runtime/doc/eval.txt 2019-07-04 16:27:27.069932278 +0200 *************** *** 2533,2538 **** --- 2534,2557 ---- or({expr}, {expr}) Number bitwise OR pathshorten({expr}) String shorten directory names in a path perleval({expr}) any evaluate |Perl| expression + popup_atcursor({what}, {options}) Number create popup window near the cursor + popup_clear() none close all popup windows + popup_close({id} [, {result}]) none close popup window {id} + popup_create({what}, {options}) Number create a popup window + popup_dialog({what}, {options}) Number create a popup window used as a dialog + popup_filter_menu({id}, {key}) Number filter for a menu popup window + popup_filter_yesno({id}, {key}) Number filter for a dialog popup window + popup_getoptions({id}) Dict get options of popup window {id} + popup_getpos({id}) Dict get position of popup window {id} + popup_hide({id}) none hide popup menu {id} + 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_show({id}) none unhide 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} pow({x}, {y}) Float {x} to the power of {y} prevnonblank({lnum}) Number line nr of non-blank line <= {lnum} printf({fmt}, {expr1}...) String format text *************** *** 7034,7039 **** --- 7053,7062 ---- < [1, 2, 3, 4] {only available when compiled with the |+perl| feature} + + popup_ functions are documented here: |popup-functions|. + + pow({x}, {y}) *pow()* Return the power of {x} to the exponent {y} as a |Float|. {x} and {y} must evaluate to a |Float| or a |Number|. *** ../vim-8.1.1627/runtime/doc/popup.txt 2019-06-30 22:16:06.935821727 +0200 --- runtime/doc/popup.txt 2019-07-04 16:39:00.318462487 +0200 *************** *** 1,16 **** ! *popup.txt* For Vim version 8.1. Last change: 2019 Jun 15 VIM REFERENCE MANUAL by Bram Moolenaar ! Displaying text in floating window. *popup* *popup-window* - THIS IS UNDER DESIGN - ANYTHING MAY STILL CHANGE 1. Introduction |popup-intro| 2. Functions |popup-functions| ! 3. Examples |popup-examples| {not available if the |+textprop| feature was disabled at compile time} --- 1,26 ---- ! *popup.txt* For Vim version 8.1. Last change: 2019 Jul 04 VIM REFERENCE MANUAL by Bram Moolenaar ! Displaying text in a floating window. *popup* *popup-window* 1. Introduction |popup-intro| + Window position and size |popup-position| + Closing the popup window |popup-close| + Popup buffer and window |popup-buffer| 2. Functions |popup-functions| ! Details |popup-function-details| ! 3. Usage |popup-usage| ! popup_create() arguments |popup_create-arguments| ! Popup text properties |popup-props| ! Popup filter |popup-filter| ! Popup callback |popup-callback| ! Popup scrollbar |popup-scrollbar| ! Popup mask |popup-mask| ! 4. Examples |popup-examples| {not available if the |+textprop| feature was disabled at compile time} *************** *** 55,61 **** - balloon, see |balloon-eval| ! WINDOW POSITION AND SIZE *popup-position* The height of the window is normally equal to the number of, possibly wrapping, lines in the buffer. It can be limited with the "maxheight" --- 65,71 ---- - balloon, see |balloon-eval| ! WINDOW POSITION AND SIZE *popup-position* The height of the window is normally equal to the number of, possibly wrapping, lines in the buffer. It can be limited with the "maxheight" *************** *** 85,91 **** that it is in. ! CLOSING THE POPUP WINDOW *popup-close* Normally the plugin that created the popup window is also in charge of closing it. If somehow a popup hangs around, you can close all of them with: > --- 95,101 ---- that it is in. ! CLOSING THE POPUP WINDOW *popup-close* Normally the plugin that created the popup window is also in charge of closing it. If somehow a popup hangs around, you can close all of them with: > *************** *** 97,136 **** "close" property. It is set by default for notifications. ! TODO: ! - Add test for when popup with mask is off the left and off the right of the ! screen. ! - check padding/border when popup is off the left and right of the screen. ! - Have a way to scroll to the bottom? (#4577) ! - Why does 'nrformats' leak from the popup window buffer??? ! - Disable commands, feedkeys(), CTRL-W, etc. in a popup window. ! Use ERROR_IF_POPUP_WINDOW for more commands. ! - Add 'balloonpopup': instead of showing text, let the callback open a popup ! window and return the window ID. The popup will then be closed when the ! mouse moves, except when it moves inside the popup. ! - For the "moved" property also include mouse movement? ! - Can the buffer be re-used, to avoid using up lots of buffer numbers? ! - Have an option to attach the popup to a text position, like text properties ! do. (#4560) ! - Make redrawing more efficient and avoid flicker: ! - put popup menu also put in popup_mask? ! - Invoke filter with character before mapping? ! - Figure out the size and position better. ! if wrapping splits a double-wide character ! if wrapping inserts indent ! - When drawing on top half a double-wide character, display ">" or "<" in the ! incomplete cell. ! - Use a popup window for the "info" item of completion instead of using a ! preview window. Ideas in issue #4544. ! How to add highlighting? ! - Implement: ! flip option ============================================================================== 2. Functions *popup-functions* - THIS IS UNDER DESIGN - ANYTHING MAY STILL CHANGE - Creating a popup window: |popup_create()| centered in the screen |popup_atcursor()| just above the cursor position, closes when --- 107,147 ---- "close" property. It is set by default for notifications. ! POPUP BUFFER AND WINDOW *popup-buffer* ! ! If a popup function is called to create a popup from text, a new buffer is ! created to hold the text and text properties of the popup window. The buffer ! is always associated with the popup window and manipulation is restricted: ! - the buffer has no name ! - 'buftype' is "popup" ! - 'swapfile' is off ! - 'bufhidden' is "hide" ! - 'buflisted' is off ! - 'undolevels' is -1: no undo at all ! - all other buffer-local and window-local options are set to their Vim default ! value. ! ! It is possible to change the specifically mentioned options, but anything ! might break then, so better leave them alone. ! ! The window does have a cursor position, but the cursor is not displayed. ! ! To execute a command in the context of the popup window and buffer use ! `win_execute()`. Example: > ! call win_execute(winid, 'syntax enable') ! ! Options can be set on the window with `setwinvar()`, e.g.: > ! call setwinvar(winid, '&wrap', 0) ! And options can be set on the buffer with `setbufvar()`, e.g.: > ! call setbufvar(winbufnr(winid), '&filetype', 'java') ! Note that this does not trigger autocommands. Use `win_execute()` if you do ! need them. ! ! ============================================================================== 2. Functions *popup-functions* Creating a popup window: |popup_create()| centered in the screen |popup_atcursor()| just above the cursor position, closes when *************** *** 159,167 **** |popup_getpos()| get actual position and size of a popup ! [functions help to be moved to eval.txt later] ! popup_atcursor({what}, {options}) *popup_atcursor()* Show the {what} above the cursor, and close it when the cursor moves. This works like: > call popup_create({what}, { --- 170,178 ---- |popup_getpos()| get actual position and size of a popup ! DETAILS *popup-function-details* ! popup_atcursor({what}, {options}) *popup_atcursor()* Show the {what} above the cursor, and close it when the cursor moves. This works like: > call popup_create({what}, { *************** *** 199,205 **** the popup closes. {options} is a dictionary with many possible entries. ! See |popup_create-usage| for details. Returns a window-ID, which can be used with other popup functions. Use `winbufnr()` to get the number of the buffer --- 210,216 ---- the popup closes. {options} is a dictionary with many possible entries. ! See |popup_create-arguments| for details. Returns a window-ID, which can be used with other popup functions. Use `winbufnr()` to get the number of the buffer *************** *** 417,454 **** by the different text. ! POPUP BUFFER AND WINDOW *popup-buffer* ! ! A new buffer is created to hold the text and text properties of the popup ! window. The buffer is always associated with the popup window and ! manipulation is restricted: ! - the buffer has no name ! - 'buftype' is "popup" ! - 'swapfile' is off ! - 'bufhidden' is "hide" ! - 'buflisted' is off ! - 'undolevels' is -1: no undo at all ! - all other buffer-local and window-local options are set to their Vim default ! value. ! ! It is possible to change the specifically mentioned options, but anything ! might break then, so better leave them alone. ! ! The window does have a cursor position, but the cursor is not displayed. ! ! To execute a command in the context of the popup window and buffer use ! `win_execute()`. Example: > ! call win_execute(winid, 'syntax enable') ! ! Options can be set on the window with `setwinvar()`, e.g.: > ! call setwinvar(winid, '&wrap', 0) ! And options can be set on the buffer with `setbufvar()`, e.g.: > ! call setbufvar(winbufnr(winid), '&filetype', 'java') ! Note that this does not trigger autocommands. Use `win_execute()` if you do ! need them. ! ! POPUP_CREATE() ARGUMENTS *popup_create-usage* The first argument of |popup_create()| (and the second argument to |popup_settext()|) specifies the text to be displayed, and optionally text --- 428,437 ---- by the different text. ! ============================================================================== ! 3. Usage *popup-usage* ! POPUP_CREATE() ARGUMENTS *popup_create-arguments* The first argument of |popup_create()| (and the second argument to |popup_settext()|) specifies the text to be displayed, and optionally text *************** *** 709,717 **** [[1, 1, 1, 1], [-1, -1, 1, 1], [1, 1, -1, -1], [-1, -1, -1, -1]] ============================================================================== ! 3. Examples *popup-examples* ! TODO *popup_dialog-example* Prompt the user to press y/Y or n/N: > --- 692,700 ---- [[1, 1, 1, 1], [-1, -1, 1, 1], [1, 1, -1, -1], [-1, -1, -1, -1]] ============================================================================== ! 4. Examples *popup-examples* ! TODO: more interesting examples *popup_dialog-example* Prompt the user to press y/Y or n/N: > *** ../vim-8.1.1627/runtime/doc/usr_41.txt 2019-06-09 17:21:48.653261084 +0200 --- runtime/doc/usr_41.txt 2019-07-04 16:48:15.031397873 +0200 *************** *** 1,4 **** ! *usr_41.txt* For Vim version 8.1. Last change: 2019 May 04 VIM USER MANUAL - by Bram Moolenaar --- 1,4 ---- ! *usr_41.txt* For Vim version 8.1. Last change: 2019 Jul 04 VIM USER MANUAL - by Bram Moolenaar *************** *** 105,124 **** if you are impatient. ! THREE KINDS OF NUMBERS ! Numbers can be decimal, hexadecimal or octal. A hexadecimal number starts ! with "0x" or "0X". For example "0x1f" is decimal 31. An octal number starts ! with a zero. "017" is decimal 15. Careful: don't put a zero before a decimal ! number, it will be interpreted as an octal number! The ":echo" command always prints decimal numbers. Example: > :echo 0x7f 036 < 127 30 ~ ! A number is made negative with a minus sign. This also works for hexadecimal ! and octal numbers. A minus sign is also used for subtraction. Compare this ! with the previous example: > :echo 0x7f -036 < 97 ~ --- 105,125 ---- if you are impatient. ! FOUR KINDS OF NUMBERS ! Numbers can be decimal, hexadecimal, octal or binary. A hexadecimal number ! starts with "0x" or "0X". For example "0x1f" is decimal 31. An octal number ! starts with a zero. "017" is decimal 15. A binary number starts with "0b" or ! "0B". For example "0b101" is decimal 5. Careful: don't put a zero before a ! decimal number, it will be interpreted as an octal number! The ":echo" command always prints decimal numbers. Example: > :echo 0x7f 036 < 127 30 ~ ! A number is made negative with a minus sign. This also works for hexadecimal, ! octal and binary numbers. A minus sign is also used for subtraction. Compare ! this with the previous example: > :echo 0x7f -036 < 97 ~ *************** *** 747,752 **** --- 748,759 ---- getcharsearch() return character search information setcharsearch() set character search information + Working with text in another buffer: + getbufline() get a list of lines from the specified buffer + setbufline() replace a line in the specified buffer + appendbufline() append a list of lines in the specified buffer + deletebufline() delete lines from a specified buffer + *system-functions* *file-functions* System functions and manipulation of files: glob() expand wildcards *************** *** 798,805 **** --- 805,814 ---- argidx() current position in the argument list arglistid() get id of the argument list argv() get one entry from the argument list + bufadd() add a file to the list of buffers bufexists() check if a buffer exists buflisted() check if a buffer exists and is listed + bufload() ensure a buffer is loaded bufloaded() check if a buffer exists and is loaded bufname() get the name of a specific buffer bufnr() get the buffer number of a specific buffer *************** *** 810,819 **** bufwinid() get the window ID of a specific buffer bufwinnr() get the window number of a specific buffer winbufnr() get the buffer number of a specific window - getbufline() get a list of lines from the specified buffer - setbufline() replace a line in the specified buffer - appendbufline() append a list of lines in the specified buffer - deletebufline() delete lines from a specified buffer listener_add() add a callback to listen to changes listener_flush() invoke listener callbacks listener_remove() remove a listener callback --- 819,824 ---- *************** *** 956,961 **** --- 961,967 ---- test_autochdir() enable 'autochdir' during startup test_override() test with Vim internal overrides test_garbagecollect_now() free memory right now + test_getvalue() get value of an internal variable test_ignore_error() ignore a specific error message test_null_blob() return a null Blob test_null_channel() return a null Channel *************** *** 1036,1041 **** --- 1042,1066 ---- term_setrestore() set command to restore a terminal term_setsize() set the size of a terminal + Popup window: *popup-window-functions* + popup_create() create popup centered in the screen + popup_atcursor() create popup just above the cursor position, + closes when the cursor moves away + popup_notification() show a notification for three seconds + popup_dialog() create popup centered with padding and border + popup_menu() prompt for selecting an item from a list + popup_hide() hide a popup temporarily + popup_show() show a previously hidden popup + 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_close() close one popup + popup_clear() close all popups + popup_filter_menu() select from a list of items + popup_filter_yesno() blocks until 'y' or 'n' is pressed + popup_getoptions() get current options for a popup + popup_getpos() get actual position and size of a popup + Timers: *timer-functions* timer_start() create a timer timer_pause() pause or unpause a timer *** ../vim-8.1.1627/src/version.c 2019-07-04 16:05:10.665946103 +0200 --- src/version.c 2019-07-04 16:49:13.175068693 +0200 *************** *** 779,780 **** --- 779,782 ---- { /* Add new patch number below this line */ + /**/ + 1628, /**/ -- I have to exercise early in the morning before my brain figures out what I'm doing. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///