0
0
mirror of https://github.com/vim/vim.git synced 2025-08-26 20:03:41 -04:00

79 Commits

Author SHA1 Message Date
Yee Cheng Chin
8f9de4991e
patch 9.1.1623: Buffer menu does not handle unicode names correctly
Problem:  Buffer menu does not handle unicode names correctly
          (after v9.1.1622)
Solution: Fix the BMHash() function (Yee Cheng Chin)

The Buffers menu uses a BMHash() function to generate a sortable number
to be used for the menu index. It used a naive (and incorrect) way of
encoding multiple ASCII values into a single integer, but assumes each
character to be only in the ASCII 32-96 range. This means if we use
non-ASCII file names (e.g. Unicode values like CJK or emojis) we get
integer underflow and overflow, causing the menu index to wrap around.
Vim's GUI implementations internally use a signed 32-bit integer for the
`gui_mch_add_menu_item()` function and so we need to make sure the menu
index is in the (0, 2^31-1) range.

To do this, if the file name starts with a non-ASCII value, we just use
the first character's value and set the high bit so it sorts after the
other ASCII ones. Otherwise, we just take the first 5 characters, and
use 5 bit for each character to encode a 30-bit number that can be
sorted.

This means Unicode file names won't be sorted beyond the first
character. This is likely going to be fine as there are lots of ways to
query buffers.

related: #17403
closes: #17928

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-10 10:09:38 +02:00
Yee Cheng Chin
cda0d17f59
patch 9.1.1622: Patch v9.1.1432 causes performance regressions
Problem:  Patch v9.1.1432 causes performance regressions
Solution: Revert "patch 9.1.1432: GTK GUI: Buffer menu does not handle
          unicode correctly" (Yee Cheng Chin).

This reverts commit 08896dd330c6dc8324618fde482db968e6f71088.

The previous change to support Unicode characters properly in the
buffers menu resorted to removing all buffer menus and re-add the
buffers after doing a sort, per each buffer addition. This was quite
slow because if Vim is trying to load in multiple buffers at once (e.g.
when loading a session) this scales in O(n^2) and Vim can freeze for
dozens of seconds when adding a few hundred buffers.

related: #17405
related: #17928
fixes: #17897

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-10 10:05:29 +02:00
SUN Haitao
08896dd330
patch 9.1.1432: GTK GUI: Buffer menu does not handle unicode correctly
Problem:  GTK GUI: Buffer menu does not handle unicode correctly
Solution: Get rid of the BMHash() function (SUN Haitao)

fixes: #17403
closes: #17405

Signed-off-by: SUN Haitao <sunhaitao@devtaste.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-04 21:25:31 +02:00
h-east
a4205471ad
runtime(misc): Use consistent "Vim script" spelling
References: https://groups.google.com/g/vim_dev/c/3Z5yM8KER2w/m/wAqws0QSEAAJ

closes: #15863

Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-13 19:16:42 +02:00
Christian Brabandt
e059fae100
runtime(menu): define shortcut for File->Open Tab (#12895)
Seems missing as noted by Antonio Giovanni Colombo. So add it and use
the 'T' as shortcut, which does not seem to be used in the File dialog.

Verified on Windows.

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Antonio Giovanni Colombo <azc100@gmail.com>
2023-08-23 17:07:55 +01:00
Christian Brabandt
e978b4534a
Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
* Dedicate upcoming Vim 9.1 to Bram

Also replace in a few more places Brams email address and mention new
maintainers.

* Remove Bram from any Maintainer role

* runtime: Align Header

* it's mailing list not mailinglist
2023-08-13 10:33:05 +02:00
Bram Moolenaar
b7398fe41c Update runtime files 2023-05-14 18:50:25 +01:00
Bram Moolenaar
86b4816766 Update runtime files 2022-12-06 18:20:10 +00:00
Bram Moolenaar
502e91756e patch 9.0.0960: error when using the "Spelling / Find More Languages" menu
Problem:    Error when using the "Tools / Spelling / Find More Languages"
            menu.
Solution:   Remove "<SID>".  Reset "g:menutrans_set_lang_to" when 'encoding'
            changes. (closes #11625)
2022-11-27 16:18:33 +00:00
Bram Moolenaar
8b336a6614 patch 9.0.0959: error when using the "File Settings / Text Width" menu
Problem:    Error when using the "File Settings / Text Width" menu.
Solution:   Use str2nr(). (closes #11624)
2022-11-27 15:51:46 +00:00
Yee Cheng Chin
15b314ffbb patch 9.0.0708: :confirm does not work properly for a terminal buffer
Problem:    :confirm does not work properly for a terminal buffer.
Solution:   Handle :confirm for a terminal buffer differently.  (Yee Cheng
            Chin, closes #11312)
2022-10-09 18:53:32 +01:00
Bram Moolenaar
1588bc8ebe Update runtime files 2022-03-08 21:35:07 +00:00
Bram Moolenaar
2007dd49f5 patch 8.2.4455: accepting one and zero for second sort() argument is strange
Problem:    Accepting one and zero for the second sort() argument is strange.
Solution:   Disallow using one and zero in Vim9 script.
2022-02-23 13:17:47 +00:00
Bram Moolenaar
9da17d7c57 Update runtime files 2022-02-09 21:50:44 +00:00
Bram Moolenaar
3e79c97c18 Update runtime files; use compiled functions 2022-02-04 19:48:06 +00:00
Bram Moolenaar
fa3b72348d Update runtime files 2021-12-24 13:18:38 +00:00
Bram Moolenaar
b45cd36bd9 patch 8.2.1768: cannot use the help menu from a terminal window
Problem:    Cannot use the help menu from a terminal window.
Solution:   Add ":tlnoremenu" commands. (Yee Cheng Chin, closes #7023)
2020-09-28 21:41:49 +02:00
Bram Moolenaar
65e0d77a66 Update runtime files 2020-06-14 17:29:55 +02:00
Bram Moolenaar
5908fdf72f patch 8.2.0478: new buffers are not added to the Buffers menu
Problem:    New buffers are not added to the Buffers menu.
Solution:   Turn number into string. (Yee Cheng Chin, closes #5864)
2020-03-29 20:08:45 +02:00
Bram Moolenaar
5e94a29ebb patch 8.2.0413: buffer menu does not handle special buffers properly
Problem:    Buffer menu does not handle special buffers properly.
Solution:   Keep a dictionary with buffer names to reliably keep track of
            entries.
            Also trigger BufFilePre and BufFilePost for command-line and
            terminal buffers when the name changes.
2020-03-19 18:46:57 +01:00
Bram Moolenaar
e24c5b3332 patch 8.1.2416: loading menus sets v:errmsg
Problem:    Loading menus sets v:errmsg.
Solution:   Avoid setting v:errmsg and add a test for that. (Jason Franklin)
2019-12-10 22:11:53 +01:00
Bram Moolenaar
5ef1c6a483 Update runtime files 2019-11-10 22:09:11 +01:00
Bram Moolenaar
5be4ceecea Update runtime files. 2019-09-27 19:34:08 +02:00
Bram Moolenaar
30e9b3c425 Update runtime files 2019-09-07 16:24:12 +02:00
Bram Moolenaar
314dd79cac Update runtime files. 2019-02-03 15:27:20 +01:00
Bram Moolenaar
4c5d815256 patch 8.1.0487: no menus specifically for the terminal window
Problem:    No menus specifically for the terminal window.
Solution:   Add :tlmenu. (Yee Cheng Chin, closes #3439) Add a menu test.
2018-10-19 22:36:53 +02:00
Bram Moolenaar
fc65cabb15 Update runtime files. 2018-08-28 22:58:02 +02:00
Bram Moolenaar
68f1b1b37f patch 8.1.0207: need many menu translation files to cover regions
Problem:    Need many menu translation files to cover regions.
Solution:   When there is no region match, try without. (Christian Brabandt)
2018-07-23 05:10:14 +02:00
Bram Moolenaar
6dc819b129 Updated runtime and language files. 2018-07-03 16:42:19 +02:00
Bram Moolenaar
7c63fbc46e Updated runtime files. 2018-05-17 13:15:23 +02:00
Bram Moolenaar
040c1feb21 patch 8.0.1279: initializing menus can be slow
Problem:    Initializing menus can be slow, especially when there are many
            keymaps, color schemes, etc.
Solution:   Do the globbing for runtime files lazlily. (Ken Takata)
2017-11-09 19:45:48 +01:00
Bram Moolenaar
214641f77d Runtime file updates. 2017-03-05 17:04:09 +01:00
Bram Moolenaar
3df0173fa6 Updated runtime files. 2017-02-17 22:47:16 +01:00
Bram Moolenaar
89eaa4185e patch 7.4.2135
Problem:    Various tiny issues.
Solution:   Update comments, white space, etc.
2016-07-31 14:17:27 +02:00
Bram Moolenaar
42ebd06642 Update runtime files. 2016-07-17 13:35:14 +02:00
Bram Moolenaar
822ff866bd Update runtime files. 2014-06-12 21:46:14 +02:00
Bram Moolenaar
ad3b366c82 Update runtime files. 2013-05-17 18:14:19 +02:00
Bram Moolenaar
a3e6bc93d1 Update runtime files. 2013-01-30 14:18:00 +01:00
Bram Moolenaar
3a0d8090b1 Updated runtime files. 2012-10-21 03:02:54 +02:00
Bram Moolenaar
f3408e76fb updated for version 7.3.696
Problem:    Message about added spell language can be wrong.
Solution:   Give correct message. Add g:menutrans_set_lang_to to allow for
            translation. (Jiri Sedlak)
2012-10-21 01:21:59 +02:00
Bram Moolenaar
cab49dff91 Updated runtime file. Fix Italian translations. 2011-03-22 17:40:10 +01:00
Bram Moolenaar
c5604bc165 Better implementation of creating the Color Scheme menu. (Juergen Kraemer) 2010-07-17 15:20:30 +02:00
Bram Moolenaar
622925875c Fix bug: spell menu moved cursor, causing Copy not to work. Spell replacement
didn't work in 'compatible' mode.
2010-07-10 16:36:59 +02:00
Bram Moolenaar
64486671c3 Add 'relativenumber' patch from Markus Heidelberg. 2010-05-16 15:46:46 +02:00
Bram Moolenaar
5c73622a90 Update runtime files. 2010-01-06 20:54:52 +01:00
Bram Moolenaar
e30de2d1dc updated for version 7.2a-011 2008-07-01 19:56:57 +00:00
Bram Moolenaar
aba8857aa3 updated for version 7.2a-00 2008-06-25 20:13:35 +00:00
Bram Moolenaar
9273c73e36 updated for version 7.1-163 2007-11-29 16:46:44 +00:00
Bram Moolenaar
024678745b updated for version 7.1a 2007-05-06 13:22:01 +00:00
Bram Moolenaar
d675e2c513 updated for version 7.0-180 2007-01-09 14:09:25 +00:00