Re: vim9 Equivalence of __FILE__, __LINE__, and __FUNCTION__ usage in C++

2023-07-06 Thread Bram Moolenaar


Yegappan wrote:

> On Tue, Jul 4, 2023 at 1:11 PM Lifepillar  wrote:
> >
> > On 2023-07-04, Nicolas  wrote:
> > > Hi,
> > >
> > > Is there an equivalence in vim9 of  __FILE__, __LINE__, and __FUNCTION__
> > > usage in C++
> > >
> >
> >
> > For __LINE__ and __FUNCTION__, I don't know what "equivalent"
> > alternative to suggest, but if you elaborate on what your goal is, it
> > will be easier to help.
> >
> 
> You can try using 

Re: Error detected while processing /var/lib/vim/addons/plugin/02tlib.vim line 77: E1208: -complete used without allowing arguments

2023-07-06 Thread Bram Moolenaar


Guy Ka wrote:

> I had GVim 8.2 installed on a Ubuntu 20.04 machine (WSL2) and everything
> was working fine. After updating to Ubuntu 22.04,
> I am getting the following error when I start gvim
> Error detected while processing /var/lib/vim/addons/plugin/02tlib.vim line
>   77: E1208: -complete used without allowing arguments
> I have no clue on how to start debugging this issue.

Please quote the contents of plugin/02tlib.vim around line 77.

Error 1208 is quite clear: I expect there to be a ":command" command
that defines a user command, with a "-complete" argument but not
allowing for arguments.  There is more info if you look for help on the
error number
:help E1208

> Here is the version info
> :version
> VIM - Vi IMproved 8.2 (2019 Dec 12, compiled May 24 2023 14:27:53)
> Included patches: 1-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919
> Modified by team+...@tracker.debian.org
> Compiled by team+...@tracker.debian.org
> Huge version with GTK3 GUI.  Features included (+) or not (-):
> +acl   +dnd   +listcmds  +postscript

[...]

> +byte_offset   +float +mouse_gpm +scrollbind
>  +vim9script

Some more checks were added for Vim 9 script.  They may also affect
legacy script commands.  That is unlikely though.  This is best fixed in
the script.  Then it is also fixed for other users of the script.  Can
you contact the author or maintainer?

I don't think we can fix this in Vim.  The error is valid, if we skip it
then mistakes will go unnoticed.  With Vim 9 script we want to find more
errors, not less.  So long as they are valid errors.


-- 
Women are probably the main cause of free software starvation.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230706103326.053261C0460%40moolenaar.net.


Re: t_fe and t_fd in tmux corrupts split with ^[[O

2023-06-26 Thread Bram Moolenaar


> On Sat, 24 Jun 2023 19:35:47 +0100
> Bram Moolenaar  wrote:
> > You need to tell Vim to recognize these escape sequences:
> >
> > execute "set =\[I"
> > execute "set =\[O"
> >
> > Since this is quite common it was made the default in patch 9.0.1619.
> > You only need to define the escape sequences for older Vim versions.
> 
> Interesting.  I wondered why it was there in the help doc but Vim didn't
> seem to need it.  Thank you for the clarification.

I have been working on the terminal configuration support, removing
built-in hard coded values and depending more on termcap/terminfo.
Unfortunately, the latter has not been kept up-to-date for recently added
terminal features.  Partly to blame on Vim's built-in support for xterm
and terminals declaring themselves to be xterm-compatible (even though
that's not 100% true).  Result is that there was hardly any motivation
to make termcap/terminfo work better.

I'm trying to make support for various terminals work "properly", but it
is quite a struggle, it will take time.  I hope terminal emulator
authors will cooperate, but there is a tendency of having a different
opinion of what "properly" is.  This can lead to very long discussions
without a clear outcome.  To avoid getting stuck I may sometimes pull
the "dictator" card and decide what is best for Vim.

For example, for supporting modifiers on special keys there is the
"modifyOtherKeys" protocol (supported by xterm and a few others).  But
for some this was considered insufficient and the Kitty keyboard
protocol was added (which for a large part does the same thing, but with
some differences that helps some users and makes it complicated for
others).

The first step is to agree on how to make it work, then convince enough
people to implement it that way.  Hopefully we then have enough traction
that others will follow.

For the keyboard protocol support I didn't see a way to convince all
terminal authors to support modifyOtherKeys or Kitty, thus I chose to
support both.  It's a bit tricky, but it looks like it is working OK
now.

-- 
hundred-and-one symptoms of being an internet addict:
240. You think Webster's Dictionary is a directory of WEB sites.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230626153549.112B71C054C%40moolenaar.net.


Re: t_fe and t_fd in tmux corrupts split with ^[[O

2023-06-24 Thread Bram Moolenaar


Enan Ajmain wrote:

> I have this in my vimrc according to ":h xterm-focus-event":
> 
> if  =~ '\v^(screen|tmux)'
>   let _fe = "\[?1004h"
>   let _fd = "\[?1004l"
> endif
> 
> With it in tmux, when I switch panes, the pane with Vim running shows a
> control sequence "^[[O" where "^[" is Esc.

You need to tell Vim to recognize these escape sequences:

execute "set =\[I"
execute "set =\[O"

Since this is quite common it was made the default in patch 9.0.1619.
You only need to define the escape sequences for older Vim versions.


-- 
hundred-and-one symptoms of being an internet addict:
231. You sprinkle Carpet Fresh on the rugs and put your vacuum cleaner
 in the front doorway permanently so it always looks like you are
 actually attempting to do something about that mess that has amassed
 since you discovered the Internet.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230624183547.E884A1C054C%40moolenaar.net.


Re: BUG: terminal vim 9.0.1506 x64 window 10

2023-06-21 Thread Bram Moolenaar


> On *Windows Terminal Preview* (Windows 11) with Windows PowerShell or CMD 
> as the shell, the 'columns=600' or any other such setting will be ignored 
> and the variable will remain at whatever vim set it to. So nothing happens 
> to the display.

OK, so this is for when Vim is started directly in the terminal.
It would be good if ":set columns=80" is working here.  I often use that
after messing with the window size for whatever reason (I use 80
columns so I can fit several terminal windows side-by-side).

> Using the Windows CMD shell under the old CMD terminal, whatever that is 
> called, will result in columns value being changed, but the terminal does 
> not change and has no issues after the setting.
> 
> Using RedHat's cygwin bash, which comes with Git-Desktop for instance, 
> inside of *Windows Terminal*, performing a "set columns=600" will result in 
> a corrupted terminal which cannot be fixed using the standard terminal 
> reset commands (tset(1) or reset(1)). Only closing and reopening the 
> terminal will return a good work session.

Perhaps it sets some environment variable only on startup?

> Using cygwin bash under the RedHat provided *mintty* terminal and 
> performing a "set columns=600" will cause vim to resize to the maximum 
> width of the system monitor and set Columns to a number that equates to the 
> new terminal size. This is the only terminal software I found that behaves 
> as one would expect a Linux terminal to work. This was the best terminal I 
> saw on Windows.
> 
> Finally, using the *GVim* provided with VIM for Windows will also change 
> the Terminal size according to changes in the 'columns' setting. Again, vim 
> will change the size of the terminal up to the actual maximum available on 
> the system monitor. The columns variable reflects the proper terminal size 
> like the *mintty *version does. I don't know what terminal that means is 
> used or even if it can be called a terminal, but clearly it works properly 
> with vim by design.

Vim uses libvterm, a "virtual" terminal that is build into Vim.  On
MS-Windows it uses ConPTY or WinPTY.  libvterm resembles an xterm and
many programs can work with it.

> So my conclusion is that this is a terminal software problem. Some 
> terminals adhere to the resizing commands that vim sends, some ignore it 
> but remain stable, and yet others become hopelessly corrupted requiring 
> that the software be closed and restarted. 

We can try to make it work.  For some terminals we may require the
maintainers to make changes.  I suppose there is no standard way for
handling size changes, like SIGWINCH on Unix.  If there is a terminal
that does this well we can suggest to use it as an example, hopefully we
can then avoid every terminal doing something different.

> Obviously Bram knows far more than I do, but my recommendation would
> be to use a Terminal package that behaves like a fully functional soft
> terminal should or don't resize the window *after* launching VIM.

In the help we can list terminals we know and what works for each of
them.  That can function as a recommendation.  It will take some effort
to keep up-to-date, but it's worth it.

> Personally I use bash and Windows Terminal when I'm on Windows. It has
> features I prefer and I don't usually resize my work space after I've
> got set up. Will Microsoft fix their issues. Not gonna hold my breath.

I'm sure Microsoft will not fix *all* their issues, but the team working
on the Windows Terminal has been responsive.  I hope at least one of
them is using Vim and fixes any encountered problems.  That's why Vim
works well in the Chrome secure shell :-).

> Should there be smoke coming out of my CPU?

No, it's bad for the cooling system and shortens life.

-- 
hundred-and-one symptoms of being an internet addict:
200. You really believe in the concept of a "paperless" office.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230621230529.C8FAB1C0A9C%40moolenaar.net.


Re: BUG: terminal vim 9.0.1506 x64 window 10

2023-06-21 Thread Bram Moolenaar


> On Tue, 20 Jun 2023 22:52:05 -0700 (PDT)
> Steve Martin  wrote:
> > [...]
> >
> > Using the Windows CMD shell under the old CMD terminal, whatever that
> > is called
> 
> It's Console Host or Conhost in short.

There also is mention of "Win32 virtual console", the +vtp feature.
This is currently enabled for all MS-Windows non-GUI versions, thus it
doesn't appear to have an effect on how Vim works.  The feature itself
is useful to distinguish from an old Vim version that didn't support
this.

> > Personally I use bash and Windows Terminal when I'm on Windows. It
> > has features I prefer and I don't usually resize my work space after
> > I've got set up. Will Microsoft fix their issues. Not gonna hold my
> > breath.
> 
> I assume by "Microsoft" and "their issue" you mean the issue in Conhost.
> If so, then yeah, it's not gonna get fixed.  There are compatibility
> reasons for that (which I don't care about), but to circumvent this the
> team decided to overhaul Conhost and replace it with the new Terminal.
> It'll be the default in the next . . . I donno, year perhaps?  Decade?
> 
> And just to clarify, resizing MS Terminal window after launching Vim
> doesn't cause any problem.  MS Terminal should behave like a Linux
> terminal emulator.  It advertizes itself as supporting all xterm
> features.  Well, perhaps not all, but most of the oft-used ones.

A problem related to this is that Vim was originally made for the
console, not for a generic terminal like on Unix.  In the code there are
calls to is_term_win32() and different behavior when it returns true.
That is when 'term' is set to "win32".  And it is set to that value in a
few places, some may not be correct.  E.g. near the end of
did_set_string_option():

#if defined(FEAT_VTP) && defined(FEAT_TERMGUICOLORS)
if (args.os_did_swaptcap)
{
set_termname((char_u *)"win32");
init_highlight(TRUE, FALSE);
}
#endif

There is a check for Windows terminal in os_win32.c:

wt_working = mch_getenv("WT_SESSION") != NULL;

This flag is then used in several places through the USE_WT macro.

There are several other flags for VTP and CONPTY, with very specific
build versions.  I don't know how relevant these still are,  It mainly
results in conpty_type to be set to a certain number, which isn't
explained anywhere.  Looks like it is only used in libvterm and only the
value "2" makes a difference.

What matters for the original problem is how Vim obtains the size of the
console or terminal.  If it is a console then "g_cbTermcap.Info.dwSize"
is used.  Otherwise "csbi.srWindow" or fall back to 25 x 80.  This is in
mch_get_shellsize() in os_win32.c.  But mch_get_shellsize() in
os_mswin.c doesn't do anything, it is not supposed to be used, but is
it?  If it is, then doing something similar to mch_get_shellsize() in
os_unix.c would be helpful.  Using the MS-Windows equivalent of the
ioctl() calls.

> > In the end there are a lot of choices out there, which can be both
> > good and bad.
> 
> Before MS Terminal, Wezterm was the best choice.  Before that, Cmder and
> ConEmu.  And the problem with Mintty is that it's not independent.  The
> reason it behaves so like a Linux terminal is because it's built with
> Cygwin or Cygwin-like shells (MSys, git-bash, etc.) in mind.  You can't
> run Command Prompt or PowerShell on it.  You can't even run Win32
> version of Vim on it.  You'll need a Vim built with Cygwin.  That's an
> extra hassle in my opinion.

Can we assume that MS Terminal is included with the distribution, or
installed most widely?  If so, then investing time in making this work
properly is well worth it.

-- 
Some of the well known MS-Windows errors:
ETIME   Wrong time, wait a little while
ECRASH  Try again...
EDETECT Unable to detect errors
EOVER   You lost!  Play another game?
ENOCLUE Eh, what did you want?

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230621124103.A86A01C0A9C%40moolenaar.net.


Re: BUG: terminal vim 9.0.1506 x64 window 10

2023-06-21 Thread Bram Moolenaar


> Looking at the Take Command website and Googling about it I can find no 
> reference to Take Command as a Terminal emulator *anywhere*. I am guessing 
> it has very basic, if any, capabilities at all. Thus it probably doesn't 
> heed any *':set columns=*' or other vim terminal commands.

If Vim's assumption of the terminal size (which is in the 'lines' and
'columns' options) does not match the actual terminal size, then display
problems are to be expected.

There are two sides: getting and setting the size.

Getting the size is always needed, unless you keep the terminal at the
default 25 x 80 size (which is unlikely).  On top of that, Vim would
need to get notified if the terminal size is changed (e.g. by dragging
the border) while it is running, see below.

Setting the size is needed to support ":set lines=123" and ":set
columns=123".  Or Vim needs to know that the size cannot be set and it
should give an error message and not change the number of lines/columns
used.

It is not so easy to figure out what happens in what sequence.  I'll add
a few log messages to the Unix implementation.  Handling the size works
fine there, thus this can be used as an example.  But it might be that
for MS-Windows it works differently.  E.g., in Unix a signal is used:
SIGWINCH.  I don't know if MS-Windows has something similar.  Also, the
implementation of term_report_winsize() needs to be checked.  This
should trigger the signal in any Vim instance running in a terminal
window, initiated from the Vim instance that has the terminal window.

-- 
hundred-and-one symptoms of being an internet addict:
196. Your computer costs more than your car.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230621124103.ABC7D1C0A8A%40moolenaar.net.


Re: Change cursor shape in command-line mode

2023-06-17 Thread Bram Moolenaar


Enan Ajmain wrote:

> Vim allows changing cursor shapes according to the current mode: insert,
> replace, or normal.  Vim does this using terminal escape sequences.
> Details are in ':h termcap-cursor-shape'.
> 
> I was wondering if I could change the cursor shape in command-line mode.
> I'm fairly certain it's not possible, but I thought it wouldn't hurt to
> ask.

You should be able to make this work with the CmdlineEnter and
CmdlineLeave autocommand events.  You can use echoraw() to output the
terminal codes.  As a starting point, this appears to work:

au CmdlineEnter * call echoraw("\]12;red\x7")
au CmdlineLeave * call echoraw("\]12;blue\x7")

-- 
What is the difference between a professional and an amateur?
The ark was built by an amateur; professionals gave us the Titanic.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230617200558.5C0901C0948%40moolenaar.net.


Re: BUG: terminal vim 9.0.1506 x64 window 10

2023-06-17 Thread Bram Moolenaar


> Quick experimentation indicates that console mode vim fails when width >=
> 250.  But not every time.
> 
> I don't think height matters.

OK, so what reproduction steps are required?  I tried this:

- start "vim --clean"
- :set columns=260
- :term
- vim --clean somefile
- ?

I could not make this show any problems.  This might be because I'm
using Linux.  Or:

- What would be the content of "somefile"?  I tried some long (wrapping)
  lines and a few short lines.
- What commands do you use once "somefile" is loaded?  Move the cursor,
  join/split lines, etc.?

I hope you can give an example that is simple and reproduces the problem
consistently.

-- 
I thought I was eating a crab salad.  It turned out to be a crap salad.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230617200558.6BA0A1C09A9%40moolenaar.net.


Re: How to disable and replace Vim's standard formatting of Pascal

2023-06-14 Thread Bram Moolenaar


> Tim Chase said on Tue, 13 Jun 2023 20:37:10 -0500
> 
> >On 2023-06-13 21:18, Steve Litt wrote:
> >> Using grep, I found there are no files whose names contain the string
> >> "pascal" in any case in the ~/.vim directory (I'm using Void Linux).
> >>  
> >
> >I suspect your frustration is being caused by something in
> >$VIMRUNTIME/indent/pascal.vim
> 
> Correct: ~/.vim/indent didn't exist, so I followed your instructions...
> 
> >
> >As such, you should be able to do something like (optionally putting
> >your settings in there, too)
> >
> >  $ mkdir -p ~/.vim/indent
> >  $ cat >> ~/.vim/indent/pascal.vim  >  let b:did_indent = 1
> >  set ai
> >  set expandtab
> >  set tabstop 3
> >  set shiftwidth 3
> >  EOF
> 
> The preceding worked. Now I can tab and Ctrl+d or Ctrl+t for
> *space-only* indentation of three spaces in insert mode. Naturally,
> I can use << and >> in command mode. It's beautiful. Vim doesn't try to
> guess what I want in indentation: It lets me do it manually, which is
> just what I want.

Suggestion: Use "setlocal" instead of "set" to avoid affecting other
files.  You only want to apply these options locally.

-- 
hundred-and-one symptoms of being an internet addict:
166. You have been on your computer soo long that you didn't realize
 you had grandchildren.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230614102447.1390B1C0D60%40moolenaar.net.


Re: documenting my own plugins?

2023-06-12 Thread Bram Moolenaar


> Indeed, this worked:
> 
>   :set runtimepath=~/.vim/ftplugin/foo,$VIMRUNTIME
> 
> I assume I can add it to .vimrc, so I don't need to do it every time.

Although this works, the "normal" way is to put your foo.txt help file
in ~/.vim/doc.

An alternative is to use packages, see ":help package-create".  This has
the advantage that related files for the "foo" plugin are under one
directory.  That matters if you want to move the plugin.

-- 
hundred-and-one symptoms of being an internet addict:
156. You forget your friend's name but not her e-mail address.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230612201811.527FE1C0758%40moolenaar.net.


Re: The package you uploaded (vim-noweb.tgz) is empty

2023-06-08 Thread Bram Moolenaar


> I've been following this thread for a while now. Is there a team handling
> the vim.org site? Maybe we can collect a few people interested enough to
> volunteer? I'm interested for one. That team could be responsible for
> ensuring issues like these are fixed, and the general updates of the site.

The site is hosted by OSDN.  In the past their support has been very
good.  But I don't know what their situation is right now.

You can find information at https://osdn.net/
They are located in Japan.

The last week the problem would go away after a while, but it has now
been "broken" for more than a day.

-- 
In a world without fences, who needs Gates and Windows?

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230608154601.3FF671C0792%40moolenaar.net.


Re: The package you uploaded (vim-noweb.tgz) is empty

2023-06-07 Thread Bram Moolenaar


Christian wrote:

> On Di, 06 Jun 2023, Bram Moolenaar wrote:
> 
> > I have created a ticket.  Unfortunately the information we have is not
> > very specific, that makes it difficult to pinpoint the problem.  If you
> > notice the problem, plesae gather as much information as you can,
> > especially the exact time, and let me know.  I can add that to the
> > ticket.
> 
> There must still be something wrong, because after logging into vim.org, 
> I only get the following error message
> query failed IX3
> 
> I suppose some issue with the DB connection still?

It looks like the problem comes and goes.  I still have no clue why the error
appears.

-- 
You cannot have a baby in one month by getting nine women pregnant.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230607151723.67F591C0642%40moolenaar.net.


Re: luaeval returns number out of float

2023-06-06 Thread Bram Moolenaar


> I use luaeval to compute some float result.
>  these floating values are returned 
>  to vim9 defined func which itself returns float type. 
> 
> When i run a try, vim echoes error E1012: type mismatch; expected float but 
> got number. 
> 
> 
> Code:
> def Foo(): float
>  return luaeval('require("compute.utils" ).luamethod(_A.x,_A.y)', {'x' : 
> '2.0', 'y' : '1.0' }) 
> enddef
> 
> When i print returned value of lua méthode, it prints 1.0

I get an error for loading compute.utils:
[string "luaeval"]:1: module 'compute.utils' not found:
<09>no field package.preload['compute.utils']

Does that need to be installed first?

There are a couple of errors in the code that you should have noticed:
There should not be a space before the colons in the dictionary.

I assume you call the function with "echo Foo()"?

I cannot guess what the problem is, this appears to work fine:

def Foo(): float
   return luaeval('math.pi') 
    enddef

-- 
I have a watch cat! Just break in and she'll watch.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230606165700.E0AC61C0642%40moolenaar.net.


Re: The package you uploaded (vim-noweb.tgz) is empty

2023-06-06 Thread Bram Moolenaar


John Beckett wrote:

> On Tuesday, June 6, 2023 at 3:31:29 AM UTC+10 Bram Moolenaar wrote:
> 
> > I have see some DB errors the last few days. Usually the problem goes
> > away a bit later, e.g. after an hour. I have no clue what might cause this.
>  
> Are you able to ask for help at the hosting service? The problem would 
> probably be resolved by restarting whatever it is that hosts www.vim.org. 
> Google shows lots of hits for "Can't connect to local MySQL server through 
> socket".

I have created a ticket.  Unfortunately the information we have is not
very specific, that makes it difficult to pinpoint the problem.  If you
notice the problem, plesae gather as much information as you can,
especially the exact time, and let me know.  I can add that to the
ticket.

-- 
hundred-and-one symptoms of being an internet addict:
124. You begin conversations with, "Who is your internet service provider?"

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230606154443.20FCE1C061C%40moolenaar.net.


Re: The package you uploaded (vim-noweb.tgz) is empty

2023-06-05 Thread Bram Moolenaar


Christian wrote:

> On Sa, 03 Jun 2023, Lifepillar wrote:
> 
> > On 2023-06-02, Bram Moolenaar  wrote:
> > 
> > > You could try using another browser.
> > 
> > I have tried with Safari, Brave, and LibreWolf (~Firefox) on macOS to no
> > avail. I have taken care to disable ad blockers and, afaics, only
> > cross-site cookies are blocked.
> 
> FWIW: I wanted to have a second look today, but it seems the webpage is 
> down currently (not being able to connect to the db).

I have see some DB errors the last few days.  Usually the problem goes
away a bit later, e.g. after an hour.  I have no clue what might cause this.

-- 
An actual excerpt from a classified section of a city newspaper:
"Illiterate?  Write today for free help!"

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230605173118.DA7451C0542%40moolenaar.net.


Re: BUG: terminal vim 9.0.1506 x64 window 10

2023-06-03 Thread Bram Moolenaar


> Of course vim can't possibly support all possible terminals
> 
> My point is different.  It's isn't working correctly on ANY of them.
> 
> see https://github.com/microsoft/terminal/issues?q=vim+in%3Atitle+

That search results in several issues, which one is this about?

This is about one product, I don't see the relation with "ANY" here.

-- 
hundred-and-one symptoms of being an internet addict:
112. You are amazed that anyone uses a phone without data...let
 alone hear actual voices.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230603212624.3F35D1C0C30%40moolenaar.net.


Re: BUG: terminal vim 9.0.1506 x64 window 10

2023-06-03 Thread Bram Moolenaar


> Which program do you mean when you say the good-old windows console
> and the newer windows terminal?

The Windows console is what was originally the console in MS-Windows.
Perhaps people refer to it as command.com or cmd.exe.
AFAIK this is available on every MS-Windows installation without
additional downloads or apps.

Windows terminal is a very recent development that aims to replace the
console.  It is actively being improved.
https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701
AFAIK this is intended as a replacement for the console and is
officially supported by Microsoft.

> Others are reporting that vim does not work correctly in the current 
> windows terminal.  I just read in the JPSoft forum that the screen is 
> scrambled upon exiting vim when called from windows terminal or cmd.exe.  
> However, this sounds like a bug I reported ~2 yrs ago that was fixed 
> relatively quickly.

JPSoft has its own terminal, right?  There must be dozens of alternatives.
Vim can't possibly add code to support each peculiarity of each of them.
I'm not sure what generic problem exists that is not terminal-specific.

-- 
hundred-and-one symptoms of being an internet addict:
109. You actually read -- and enjoy -- lists like this.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230603192854.3D2121C0C30%40moolenaar.net.


Re: [vim 9 script] String indexing behavior different from legacy Vim

2023-06-03 Thread Bram Moolenaar


> Sorry but,
> Out of well indexing,
> which is faster ?
> 
> 1) indexing by bytes -> legacy
> 2) indexing by characters -> vim9script

Indexing by bytes can be faster.  But the difference is probably small,
the computation of the index probably matters more.  You'll have to try
it out to know what happens in your situation.

-- 
hundred-and-one symptoms of being an internet addict:
102. When filling out your driver's license application, you give
 your IP address.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230603160350.775771C0595%40moolenaar.net.


Re: [vim 9 script] String indexing behavior different from legacy Vim

2023-06-03 Thread Bram Moolenaar


> On 2023-06-03, Bram Moolenaar  wrote:
> >
> >> Legacy Vim script:
> >>
> >> let text = 'àbc'
> >> echo text[2]
> >>
> >> Result: 'b'
> >>
> >> Vim 9 script:
> >>
> >> const text = 'àbc'
> >> echo text[2]
> >>
> >> Result: 'c'
> >>
> >> Is the different behavior (counting chars vs bytes?) intentional?
> >
> > Yes, in Vim9 script the index is in characters.  In legacy script it is
> > in bytes.
> >
> > The help for this doesn't have it's own tag, I'll add one.
> > You can find it above ":help vim9-gotchas".
> 
> I was expecting to find it under `:help vim9-differences`, but either
> I missed the relevant item, or it's not there, in which case it could be
> added there.

Well, that's an overview, not a complete list.  There is no objective
way to decide what to put there, what is important enough.  I can add
this one, but for expressions there are more things that can matter.
Adding a link to vim9-gotchas also would be useful.

-- 
Execuses for making a mistake:
In the morning: "I didn't have enough coffee yet!"
In the afternoon: "Look at all the things that I did right!"
In the evening: "I'm too tired!"

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230603145544.246A01C0595%40moolenaar.net.


Re: [vim 9 script] String indexing behavior different from legacy Vim

2023-06-03 Thread Bram Moolenaar


> Legacy Vim script:
> 
> let text = 'àbc'
> echo text[2]
> 
> Result: 'b'
> 
> Vim 9 script:
> 
> const text = 'àbc'
> echo text[2]
> 
> Result: 'c'
> 
> Is the different behavior (counting chars vs bytes?) intentional?

Yes, in Vim9 script the index is in characters.  In legacy script it is
in bytes.

The help for this doesn't have it's own tag, I'll add one.
You can find it above ":help vim9-gotchas".

-- 
hundred-and-one symptoms of being an internet addict:
101. U can read htis w/o ny porblm and cant figur eout Y its evn listd.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230603111243.9935E1C0595%40moolenaar.net.


Re: The package you uploaded (vim-noweb.tgz) is empty

2023-06-02 Thread Bram Moolenaar


> On 2023-05-26, Edward McGuire  wrote:
> > I offered a tarball containing an ftdetect, a syntax, and a README and
> > LICENSE.
> > The site replied: "The package you uploaded (vim-noweb.tgz) is empty".
> 
> I am getting the same error, e.g.:
> 
> vim-solarized8-1.5.0.tar.gz is empty, are you sure you specified the 
> correct path?
> 
> I have tried to upload both a .tar.gz and a .zip file: no difference.
> 
> Script IDs I've tried: 5575 (WWDC17 colorscheme) and 5388 (Solarized 8).
> 
> URLs:
> https://www.vim.org/scripts/script.php?script_id=5575
> https://www.vim.org/scripts/add_script_version.php?script_id=5388

I can't find anything wrong in the PHP code.  It has not changed for a
long time.  Sometimes a PHP version update causes trouble, but I don't
see anything special in how the mechanism works.  I don't see any web
server logs where the problem would be mentioned.

The PHP docs suggest that the size is zero if no file was actually
selected.  I don't expect you made that mistake though.

You could try using another browser.

-- 
hundred-and-one symptoms of being an internet addict:
94. Now admit it... How many of you have made "modem noises" into
the phone just to see if it was possible? :-)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230602164814.11EC11C0C30%40moolenaar.net.


Re: Multiple windows get corrupted

2023-06-02 Thread Bram Moolenaar


> > > > > As I mentioned in my post that begins with "Everybody FYI" I had just 
> > > > > recently discovered that pulling the edge of the window left
> > > > > or right when the garbling happened it *made *it the problem
> > > > > go away.  But I was hoping to find a fix for my problem so
> > > > > that it doesn't happen; specially when I am pair coding with a
> > > > > colleague. It gets frustrating specially since I couldn't
> > > > > figure out yet a keyboard short cut for pulling side of window
> > > > > left or right. 
> > > > 
> > > > OK, so just before resizing the window manually Vim somehow is in a bad 
> > > > state. It most likely is related to how the Vim window was resized. Do 
> > > > you know? In case you are not sure you could use: 
> > > 
> > > Yes. As I mentioned before I would resize the window to accommodate for a 
> > > opening another file in side window. 
> > 
> > The big question is: HOW did you resize the window? Resizing manually 
> > fixes the problem, thus you didn't resize it the normal way, right?
>  
> Oh. Missed your question here. So I would just use the mouse to pull the 
> side of the window out to make the window wider. 

But then you can avoid the problem by doing it again?  That doesn't give
any hint about why it happened the first time.  Can you think of
anything that might matter?

> > > > verbose set columns? 
> > > > verbose set lines? 
> > > > 
> > > > Hopefully this leads to some Vim script or an autocommand that triggers 
> > > > the problem. We need this to be able to write a test for it anyway. 
> > > > Note that you need to start Vim with "--clean" to make sure your local 
> > > > setup doesn't change what happens. 
> > > 
> > > Regarding starting Vim with "--clean". The "--clean" option was suggested 
> > > sometime at the start of this thread. It ran with no issues but it also 
> > > considerably limited my editing capabilities. 
> > 
> > The idea is that you start Vim with "--clean" and then add pieces of 
> > your setup until you find out what piece matters for reproducing the 
> > problem. Hopefully not including a whole plugin, since then we would 
> > need to dig into that plugin.
> > 
> > " Hopefully not including a whole plugin, since then we would need to dig 
> > into that plugin."  ??? 
> 
> Not clear on this. 
> What does "add pieces" mean? Does it mean pieces of the the vimrc file or 
> adding plugins one by one or is it actually both?

Both.  In the case of using your vimrc file, you can put a "finish"
command in various places and see what the effect is.  Binary search
should work fastest.  But start by putting it near the top to check that
it actually matters to be there at all.

For plugins you could rename them temporarily, e.g. by changing ".vim"
to ".skip".

-- 
>From "know your smileys":
 :-*A big kiss!

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230602131400.26A351C1B27%40moolenaar.net.


Re: Multiple windows get corrupted

2023-06-01 Thread Bram Moolenaar


> > > As I mentioned in my post that begins with "Everybody FYI" I had just 
> > > recently discovered that pulling the edge of the window left or right 
> > > when 
> > > the garbling happened it *made *it the problem go away. 
> > > But I was hoping to find a fix for my problem so that it doesn't happen; 
> > > specially when I am pair coding with a colleague. It gets frustrating 
> > > specially since I couldn't figure out yet a keyboard short cut for 
> > > pulling 
> > > side of window left or right. 
> > 
> > OK, so just before resizing the window manually Vim somehow is in a bad 
> > state. It most likely is related to how the Vim window was resized. Do 
> > you know? In case you are not sure you could use:
> 
> Yes. As I mentioned before I would resize the window to accommodate for a 
> opening another file in side window.

The big question is: HOW did you resize the window?  Resizing manually
fixes the problem, thus you didn't resize it the normal way, right?

> > verbose set columns? 
> > verbose set lines? 
> > 
> > Hopefully this leads to some Vim script or an autocommand that triggers 
> > the problem. We need this to be able to write a test for it anyway. 
> > Note that you need to start Vim with "--clean" to make sure your local 
> > setup doesn't change what happens.
> 
> Regarding starting Vim with "--clean". The "--clean" option was suggested 
> sometime at the start of this thread. It ran with no issues but it also 
> considerably limited my editing capabilities.

The idea is that you start Vim with "--clean" and then add pieces of
your setup until you find out what piece matters for reproducing the
problem.  Hopefully not including a whole plugin, since then we would
need to dig into that plugin.

-- 
>From "know your smileys":
 <|-) Chinese
 <|-( Chinese and doesn't like these kind of jokes

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230601215101.1EACA1C0916%40moolenaar.net.


Re: Multiple windows get corrupted

2023-06-01 Thread Bram Moolenaar


> As I mentioned in my post that begins with "Everybody FYI" I had just 
> recently discovered that pulling the edge of the window left or right when 
> the garbling happened it *made *it the problem go away.
> But I was hoping to find a fix for my problem so that it doesn't happen; 
> specially when I am pair coding with a colleague. It gets frustrating 
> specially since I couldn't figure out yet a keyboard short cut for pulling 
> side of window left or right.

OK, so just before resizing the window manually Vim somehow is in a bad
state.  It most likely is related to how the Vim window was resized.  Do
you know?  In case you are not sure you could use:

verbose set columns?
verbose set lines?

Hopefully this leads to some Vim script or an autocommand that triggers
the problem.  We need this to be able to write a test for it anyway.
Note that you need to start Vim with "--clean" to make sure your local
setup doesn't change what happens.

-- 
>From "know your smileys":
 |-(Contact lenses, but has lost them

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230601205507.6B1D41C0916%40moolenaar.net.


Re: Multiple windows get corrupted

2023-06-01 Thread Bram Moolenaar


> > You can try resizing it, e.g. by grabbing the left or right size and 
> > dragging it just enough to make the window one character wider or 
> > smaller. Then check if the 'columns' and 'lines' options did change.
> 
> I did as you asked and answer is yes columns option did change by just
> one character increase. 

Well, does that make the problem go away?


-- 
>From "know your smileys":
 :-| :-|   Deja' vu!

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230601192724.8DD291C0916%40moolenaar.net.


Re: Multiple windows get corrupted

2023-06-01 Thread Bram Moolenaar


> Ok. So as expected it happened again. And I followed the steps you (Bram) 
> mentioned. I have following diffs between the bad (left side) and good 
> (right side):
> 
> columns=258   <-> columns=120
> lines=72   <-> lines=60
> modified   <-> nomodified
> scroll=35   <-> scroll=29
> window=71   <-> window=59
> 
> lines, columns, and window are set in my .gvimrc. I am experimenting with 
> commenting them out to see if any effect. 
> 
> Any ideas from your side?

The number of columns and lines has changed.  Did the Vim window
actually change size?  It would have gotten more than twice as wide.
Or the font has changed to a much smaller one.

You can try resizing it, e.g. by grabbing the left or right size and
dragging it just enough to make the window one character wider or
smaller.  Then check if the 'columns' and 'lines' options did change. 

-- 
I AM THANKFUL...
...for the taxes that I pay because it means that I am employed.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230601090111.6344C1C0916%40moolenaar.net.


Re: The package you uploaded (vim-noweb.tgz) is empty

2023-05-31 Thread Bram Moolenaar


> > > Just curious if this works with a zip extension or a simple .vmb for 
> > > vimball.
> > 
> > Great question. I had not heard of vimball. I will try it and see if
> > that gets around the error.
> 
> See :h vimball
> 
> > Is vimball the most portable format? Should the example be updated
> > on vim.org?
> 
> I think vimball format was invented to have a nice way to distribute 
> plguins in some kind of archive form (but only works well for text 
> files). Nowadays, it seems it is rarely used and github plugin links 
> have become the de-facto standard.

Right, those who don't mind pulling plugins directly from github, using
a plugin manager, won't use vimballs.  Those who prefer the good old
"download & install" will find vimball fits their usage better.  It's
mostly a choice the plugin writer makes and usually finds it less work
to just keep doing the same.  But some support both, it's a little work
up front but little maintenance.

> That document should shows an example. It may make sense to update this: 
> ping @bram

This was written by Charles Campbell.  Is the help for ":MkVimball" not
sufficient?  If someone wants to propose an improvement then ask Charles
to review it.

-- 
>From "know your smileys":
 %  Bike accident.  A bit far-fetched, I suppose; although...
 o  _ _ _
 _o /\_   _ \\o  (_)\__/o  (_)
   _< \_   _>(_) (_)/<_\_| \   _|/' \/
  (_)>(_) (_)(_)   (_)(_)'  _\o_

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230531213005.351E31C1B27%40moolenaar.net.


Re: passing vim9 vars to python3

2023-05-31 Thread Bram Moolenaar


>- From vim9 help I see *Functions and variables are script-local by 
>default*
> 
>  So s: is no mandatory no?, because if I put s: I see E1268: 
> Cannot use s: in Vim9 script: s:yml_f = yml_fpath.

You need to declare the variable at the script level first.  You cannot
create a script variable in a function.  This is so that when accessing
the variable from a compiled function it knows where it is, it does not
need to be looked up by name (which is much faster).

>- So I delete s: and obtain this
> 
>3.12.0b1 (tags/v3.12.0b1:5612078, May 22 2023, 16:20:31) [MSC 
> v.1934 64 bit (AMD64)]
>
> 
>   regarding this code : 
> vim9script
> 
> def Py3_SimpleMinimalTest(yml_fpath: string): void
>   var yml_f: string = yml_fpath
>   exe 'py3 print(sys.version)'
>   exe 'py3 print(vim.current.buffer.vars)'
>   exe 'py3 print(vim.current.buffer.vars[''yml_f''])'
>enddef

This will certainly not work, since "vim.current.buffer.vars[]" refers
to buffer-local variables.  You could change the first line in this
function:
 b:yml_f = yml_fpath

But is this really buffer related?  And it does require a runtime lookup
by name.  Using a script-local variable will work better.


-- 
There's no place like $(HOME)!

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230531213005.3A2D11C1B32%40moolenaar.net.


Re: passing vim9 vars to python3

2023-05-31 Thread Bram Moolenaar


> Thank you I knew, this is working 
> 
> vim9script
> 
> def g:Py3_SimpleMinimalTest(yml_fpath: string): void
>   w:yml_f = yml_fpath
>   exe 'py3 print(sys.version)'
>   exe 'py3 print(vim.current.window.vars[''yml_f''])'
> enddef
> 
> and what about making this works
> 
> def g:Py3_SimpleMinimalTest(yml_fpath: string): void
>   *var yml_f:string  =* yml_fpath
>   exe 'py3 print(sys.version)'
>   exe 'py3 print(vim.current.**.vars[''yml_f''])'
> enddef

Do you mean you want to access variables local to a compiled function by
name?  That is not possible.  The "l:" namespace that exists in legacy
functions was intentionally left out in compiled functions, because it
adds quite a bit of overhead.  You can use a script-local variable to
make this work.  It does mean you go outside of the function scope, but
it's still inside the scope of the script file.  That means it won't
interfere with what happens in other scripts.

-- 
>From "know your smileys":
 <>:-)  Bishop

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230531141312.17DE91C0916%40moolenaar.net.


Re: Multiple windows get corrupted

2023-05-31 Thread Bram Moolenaar


> Everybody FYI... I thank all the replies I have gotten related to this 
> issue which I should mention I have not figured out what the cause is. I 
> followed the suggestion provided and was not able to find which, if any, 
> plugin caused it. However, by pure chance I recently discovered one thing. 
> So when that text garbling happened (and happened very often), I just used 
> exit my vim session and open all files in session until next time it 
> misbehaved again. Well the discovery that I made recently is that when that 
> happened to me, instead of exiting, I could either *pull *the right edge of 
> the window either in or out for a pixel or two OR *snap *the vim session 
> window to either left or right (on linux like using super key and 
> left/right arrow keys) of the screen and it refreshed my windows/buffers 
> and things would look normal until next time it misbehaved. 
> Does this discovery point in any direction as to what my issue is and how 
> to remedy it permanently?

Perhaps a window resize event makes Vim recompute some things and then
it works again?  Just guessing.

If some option gets a wrong value, such as 'lines' or 'columns', that
would cause display errors.  You could do the following:

redir > /tmp/settings_1
set! all
redir END

Do this when everything works OK and later when things are wrong, using
a different file name.  Then compare the output and try to spot the
difference.  If you see an option with a suspect value, you can possibly
find out where it was set with e.g.:

:verbose set lines?

-- 
>From "know your smileys":
 8<}}   Glasses, big nose, beard

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230531114816.C4F711C1B27%40moolenaar.net.


Re: passing vim9 vars to python3

2023-05-31 Thread Bram Moolenaar


> Seeing the legacy vimscript func* Test_python3_vars()* in 
> *src\testdir\test_python3.vim*, 
> 
> Can you confirm that in vim9script, those setlines test are no possible to 
> be written in same way to be passed to python3 world ?
> 
> func Test_python3_vars()
>   let g:foo = 'bac'  -- << -- THE ONLY ONE CAN BE USED in vim9 ?
>   let w:abc3 = 'def'-- << -- NOT POSSIBLE in vim9
>   let b:baz = 'bar'   -- << -- NOT POSSIBLE in vim9
>   let t:bar = 'jkl'   -- << -- NOT POSSIBLE in vim9

I guess you mean that in Vim9 script and in a :def function the "let"
command doesn't work.  You can just leave it out, e.g.:

   w:abc3 = 'def'

> Beyond a simple variable, is it possible to move a VIM9 class to the 
> python3 world?

You mean to pass a reference of the class and use it in Python?  No,
that is not possible.  The class implementation is only halfway, but
even when the work has been done a Python script will not be able to
access a Vim class directly.  You can only use it in a Vim script
context, such as using "vim.eval()".

-- 
Do not trust atoms, they make up everything.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230531114816.CA8211C1B32%40moolenaar.net.


Re: vim autoformat ?

2023-05-28 Thread Bram Moolenaar


> BTW, I suspect that Bram monitors vim-use, so cc-ing him just means he'll
> get two copies of the message.

So long as it's one message sent to different mail addresses, the
Message-ID field will be equal and they can be de-duplicated easily.

-- 
>From "know your smileys":
 O:-)   Saint

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230528172233.74DC11C0B0E%40moolenaar.net.


Re: vim autoformat ?

2023-05-27 Thread Bram Moolenaar


> I can't wrap my head around Vim autoformat at all. 
> I want to have autoformat on save feature. 
> I don't want it to have delays, so when i press `:w` it immediatelly saves 
> and formats indentation properly.
> 
> I have no idea what is going on in (neo)Vim discussions about this 
> autoformating. Looks like those people never coded in their life, and never 
> do any useful thing with their godly configs other than to brag.
> 
> Using Vim feature `gg=G` i format and indent whole file. 
> This is what I want to have, but discussions related to this are so 
> complicated. They just say 'look at my config', but I have no idea, what is 
> that I should look into his config, or just copying his whole config with a 
> lot of bloat. 
> 
> Please help. 

To get you started:

au FileType pascal au BufWritePre  * normal gg=G

This will add a BufWritePre autocommand to a buffer where 'filetype' is
set to "pascal".  You probably want to ehance this. E.g. add an augroup,
so you can delete the autocommand again.

Although this is what you asked for, you probably soon find out that
formatting text only when editing it works better.  Formatting the whole
file may mess things up without you noticing.

-- 
>From "know your smileys":
 :-)Funny
 |-)Funny Oriental
 (-:Funny Australian

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230527212235.DA4821C0F36%40moolenaar.net.


Re: E123 when referring to function argument

2023-05-23 Thread Bram Moolenaar


> I want to peek into a lambda so I can evaluate it in a new Vim process. Why
> do I get 'E123: Undefined function: Op' when I source this script?
> 
> vim9script
> def! g:LambdaText(Op: func(): number): void
> func Op
> enddef
> 
> def! g:TestRun(): void
> g:LambdaText(() => 2 * 4)
> enddef
> 
> g:TestRun()

The argument of the "func" command is a function name, not an
expression.  You are passing a variable, which is an expression.

There is a trick you can use: Assign the function reference to a global
variable.  Function names exist in the global namespace where the global
variable can also be found:

 def g:LambdaText(Op: func(): number): void
 g:ThatFunction = Op
 func g:ThatFunction
 unlet g:ThatFunction
 enddef


-- 
Be thankful to be in a traffic jam, because it means you own a car.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230523134823.1939E1C0F38%40moolenaar.net.


Re: ask Vim why the word under the cursor is misspelled

2023-05-17 Thread Bram Moolenaar


Adam Monsen wrote:

> Is there a way to directly ask the Vim spell checker precisely why the word
> under the cursor is misspelled?
> 
> It took me a bit to figure out how it paints a blue background behind bare
> words on a line because they are not capitalized. For example:
> 
> foo
> 
> I can figure it out pretty easily from the suggestions listed by typing z=
> in normal mode (while my cursor is on the highlighted non-capitalized word)
> because the first suggestion is "Foo" with a capital F.
> 
> It would be handy to be able to get this information explicitly in Vim
> script, similar to how I can use synIDattr() and synIDtrans() to query the
> name and detail of the syntax highlighting group in effect at the current
> cursor position. Getting the group "SpellCap" or something like "word [foo]
> is not capitalized" would be helpful. I guess I'd prefer the first because
> it is unambiguous and ":help SpellCap" works as expected.

You can use spellbadword() for that.

-- 
Nothing is fool-proof to a sufficiently talented fool.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230517211425.CC2D01C0C46%40moolenaar.net.


Re: BUG: terminal vim 9.0.1506 x64 window 10

2023-05-04 Thread Bram Moolenaar


> I use JPSoft's take command as by command interpreter.  Now at version 29.  
> When I start vim in the terminal, it does not update the screen correctly.
> Contents from longer lines remain on screen when the file has shorter lines.

I don't know the "take command".  Is this a kind of shell?  Or is it
like a console window, that you start Vim in?

There is no good standard terminal on MS-Windows, all off them have
their individual issues.  We try to support at least the good-old
Windows console and the newer Windows Terminal, since these are widely
used.  Making it work with all kind of alternatives is a struggle.  And
when you run Vim, the extra features that the alternative offers are
usually irrelevant.  Please consider using a standard terminal to run
Vim in.  Otherwise, report the problem to JPSoft.  Since Vim works fine
in a standard terminal, the problem very likely is on their side.


-- 
The fastest way to get an engineer to solve a problem is to declare that the
problem is unsolvable.  No engineer can walk away from an unsolvable problem
until it's solved.
(Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230504144843.5932A1C1272%40moolenaar.net.


Re: Bug? E216: No such group or event: filetypedetect BufReadPost msg in 14_XxdBack:

2023-05-03 Thread Bram Moolenaar


Zach Pfeffer wrote:

> > > Posting this here based on the request at
> > > https://github.com/vim/vim/blob/master/CONTRIBUTING.md :
> > >
> > > "If you are not 100% sure that your problem is a Vim issue, please first
> > > discuss this on the Vim user maillist."
> > >
> > > Running:
> > >
> > > VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Jun 28 2022 13:09:53)
> > > MS-Windows 32-bit GUI version with OLE support
> > > (the one downloadable from https://www.vim.org/download.php)
> > >
> > > ... I noticed a message when clicking Convert Back after Convert to HEX:
> > >
> > > Error detected while processing functions 14_XxdBack:
> > > line9:
> > > E216: No such group or event: filetypedetect BufReadPost
> > >
> > > ...this message cleared when I pressed Enter.
> > >
> > > I found this message went away with this patch:
> > >
> > > --- menu.vim2023-04-29 16:47:05.708417500 -0600
> > > +++ menu.vim.bak2022-06-28 07:08:36.0 -0600
> > > @@ -599,10 +599,8 @@
> > >  s:XxdFind()
> > >  exe ':%!' .. g:xxdprogram .. ' -r'
> > >endif
> > > -  if exists('did_load_filetypes')
> > > -set ft=
> > > -doautocmd filetypedetect BufReadPost
> > > -  endif
> > > +  set ft=
> > > +  doautocmd filetypedetect BufReadPost
> > > = mod
> > >  enddef
> > >
> > > Is there a better solution? Should I file this as a bug?
> >
> > Looks like your diff is the wrong way around.
> 
> 
> Yup! I'm sorry about that. Here's the patch with your suggestion with
> the diff the correct way around.
> 
> --- menu.vim.orig   2022-06-28 07:08:36.0 -0600
> +++ menu.vim2023-05-02 20:20:00.052527000 -0600
> @@ -599,8 +599,10 @@
>  s:XxdFind()
>  exe ':%!' .. g:xxdprogram .. ' -r'
>endif
> -  set ft=
> -  doautocmd filetypedetect BufReadPost
> +  if exists('#filetypedetect') && exists('#BufReadPost')
> +set ft=
> +doautocmd filetypedetect BufReadPost
> +  endif
> = mod
>  enddef
> 
> >
> >
> > Instead of checking for "did_load_filetypes" a more direct condition
> > would be to use:
> >
> >  if exists('#filetypedetect') && exists('#BufReadPost')
> > set ft=
> > doautocmd filetypedetect BufReadPost
> >   endif
> >
> > Does that work for you?
> 
> Yup. Works great.
> 
> Would you like me to file a bug and create a patch on vim-dev against
> the bug?

Thanks for checking.  Not need to do more, I'll just include the change.

-- 
"You're fired." (1980)
"You're laid off." (1985)
"You're downsized." (1990)
"You're rightsized." (1992)
(Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230503162626.ED59A1C126B%40moolenaar.net.


Re: Bug? E216: No such group or event: filetypedetect BufReadPost msg in 14_XxdBack:

2023-05-02 Thread Bram Moolenaar


[resend, picky postmaster refused the message]

Zach Pfeffer wrote:

> Posting this here based on the request at
> https://github.com/vim/vim/blob/master/CONTRIBUTING.md :
> 
> "If you are not 100% sure that your problem is a Vim issue, please first
> discuss this on the Vim user maillist."
> 
> Running:
> 
> VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Jun 28 2022 13:09:53)
> MS-Windows 32-bit GUI version with OLE support
> (the one downloadable from https://www.vim.org/download.php)
> 
> ... I noticed a message when clicking Convert Back after Convert to HEX:
> 
> Error detected while processing functions 14_XxdBack:
> line9:
> E216: No such group or event: filetypedetect BufReadPost
> 
> ...this message cleared when I pressed Enter.
> 
> I found this message went away with this patch:
> 
> --- menu.vim2023-04-29 16:47:05.708417500 -0600
> +++ menu.vim.bak2022-06-28 07:08:36.0 -0600
> @@ -599,10 +599,8 @@
>  s:XxdFind()
>  exe ':%!' .. g:xxdprogram .. ' -r'
>endif
> -  if exists('did_load_filetypes')
> -set ft=
> -doautocmd filetypedetect BufReadPost
> -  endif
> +  set ft=
> +  doautocmd filetypedetect BufReadPost
> = mod
>  enddef
> 
> Is there a better solution? Should I file this as a bug?

Looks like your diff is the wrong way around.

Instead of checking for "did_load_filetypes" a more direct condition
would be to use:

 if exists('#filetypedetect') && exists('#BufReadPost')
    set ft=
doautocmd filetypedetect BufReadPost
  endif

Does that work for you?


-- 
Lower life forms have more fun!

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230502234621.33D7C1C0664%40moolenaar.net.


Re: How to remove uploaded scripts on vim.org and how to find scriptid and src_id?

2023-05-02 Thread Bram Moolenaar


[resend, picky postmaster refused the message]

Ubaldo Tiberi wrote:

> This is my first post in this mailing list, I hope I am not messing up
> anything!
> I wrote my first two plugins and I uploaded them on vim.org
> <http://vim.org/> but in one of them an extra .0 slipped away while I
> was writing its version and I realized it  after the script was
> uploaded. Now I wish to remove and upload it again with the correct
> version number but I couldn’t figure out how to do it. 

There is no web interface for this.  It needs to be done with an SQL
query, only a few people have access.

Is this about "vim-outline-1.0.0.zip", listed with version "v1.0.0.0"?
And you want to change the version to "v1.0.0"?
 
> Another thing: I discovered :h glvs-plugin but I have no idea what how
> to find both my scriptid and and src_id. Any help?

The script_id is in the URL of your script:
https://www.vim.org/scripts/script.php?script_id=6068
The src_id is in the URL of the download:
https://www.vim.org/scripts/download_script.php?src_id=28444

-- 
I once paid $12 to peer at the box that held King Tutankhamen's little
bandage-covered midget corpse at the De Young Museum in San Francisco.  I
remember thinking how pleased he'd be about the way things turned out in his
afterlife.
    (Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230502234621.4415B1C1250%40moolenaar.net.


Re: How to remove uploaded scripts on vim.org and how to find scriptid and src_id?

2023-05-02 Thread Bram Moolenaar


[resend, picky postmaster refused the message]

Ubaldo Tiberi wrote:

> This is my first post in this mailing list, I hope I am not messing up
> anything!
> I wrote my first two plugins and I uploaded them on vim.org
> <http://vim.org/> but in one of them an extra .0 slipped away while I
> was writing its version and I realized it  after the script was
> uploaded. Now I wish to remove and upload it again with the correct
> version number but I couldn’t figure out how to do it. 

There is no web interface for this.  It needs to be done with an SQL
query, only a few people have access.

Is this about "vim-outline-1.0.0.zip", listed with version "v1.0.0.0"?
And you want to change the version to "v1.0.0"?
 
> Another thing: I discovered :h glvs-plugin but I have no idea what how
> to find both my scriptid and and src_id. Any help?

The script_id is in the URL of your script:
https://www.vim.org/scripts/script.php?script_id=6068
The src_id is in the URL of the download:
https://www.vim.org/scripts/download_script.php?src_id=28444

-- 
I once paid $12 to peer at the box that held King Tutankhamen's little
bandage-covered midget corpse at the De Young Museum in San Francisco.  I
remember thinking how pleased he'd be about the way things turned out in his
afterlife.
    (Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230502234621.3F2991C123B%40moolenaar.net.


Re: Bug? E216: No such group or event: filetypedetect BufReadPost msg in 14_XxdBack:

2023-05-02 Thread Bram Moolenaar


[resend, picky postmaster refused the message]

Zach Pfeffer wrote:

> Posting this here based on the request at
> https://github.com/vim/vim/blob/master/CONTRIBUTING.md :
> 
> "If you are not 100% sure that your problem is a Vim issue, please first
> discuss this on the Vim user maillist."
> 
> Running:
> 
> VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Jun 28 2022 13:09:53)
> MS-Windows 32-bit GUI version with OLE support
> (the one downloadable from https://www.vim.org/download.php)
> 
> ... I noticed a message when clicking Convert Back after Convert to HEX:
> 
> Error detected while processing functions 14_XxdBack:
> line9:
> E216: No such group or event: filetypedetect BufReadPost
> 
> ...this message cleared when I pressed Enter.
> 
> I found this message went away with this patch:
> 
> --- menu.vim2023-04-29 16:47:05.708417500 -0600
> +++ menu.vim.bak2022-06-28 07:08:36.0 -0600
> @@ -599,10 +599,8 @@
>  s:XxdFind()
>  exe ':%!' .. g:xxdprogram .. ' -r'
>endif
> -  if exists('did_load_filetypes')
> -set ft=
> -doautocmd filetypedetect BufReadPost
> -  endif
> +  set ft=
> +  doautocmd filetypedetect BufReadPost
> = mod
>  enddef
> 
> Is there a better solution? Should I file this as a bug?

Looks like your diff is the wrong way around.

Instead of checking for "did_load_filetypes" a more direct condition
would be to use:

 if exists('#filetypedetect') && exists('#BufReadPost')
    set ft=
doautocmd filetypedetect BufReadPost
  endif

Does that work for you?


-- 
Lower life forms have more fun!

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230502234621.39F791C0D4E%40moolenaar.net.


Re: surprising glob() result on Windows

2023-05-02 Thread Bram Moolenaar


> Just out of curiosity, I tried the same with python and tcl.  Neither 
> returns multiple files for the *.abc case so their behavior is 
> different.  I don't know why it differs but I would argue that their 
> outputs do a better job of "meeting expectations".

That depends on what your expectations are.  If you list a directory and
see a file "some~1.abc" then a glob() with *.abc should find it, right?
Or not?  The question is whether you expect to match the long name only.

Usually when we encounter something where it's not 100% clear what the
right behavior is, the best choice is to leave it alone.  The people who
are happy with the current behavior won't make any remark right now,
thus we have no idea how many we would "hurt" by making a change.

> Perhaps this is an issue I should raise with the vim developers for the 
> following reasons.  First, the Windows outputs are inconsistent with the 
> linux outputs for the same directory contents.

Still, there have been no complaints until now.  It appears to be more a
theoretical problem than a practical one.

Adding an optional argument to glob() to avoid the short filenames is
not a good idea, there already are three optional arguments.  We could
change this to use a second argument that is a dictionary with the
current options plus the new one.  It would be clearer when reading back
the function call.  Is it really worth making this change?

> Second, it appears that vim is using this glob capability when
> sourcing plugins (I first noticed this using packadd) and so unwanted
> files could be sourced on Windows systems.

Can you be more specific about "when sourcing plugins" ?
Are there really files using an extension starting with ".vim"?

-- 
Team-building exercises come in many forms but they all trace their roots back
to the prison system.  In your typical team-building exercise the employees
are subjected to a variety of unpleasant situations until they become either a
cohesive team or a ring of car jackers.
    (Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230502195340.586011C0C46%40moolenaar.net.


Re: Small documentation tweak for :g delimiters

2023-05-01 Thread Bram Moolenaar


Tim Chase wrote:

> Shortly after the help for :v it reads
> 
>   Instead of the '/' which surrounds the {pattern}, you can use any
>   other single byte character, but not an alphabetic character,
>   '\', '"' or '|'.  This is useful if you want to include a '/' in
>   the search pattern or replacement string.
> 
> This makes it sounds like "!" should be a viable delimiter (as it
> it is for a :s command per `:help pattern-delimiter`).  However,
> it ends up turning a :g command into a :v command.
> 
> So in addition to excluding backslash, double-quote, and bar, I'd
> recommend adding "!" to the list here.
> 
> -tim
> 
> discovered by unthinkingly doing a
> 
>   :g!/path/
> 
> and getting all lines that didn't contain "path" rather than all
> lines that did contain "/path/".  Using an alternate delimiter like
> 
>   :g@/path/
> 
> worked as expected.  And I often use "!" as my pattern-delimiter
> in substitute commands when the pattern contains "/" characters

Thanks for the suggestion.  I first thought this was only for ":global",
but using it with ":vglobal" gives an error "E477: No ! allowed".
Thus it can indeed be added to the list.

-- 
Scientists decoded the first message from an alien civilization:
SIMPLY SEND 6 TIMES 10 TO THE 50 ATOMS OF HYDROGEN TO THE STAR
SYSTEM AT THE TOP OF THE LIST, CROSS OFF THAT STAR SYSTEM, THEN PUT
YOUR STAR SYSTEM AT THE BOTTOM OF THE LIST AND SEND IT TO 100 OTHER
STAR SYSTEMS.  WITHIN ONE TENTH GALACTIC ROTATION YOU WILL RECEIVE
ENOUGH HYDROGREN TO POWER YOUR CIVILIZATION UNTIL ENTROPY REACHES ITS
MAXIMUM!  IT REALLY WORKS!

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230501213725.049491C0916%40moolenaar.net.


Re: surprising glob() result on Windows

2023-04-29 Thread Bram Moolenaar


> Briefly, I have a case where glob("*.ext") returns more files than I 
> expect.
> 
> To give an example, in a directory of your choice create two files named 
> "test.any" and "zest.anyother".  The important detail is that the second 
> filename's extension be prefixed by the first filename's extension.
> 
> Then launch Vim in that directory and run the command
> :echo glob("*.any")
> Both files are returned, not just "test.any".
> 
> I see this on Windows running vim 9.0.1240 with normal features built 
> with Visual C.  On the other hand, Vim on my linux box returns only 
> "test.any", as I would expect, so I don't think this a feature. :)
> 
> Any comments?

What file system is being used?  Some older filesystems use a trick to
make long file names possible.  The file then appears twice in the
directory, once with the short name and once with the long name.  Vim
may find a match with the short name, includes it in the list of
matches and then expands it to the long name.
See https://en.wikipedia.org/wiki/Long_filename

-- 
ARTHUR:   Now stand aside worthy adversary.
BLACK KNIGHT: (Glancing at his shoulder) 'Tis but a scratch.
ARTHUR:   A scratch?  Your arm's off.
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230429132628.E64621C09E0%40moolenaar.net.


Re: Unable to log in to vim.org

2023-04-17 Thread Bram Moolenaar


Christian wrote:

> On Mo, 17 Apr 2023, 'Sebastian G=C3=B6decke' via vim_use wrote:
> > Hm, now it's complete offline?
> 
> It seems to work now again. I can login and do not see issues with the
> database anymore.

For me it looks like it's fully working again.  I don't have information
about what was wrong.  I hope it won't happen again.

-- 
Men may not be seen publicly in any kind of strapless gown.
[real standing law in Florida, United States of America]

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230417145356.0D0A31C0423%40moolenaar.net.


Re: Unable to log in to vim.org

2023-04-15 Thread Bram Moolenaar


> When I attempt to log in to vim.org to upload a script release, either the 
> login page hangs, or I get a "query failed IX3" error. Does anyone know 
> whether the site is down? I think I have the correct username and password 
> but can't tell for sure.

If you go to the home page you should see a warning for "Database
Problems".  The website depends on a database, which currently isn't
working.  Usually this kind of problem goes away after a short while.

I'll add a remark that this also affects login.

-- 
ARTHUR:  No, hang on!  Just answer the five questions ...
GALAHAD: Three questions ...
ARTHUR:  Three questions ...  And we shall watch ... and pray.
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230415203335.9455D1C0423%40moolenaar.net.


Re: Save terminal buffer with colors?

2023-04-12 Thread Bram Moolenaar


> Is there any possibility to save the content of terminal buffer (to a file) 
> with colors? I have terminal buffers with thousands of lines in scrollback 
> and I need to save it for further reference. If I just yank the lines and 
> paste into a normal buffer then all coloring is lost. Also the TOhtml 
> plugin gives the text without colors.
> 
> Some programs output error messages in red color and so they are standing 
> out and are easily spotted when scanning the terminal scrollback. For 
> comparison: It's possible to copy the scrollback of gnome terminal as HTML 
> and save it into file. Then later it's easy to open that file in a browser 
> and read the lines with original colors. Search some info in it. Having 
> something similar in vim terminal would be nice.

I don't think this is currently possible for scrollback.  You can get
the visible text and attributes with term_scrape().  That can be used to
store the information somewhere, it should be possible to make a plugin
that outputs HTML.

It should not be difficult to make term_scrape() work for text that has
scrolled out of view.  I wonder how to indicate the line number, perhaps
with a negative number?  Thus -1 would be the line above the first
visible line.  Using an absolute number is made difficult by the
'termwinscroll' value, lines at the start may have been deleted.

-- 
Vi beats Emacs to death, and then again!
http://linuxtoday.com/stories/5764.html

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230412103352.D792F1C10CC%40moolenaar.net.


Re: Error make vim on termux terminal

2023-04-04 Thread Bram Moolenaar


> [image: vim-bugs.jpg]
> According to the error message, I add the explicit declaration for "
> *setpwent"* and "*getpwent"* function at src/misc1.c, and it works,  like 
> this: 
> [image: vim-fix.png]
> *Environment:*
> Vim:9.0
> clang:16.0.0
> cmake:3.26.1
> Termux:latest
> 
> Has anyone had this problem?ߤ£

Please check the output of configure, especially src/auto/config.log.
Search for "getpwent".  Also search for pwd.h.

Can you find HAVE_PWD_H in src/auto/config.h ?

Instead of explicitly declaring the functions, this might work:

#include 

-- 
-rwxr-xr-x  1 root  24 Oct 29  1929 /bin/ed
-rwxr-xr-t  4 root  131720 Jan  1  1970 /usr/ucb/vi
-rwxr-xr-x  1 root  5.89824e37 Oct 22  1990 /usr/bin/emacs

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230404210527.411581C0B8A%40moolenaar.net.


Re: make it auto scroll horizontally

2023-03-27 Thread Bram Moolenaar


> how to make Vim, when it have long line, and my cursor is drawing end of 
> window, that it just move half screen horizontally.
> so it detect automatically and move.

Maybe the 'sidescrolloff' option works for this?


-- 
MORTICIAN:What?
CUSTOMER: Nothing -- here's your nine pence.
DEAD PERSON:  I'm not dead!
MORTICIAN:Here -- he says he's not dead!
CUSTOMER: Yes, he is.
DEAD PERSON:  I'm not!
  The Quest for the Holy Grail (Monty Python)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230327203405.9B35D1C128F%40moolenaar.net.


Re: [vim9script] Forward declarations for classes?

2023-03-26 Thread Bram Moolenaar


> Consider the following example:
> 
> class Rgb
>   this.r: float
>   this.g: float
>   this.b: float
> 
>   def ToHsv(): Hsv
> # ...
>   enddef
> endclass
> 
> class Hsv
>   this.h: float
>   this.s: float
>   this.v: float
> 
>   def ToRgb(): Rgb
> # ...
>   enddef
> endclass
> 
> In a scenario like the above, the return type of ToHsv() must be changed
> to `any`. Is a mechanism to make the above code legal being considered?
> 
> Of a similar flavour:
> 
> class X
>   def Clone(): X
> # Return a copy of this
>   enddef
> endclass
> 
> Currently, Clone() must be typed as `any`.

The second one should just work.  Currently the class is only defined
when "endclass" is found.  Doing it earlier is more implementation work,
but it should not require anything on the user side.

For the first example I'm not sure what the best solution is.  There is
a plan to add some kind of typedef, but it would still require something
extra to indicate the actual implementation will follow later.

There is trouble when it's not just the class name that needs to be
known, but also what it contains.  Then a forward declaration quickly
becomes a lot of duplicate text.  And recursive dependencies need to be
handled, which is also relevant in this example.


-- 
ARTHUR:Will you ask your master if he wants to join my court at Camelot?!
GUARD #1:  But then of course African swallows are not migratory.
GUARD #2:  Oh, yeah...
GUARD #1:  So they couldn't bring a coconut back anyway...
  The Quest for the Holy Grail (Monty Python)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230326202817.7BA141C128A%40moolenaar.net.


Re: digraph_get('NU') returns 0xA

2023-03-19 Thread Bram Moolenaar


> :echo char2nr(digraph_get('NU')) prints "10". this would seem to disagree
> with :h digraphs, which says that NU maps to "0" i.e. the null char. I
> don't think this is the result of an override as i certainly haven't tried
> to enact one and it happens even with -u NONE.

Since the NUL byte terminates a string in C, it is internally replaced
with NL, 0x0A.  When written to a file it is changed back to a NUL.
I most places you don't notice this, but sometimes it does.

> is this a bug?

Nope.

-- 
DINGO: Wicked wicked Zoot ... she is a bad person and she must pay the
   penalty.  And here in Castle Anthrax, we have but one punishment
   ... you must tie her down on a bed ... and spank her.  Come!
GIRLS: A spanking!  A spanking!
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230319215736.CCD371C135C%40moolenaar.net.


Re: [vim9script] Default value for object argument?

2023-03-12 Thread Bram Moolenaar


> How do you define a default value for a function argument whose type is
> a class? I have tried this:
> 
> vim9script
> 
> class X
> endclass
> 
> def F(x: X = null_object)
> enddef
> 
> F()
> 
> But this results in:
> 
> E1013: Argument 1: type mismatch, expected object but got 
> object
> 
> Maybe this is not supported yet?

The type system isn't fully worked out yet.  This works, but it's not
ideal:

var def: X
def F(x: X = def)
enddef

I'm not sure what syntax we should use for "null object of class X"?

-- 
Two fish in a tank. One says to the other:
"Do you know how to drive this thing?"

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230312201722.DBBE41C0D07%40moolenaar.net.


Re: Augmenting filetype detection for supplemental types

2023-02-26 Thread Bram Moolenaar


> Attempting to set multiple filetypes based on something like
> 
> autocmd FileType foo if ... | set filetype=foo.bar | endif
> 
> seems to have an ordering problem with the FileType autocmd that sets 
> 'syntax' -- the "foo.bar" filetype is set, requisite files for "bar" are 
> loaded, and then the autocmd waiting on the original expansion of  
> to "foo" runs and effectively resets the syntax.
> 
> Is there a way to tack on a supplemental filetype without running into 
> this problem?  The obvious approach of setting the whole string at once 
> works, but that requires duplicating everything that could otherwise 
> determine the initial filetype...

It's hard to think of an elegant way to deal with this.  Once the
FileType event is triggered, it would normally find all matching
autocommands and execute them.  Changing the value halfway makes it
unpredictable, easily leading to weird errors.

One way would be to not change 'filetype' directly but set a timer with
a very short timeout to do it later.  This can already be done now, you
can try it out.  Obvious disadvantage is that all the
indent/syntax/ftplugin files will be sourced twice.

A specific way to handle this would be to add a FileTypePre event, which
would be triggered first and allow for changing 'filetype'.  Hmm,
perhaps we would also need this for the Syntax event?
This would be a very specific solution, do we really need it?

-- 
hundred-and-one symptoms of being an internet addict:
182. You may not know what is happening in the world, but you know
 every bit of net-gossip there is.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230226144757.A0DCA1C0B1F%40moolenaar.net.


Re: Passing python3 file arguments seems failing py3f

2023-02-10 Thread Bram Moolenaar


> Following vim's python help, 
> 
> 
> *"To pass arguments you need to set sys.argv[] explicitly.  Example: >   * 
> :python sys.argv = ["foo", "bar"]
> :pyfile myscript.py
> *"*
> 
> 
> I tried to pass argues to python file as this 
> 
> export def PyLinter(): void
>   py3 import sys
>   py3 sys.argv = ["--version"]
>   exe 'py3f ' .. "path/to/somepythonfile.py"
> enddef
> 
> It's like as if it had no effect :   py3 sys.argv = ["--version"]
> 
> Is it due to python3 file?

It works for me. Typing these commands in sequence:

py3 sys.argv = ["argument"]
py3file /tmp/test.py

With /tmp/test.py:

print("testing pyfile")
print(sys.argv)
print("testing end")

Output:

testing pyfile
['argument']
testing end

This is on Ubuntu, Python 3.10.


-- 
hundred-and-one symptoms of being an internet addict:
107. When using your phone you forget that you don't have to use your
 keyboard.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230210145102.C532B1C247D%40moolenaar.net.


Re: Small doc omission: :tabdo in :help :bar

2023-02-08 Thread Bram Moolenaar


Tim Chase wrote:

> The help for :bar
> 
> > These commands see the '|' as their argument, and can therefore
> > not be followed by another Vim command:
> > ...
> 
> has list of commands that can't be followed by a "|" but it appears
> to be missing :tabdo from the list of commands.

I'll add it.  Let me know if any other is missing.

-- 
hundred-and-one symptoms of being an internet addict:
99. The hum of a cooling fan and the click of keys is comforting to you.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230208205556.8E7A51C247D%40moolenaar.net.


Re: Using Vim9 for a function

2023-01-20 Thread Bram Moolenaar


> On Fri, Jan 20, 2023 at 1:48 AM andalou  wrote:
> >
> >
> > I'm using vim 9.1221 on Windows 10. I tried to create a function using
> > Vim9, as in:
> >
> > def! Foo(a: float, b: float): float
> >   return a + b
> > enddef
> >
> > If I call Foo(1.2, 5.0) I get the answer 6.2
> >
> > but if I call Foo(1.2, 5) I get:
> >
> > E1013: Argument 2:type mismatch, expected float but got number
> >
> > How can I modify the function to make it possible to call Foo(1.2, 5)
> > and get a result.
> >
> > Many thanks in advance,
> >
> > --
> > Cesar
> 
> IIUC, allowing a Number to be used where a Float is expected is
> permitted in Vim pre-9 but forbidden in Vim 9.
> 
> Solution 1: Use "function" instead of "def". This will make your
> function a "legacy function" and it won't need strict-typed arguments:
> 
> :function Foo(a, b)
> :return a + b
> :endfunction
> 
> Solution 2: call Foo(1.2, 5.0) instead.

I believe most users expect an integer number to work where a float is
expected.  We encountered this before, then it was causing an invalid
result and it was solved by giving an error message.  I'll make another
change that actually converts the number to a float, that should better
match expectations.


-- 
If you put seven of the most talented OSS developers in a room
and ask them to fix a bug in a spreadsheet program, in one week
you'd have 2 new mail readers and a text-based web browser.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230120182246.D70281C09EE%40moolenaar.net.


Re: Why does (my) Vim leave the cursor to the last mark even if I don't save the file?

2023-01-20 Thread Bram Moolenaar


> I think what he is asking is for the " mark to only be written to the
> viminfo file for buffers that have been modified.  I'm not sure how to
> do this or if it is even possible, but it seems like a perfectly
> reasonable behavior to want.
> 
> Perhaps a VimLeavePre autocommand that wipes unmodified buffers?  What
> other settings for those buffers would not be saved to .viminfo?

How about:
- When writing the buffer set some flag, e.g. b:did_write_this_buf
- When exiting, go through all buffers and those that don't have the
  b:did_write_this_buf flag move the cursor to the " mark.

Something like that.

-- 
What a wonderfully exciting cough!  Do you mind if I join you?
-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230120160124.1A0801C09EE%40moolenaar.net.


Re: [Vim 9 script] Is there a way to get the actual type of an object?

2023-01-15 Thread Bram Moolenaar


> Silly example:
> 
> vim9script
> 
> class Num
>   this.n = 0
> endclass
> 
> class Even extends Num
>   def new(this.n)
> if this.n % 2 == 1
>   throw 'Not even'
> endif
>   enddef
> 
>   def IsPrime(): bool
> return this.n == 2
>   enddef
> endclass
> 
> class Odd extends Num
>   def new(this.n)
> if this.n % 2 == 0
>   throw 'Not odd'
> endif
>   enddef
> 
>   def IsDivisibleByFive(): bool
> return this.n % 5 == 0
>   enddef
> endclass
> 
> def Random(): Num
>   const n = rand() % 16
>   return n % 2 == 0 ? Even.new(n) : Odd.new(n)
> enddef
> 
> const v = Random()
> if # v is instance of Odd()
>   echo v.IsDivisibleByFive()
> else
>   echo v.IsPrime()
> endif
> 
> Is there a way to distinguish the class of the value returned by
> Random()?

Currently not.  I have been wondering what would be the best way to
cover this.  We already have type(), but this only returns the basic
type.  For example for list and list it returns the same
value.  It can tell the difference between a list and an object, but not
between two objects from a different class.

You can use typename(), it will include the name of the class.  However,
it is possible to have the same class name in two separate scripts,
since they are script-local by default.  Thus this may make you think
it's the same class while it is not.

Using "instanceof" would work in many places, but you would need to
import the class to be able to use it.  If you only want to know if two
objects are from the same class, that is extra overhead.

Perhaps we need a variant of type() that is specific about the exact
type.  Then it can also be used to tell the difference between
list and list.  This will be some work to implement,
because this will mean a new variable type.

-- 
hundred-and-one symptoms of being an internet addict:
20. When looking at a pageful of someone else's links, you notice all of them
are already highlighted in purple.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230115201920.C0A231C096B%40moolenaar.net.


Re: vim9 autoload script modified : How to reload it On-The-Fly

2023-01-11 Thread Bram Moolenaar


> Currently modifying an *autoload*/*vim9fooscript*.vim which can be started 
> by typing a nnoremap as this :
> 
> 
>- *_vimrc* :
> 
> import autoload './vimfiles/some/thing/*autoload*/*vim9fooscript*  .vim'
> as thatHelp
> *nnoremap* inout  thatHelp.E10_InOut()
> 
> 
> 
>- vimfiles/some/thing/*autoload*/*vim9fooscript*.vim  
> 
> def Foo which is currently modifying
> 
> 
> How to force "recompile" the new modified content of def Foo without touch 
> the nnoremap ?

There is no reliable way to reload an autoload script and have all the
changes take effect.  It's best to exit Vim and restart.  Trying to make
this work without a Vim restart is not only complicated, it is also
going to be unreliable.

-- 
An alien life briefly visits earth.  Just before departing it leaves a
message in the dust on the back of a white van.  The world is shocked
and wants to know what it means.  After months of studies the worlds
best linguistic scientists are able to decipher the message: "Wash me!".

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20230111200849.7B4C21C07A0%40moolenaar.net.


Vim calendar for 2023 available

2022-12-31 Thread Bram Moolenaar


Happy New Year to all Vim users!

I have updated the handy desktop calendar for 2023.  It prints on one
sheet of paper and, after folding and applying a bit of glue, stands on
your desk.

It is available in English and Dutch.  You can find the PDF files on my
website: https://moolenaar.net/#Calendar

Happy Vimming!

-- 
No man may purchase alcohol without written consent from his wife.
[real standing law in Pennsylvania, United States of America]

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20221231182320.A0DCC1C0AA3%40moolenaar.net.


Neovim conf - where are the recordings?

2022-12-11 Thread Bram Moolenaar


www.neovimconf.live has a link to youtube, but it appears to be only the
first day.  And no index of what talk is at what time.  And for the
talks there is only a title and a little info about the speaker, no
summary.  Thus it's hard to tell what is interesting enough to watch.

The schedule for the second day changed the last moment.  When I tuned
in there were just two guys talking about things unrelated to Vim and
playing video games...

Is there at least a link to the keynote?

-- 
Life would be so much easier if we could just look at the source code.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20221211162105.BBA1C1C0BA3%40moolenaar.net.


Re: What does mean?

2022-12-04 Thread Bram Moolenaar


> On Sat, 3 Dec 2022 23:07:15 -0800
> Gary Johnson  wrote:
> > I was troubleshooting a problem with the behavior of my mouse in
> > gvim when I discovered that typing Ctrl-K in insert mode and moving
> > the mouse to another window enters the special key code
> > "".  I can't find this special key documented anywhere.
> > Even ":helpgrep \cmousenm" didn't return any results.
> > 
> > Would someone please tell me what "" means?
> 
> I know that ‘NM’ stands for ‘Non Mappable’.  And that there is one entry
> in the docs, which you can find with this pattern:
> 
> :helpg \v\cmouse.?nm
> 
> Other than that I have no clue.  But I'm sure the devs can help.

You are right, these are non-mappable mouse clicks.  They are used
internally, you can't really use them.  But they might show up in some
places.

-- 
hundred-and-one symptoms of being an internet addict:
225. You sign up for free subscriptions for all the computer magazines

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20221204120710.011311C0574%40moolenaar.net.


Re: How to autosave files when terminal is closed

2022-10-29 Thread Bram Moolenaar


> On Sat, 29 Oct 2022 00:03:17 +0100, Bram Moolenaar wrote:
> > 
> > > On Fri, 28 Oct 2022 22:23:31 +0100, Bram Moolenaar wrote:
> > > > 
> > > > > "au VimLeavePre * w" only works when I exit vim with something
> > > > > like ":q!" but not if I close my terminal window.
> > > > > 
> > > > > Error detected while processing VimLeavePre Autocommands for
> > > > > "*": E749: Empty buffer
> > > > > 
> > > > > VimLeave[Pre] is being called, but the buffer is not saved,
> > > > > probably because it's closed before that event is triggered. Is
> > > > > there another event that gets triggered during the closing
> > > > > sequence that will allow me to autosave, or another way to do
> > > > > this?
> > > > 
> > > > Do you already have the 'autowriteall' option set?
> > > 
> > > I think that only affects closing via :quit and the like. Closing my
> > > xterm apparently doesn't follow that same exit pathway.
> > 
> > It is supposed to, but perhaps the catching of signals is not properly
> > setup.  Not sure how to try it out other than closing the xterm
> > normally.  If you "kill -9" the xterm it might not work. Closing the
> > window manager should also work OK.  At least this mechanism is used
> > to avoid leaving swap files laying around, and that works quite well,
> > thus 'autowriteall' should also work.  But I don't think there is a
> > test for it.
> 
> Yea, I guess signal catching isn't properly setup. It seems that my wm
> is sending vim a SIGHUP when it closes the xterm window:
> 
> Vim: Caught deadly signal HUP
> Vim: preserving files...
> Vim: Finished.
> 
> Manually killing vim with "kill (-1|-3|-15)" does not trigger that nice
> autowriteall (awa) feature, even though vim's output says "preserving
> files..."

I suppose TERM and HUP are handled differently.  But that is logical,
I'm not sure we should handle them the same way. 'autowriteall' is
boolean, not sure what would be a good way to make another choice of how
to handle TERM.  Well, maybe we can just change it, for most users they
will do the same thing anyway, just come from different causes (that you
don't have control over).

-- 
FIRST VILLAGER: We have found a witch.  May we burn her?
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20221029120439.0053B1C0739%40moolenaar.net.


Re: How to autosave files when terminal is closed

2022-10-28 Thread Bram Moolenaar


> On Fri, 28 Oct 2022 22:23:31 +0100, Bram Moolenaar wrote:
> > 
> > > "au VimLeavePre * w" only works when I exit vim with something like
> > > ":q!" but not if I close my terminal window.
> > > 
> > > Error detected while processing VimLeavePre Autocommands for "*":
> > > E749: Empty buffer
> > > 
> > > VimLeave[Pre] is being called, but the buffer is not saved, probably
> > > because it's closed before that event is triggered. Is there another
> > > event that gets triggered during the closing sequence that will
> > > allow me to autosave, or another way to do this?
> > 
> > Do you already have the 'autowriteall' option set?
> 
> I think that only affects closing via :quit and the like. Closing my
> xterm apparently doesn't follow that same exit pathway.

It is supposed to, but perhaps the catching of signals is not properly
setup.  Not sure how to try it out other than closing the xterm
normally.  If you "kill -9" the xterm it might not work. Closing the
window manager should also work OK.  At least this mechanism is used to
avoid leaving swap files laying around, and that works quite well, thus
'autowriteall' should also work.  But I don't think there is a test for
it.

-- 
   A village.  Sound of chanting of Latin canon, punctuated by short, sharp
   cracks.  It comes nearer.  We see it is a line of MONKS ala SEVENTH SEAL
   flagellation scene, chanting and banging themselves on the foreheads with
   wooden boards.
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20221028230317.12B871C0739%40moolenaar.net.


Re: Share variables between Two vim9 def functions

2022-10-28 Thread Bram Moolenaar


> Vim9script introduces the fact of having to use a global to pass values 
> ​​between a P function, producing its values, used for example in an 
> autocommand and a second C function consuming its data / values ​​which 
> would be called on a key mapping for example.  The fact is that going 
> through globals is not very elegant and forced to create a new global named 
> different in each new case explained above.  So I was looking for another 
> way.

With Vim9 script the recommended way is to put the variable in one
script where it is exported, and then import it whereever you want to
use it.  That way you have control over where the value is changed, make
it a constant, etc.  See help for "vim9-scopes" and ":import".

-- 
Westheimer's Discovery:
A couple of months in the laboratory can
frequently save a couple of hours in the library.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20221028214359.A00A91C0739%40moolenaar.net.


Re: How to autosave files when terminal is closed

2022-10-28 Thread Bram Moolenaar


> "au VimLeavePre * w" only works when I exit vim with something like
> ":q!" but not if I close my terminal window.
> 
> Error detected while processing VimLeavePre Autocommands for "*":
> E749: Empty buffer
> 
> VimLeave[Pre] is being called, but the buffer is not saved, probably
> because it's closed before that event is triggered. Is there another
> event that gets triggered during the closing sequence that will allow
> me to autosave, or another way to do this?

Do you already have the 'autowriteall' option set?

-- 
Mrs Abbott: I'm a paediatrician.
 Basil: Feet?
Mrs Abbott: Children.
 Sybil: Oh, Basil!
 Basil: Well, children have feet, don't they? That's how they move
around, my dear. You must take a look next time, it's most
interesting.   (Fawlty Towers)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20221028212331.6965E1C11B0%40moolenaar.net.


Re: FTP servers can't be reached

2022-10-27 Thread Bram Moolenaar


> Hello, the main FTP servers listed at https://www.vim.org/mirrors.php 
> appear to be unreachable at the moment.
> 
> Some of the mirrors seem OK but I didn't check them all.

The man ftp site is hosted by nluug.nl, do they show a status update?
Sometimes a disk breaks and it takes a little while to fix.

-- 
ARTHUR: Old woman!
DENNIS: Man!
ARTHUR: Man.  I'm sorry.  Old man, What knight live in that castle over there?
DENNIS: I'm thirty-seven.
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20221027220540.EE5BF1C0363%40moolenaar.net.


Re: Comment auto formatting joins non-comment lines

2022-10-18 Thread Bram Moolenaar


> I like the autoformatting of comments when I'm writing them, however it's 
> unusable because subsequent non-comment lines are always joined with the 
> comment block.
> 
> Use of fo+=w helps a little bit, but if I accidentally leave Insert mode 
> when there is a trailing space on the last line of my comment, it will join 
> it with the next line regardless of whether the next line is a comment or 
> not. This is really annoying and feels like incorrect behavior. It seems to 
> me that autoformatting should never change or join a non-comment line into 
> a comment line. 
> 
> For example, I might have code like the following:
> 
> // FooBar does things.
> func FooBar() {
> return
> }
> 
> If my formatoptions are 
> formatoptions=crqwn1ja
> 
> Then when I go to edit the comment, if I happen to leave a space at the end 
> accidentally, then it is autoformatted into this:
> 
> // FooBar does things. func FooBar() {
> return
> }
> 
> If w isn't set then the space doesn't matter and it will always get 
> formatted into that immediately.
> 
> Is this correct behavior? Is there a way to get vim to auto format comments 
> but never join a non-comment line? Or should I just resign and not use the 
> fo+=a option for code?

This looks like a bug, since you have the "c" flag, which together with
"a" should mean only comments are auto-formatted.

-- 
 Girls are like internet domain names,
the ones I like are already taken.
  Well, you can stil get one from a strange country :-P

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20221018121154.C74FD1C0EE2%40moolenaar.net.


Re: gVim in Windows opens external console for bang ex-commands

2022-10-15 Thread Bram Moolenaar


> Ex-commands like `:!dir` is spawning a console, upon which the external
> command is being executed and the result is being shown. Afterwards,
> both the external console _and_ gVim each presents a Press Enter prompt.
> 
> I haven't used gVim before. Not more than a cursory glance anyway. I was
> wondering if this is the intended behavior or if I have garbled
> something while building it.
> 
>   VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Oct 15 2022 15:20:35)
>   MS-Windows 64-bit GUI version
>   Included patches: 1-733
> 
>   Windows 11 version 21H2 (OS Build 22000.1098)

This is intended, because executing a console command only works
properly in a console window.  However, since the terminal window has
been added to Vim, you can add the "!" flag to 'guioptions' to execute
the command in a terminal window instead.  How well this works depends
on what command you execute.  

-- 
Lose weight, NEVER Diet again with
  The "Invisible Weight Loss Patch"
    (spam e-mail)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20221015104833.441B41C05ED%40moolenaar.net.


Re: Play sound on search wrap

2022-10-06 Thread Bram Moolenaar


> When performing a search, it's easy for me to miss the "search hit
> BOTTOM, continuing at TOP" message because my attention is focused on
> the matches. For this reason, I'd like a sound of my choice to be played
> when the search wraps (using +sound). Is this possible?

No, don't see a way.

-- 
DINGO:   You must spank her well and after you have spanked her you
 may deal with her as you like and then ... spank me.
AMAZING: And spank me!
STUNNER: And me.
LOVELY:  And me.
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20221006202502.28F691C0C31%40moolenaar.net.


Re: How to use patches sent to vim_dev?

2022-10-04 Thread Bram Moolenaar


> Bram sends patches in vim_dev ML. But it's not structured to directly
> use with `git am`, is it? If that's correct, what's the reason for
> using a different patch format?
> 
> P.S. I am not gonna use the patch email. But my email client, Claws,
> highlights the patch. In vim patch's case, it can't. That's why I
> noticed the difference.

I send the patches to the maillist so that it's very easy to have a look
at them.  You could get the diff in other ways if you know what tools to
use and what magic arguments to use, but that involves just enough work
that close to nobody will actually have a look.

You can apply all the patches in sequence using "patch" and you should
get the right code from that.  But it's a lot easier using git and just
fetch the latest from github.

The patch format is one that includes all the information, also about
deleted files and special character handling.  Git diffs normally don't
include that, you have to carefully specify what kind of diff it should
create (probably called a patch).

-- 
hundred-and-one symptoms of being an internet addict:
271. You collect hilarious signatures from all 250 mailing lists you
     are subscribed to.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20221004125157.27AB91C09A3%40moolenaar.net.


Re: [PATCH] fix: powershell :! filter commands

2022-10-01 Thread Bram Moolenaar


[cc'ing vim-dev]

Enan Ajmain wrote:

> Problem: filtered bang commands with powershell as `:set shell` doesn't
> work. The command structure followed in `make_filter_cmd` is wrong. Try
> `:%!sort` on any file to reproduce the bug.
> 
> Solution: Fix the command for the powershell in `make_filter_cmd`.
> 
> This is not a proper patch. It comes originally from my neovim PR. I
> just wanted to see if it would work in vim. It does.
> 
> I'm not sending it to vim-...@googlegroups.com because it's not a proper
> patch: I haven't added any tests; haven't changed the docs or the
> default config sources. I'm hoping someone in the dev team, who at least
> sometimes works with a Windows machine, will take it up and police it.
> 
> Here are the configurations for `:set shell=pwsh` this patch worked on:
> 
> let  = "-Command"
> let  = "2>&1 | Out-File -Encoding default %s; exit 
> $LastExitCode"
> let  = "2>&1 | Out-File -Encoding default %s; exit 
> $LastExitCode"
> let  = ""
> let  = "\""

Thanks for looking into this.

Would be good if this can be turned into a PR.  Hopefully with a test.
Can you do that, or would this need to be done by someone else?
Then it's easier for others to comment and suggest improvements.

-- 
hundred-and-one symptoms of being an internet addict:
240. You think Webster's Dictionary is a directory of WEB sites.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20221001144740.0FF911C065C%40moolenaar.net.


Re: Fwd: Compiling vim 9.0 with gui

2022-09-21 Thread Bram Moolenaar


> I have been trying to compile vim 9.0 with GUI enabled in CentOS 8. I have
> all the gtk-devel packages installed, and I am able to compile other gtk
> apps, but the vim build gives me a vim without GUI. I have tried configure
> --enable-gui=gtk but it doesn't help.
> 
> I do not remember any problem with previous versions.

After running configure, look in src/auto/config.log.
Search for "GTK".  It should tell you what is missing.

-- 
Support your right to bare arms!  Wear short sleeves!

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220921102252.0935C1C09F1%40moolenaar.net.


Re: Gvim message on XDG textedit URL link

2022-09-07 Thread Bram Moolenaar


> On Mi, 07 Sep 2022, Andrew Bernard wrote:
> 
> > Sorry, this is all too hard it would seem. To explain in it in detail you
> > would have to read how to use point and click with PDFs made by Lilypond.
> > 
> > The program gvim is producing unwanted messages when invoked with a remote
> > call and produces a needless pres ENTER, when all one wants is for the
> > remote call to go to the line and column.
> > 
> > If there is any interest still, here is an example call:
> > 
> > gvim --remote "+3:norm4" test.ly
> > 
> > Apologies if I left this out. I thought people would be familiar with
> > textedit URLs and how to use them. I suppose that sort of call is not
> > obvious after all.
> 
> Ah, so this comes from the --remote call. 

That was the missing info.  This leads to the remote server feature,
which builds a sequence of commands and sends it to the server.

For me it already helps to set 'cmdheight' to 2 or more.

> Interesting, that the :norm4 works, because there is no pipe after it. 
> But it looks like Vim builds up the whole string dynamically and adds an 
> '|' at the end automatically.
> 
> However, I think this silently breaks, because the ":norm" sees 
> everything after it as belonging to it, so in this case the '|' does not 
> really end the user specified command and therefore you see this 
> message. I messed around briefly, trying to wrap everything into an :exe 
> expression (or using :call cursor), but at least, this did not seem to 
> work on my windows environment.
> 
> A possible work-around would be to it build the whole command yourself 
> by using, e.g. --remote-send ":e +3|norm4| .bashrc"
> 
> or:
> 
> --remote-send ":e .bashrc|:e|norm4|"
> 
> I wonder if this would work better with the following patch, by wrapping 
> everything into an :exe call.
> 
> diff --git a/src/clientserver.c b/src/clientserver.c
> index bb2108d7d..c4489c953 100644
> --- a/src/clientserver.c
> +++ b/src/clientserver.c
> @@ -654,8 +654,9 @@ build_drop_cmd(
> // Can't use  after "inicmd", because a "startinsert" would cause
> // the following commands to be inserted as text.  Use a "|",
> // hopefully "inicmd" does allow this...
> +   ga_concat(, (char_u *)":exe \"");
> ga_concat(, inicmd);
> -   ga_concat(, (char_u *)"|");
> +   ga_concat(, (char_u *)"\"|");
>  }
>  // Bring the window to the foreground, goto Insert mode when 'im' set and
>  // clear command line.

The main problem is that on the server this is received as a command and
put in the input buffer, after which it is executed almost as typed.

Instead of building the command on the client, which can end up being a
bit long, we could send the minimal information to the server and
expand it into the right commands there.  We already have
runtime/plugin/rrhelper.vim.

-- 
Shift happens.
-- Doppler

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220907120332.616D71C0CE4%40moolenaar.net.


Re: [vim9script] Behavior of has_key()

2022-08-17 Thread Bram Moolenaar


> The help entry for has_key() says that the key must be a string. In
> legacy Vim script, however, this works fine:
> 
> let dd = {42: '42', v:true:  'T', 3.14: '3.14'}
> echo dd->has_key(42)
> echo dd->has_key(v:true)
> echo dd->has_key(3.14)
> 
> In Vim 9 script, the behavior is different:
> 
> vim9script
> const dd = {42: '42', true:  'T', [3.14]: '3.14'}
> echo dd->has_key(42) # OK
> echo dd->has_key(v:true) # Error, must be string(v:true)
> echo dd->has_key(3.14)   # Error, must be string(3.14)
> 
> This seems a bit inconsistent to me. I don't have a problem with Vim
> 9 script being different from legacy script, but I think that either all
> the three cases should raise an error, or none of them.
> 
> Besides, the documentation does not make it clear that implicit type
> casting may happen.

I'll add a note to the help.

In Vim9 script there is no automatic conversion to string, but an
exception is made for a number.  I don't recall the discussion, but I
think this was because it is rather common.  Perhaps not totally
consistent, but I don't want to change it now, it would cause obscure
problems.

-- 
A poem:read aloud:

<> !*''#   Waka waka bang splat tick tick hash,
^"`$$- Caret quote back-tick dollar dollar dash,
!*=@$_ Bang splat equal at dollar under-score,
%*<> ~#4   Percent splat waka waka tilde number four,
&[]../ Ampersand bracket bracket dot dot slash,
|{,,SYSTEM HALTED  Vertical-bar curly-bracket comma comma CRASH.

Fred Bremmer and Steve Kroese (Calvin College & Seminary of Grand Rapids, MI.)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220817123218.7A0F71C0B04%40moolenaar.net.


List of Vim features to vote on

2022-08-15 Thread Bram Moolenaar


Hello Vim users!

The list of features has not been changed for quite a while, but there
are several outdated items and new items have been asked for.

The main reason to not update the list often is that users who have cast
their votes will have to update them.  We don't want to cause that too
frequently.

The list is also quite long.  I have removed a few items that are
outdated and items with very few votes that are hardly relevant.

You can adjust your votes here, if you are a sponsor:
https://www.vim.org/sponsor/vote.php
The voting results are here: https://www.vim.org/sponsor/vote_results.php

Items that have been added now:
- "add multiple cursors, edit text in more than one place at the same time"
- "add scrolling per screen line, first line can start halfway"
- "reduce flicker by avoiding to clear the screen"

Edited items:
- "improve syntax highlighting speed"
  changed to: "improve syntax highlighting speed by adding a parser"
- "add IDE features (debugger integration, shell window)"
  changed to: "improve IDE features (terminal debugger)"
- "add diff/merge capability for CVS, like in emacs"
  changed to: "add diff/merge capability for git, mercurial et al."
- "improve the performance of Vim scripts (pre-compile them)"
  changed to: "improve the performance of Vim script"
- "improve searching in the on-line help, add more tags"
  changed to: "improve searching in the builtin help, add more tags"
- "improve the on-line help reference manual"
  changed to: "improve the builtin help reference manual"
- "improve the on-line help user manual"
  changed to: "improve the builtin help user manual"
- "translate the on-line help to German, French, Spanish, etc."
  changed to: "translate the builtin help to German, French, Spanish,
  etc."
- "improve the remote server functionality"
  changed to: "improve the client-server functionality"
- "add option not to move the cursor when using a scrollbar"
  changed to: "add option not to move the cursor when scrolling the
  window"

Items that have been removed, either because they have already been done
or they will never happen:
- "improve the support for X Window with the Athena toolkit"
- "add an "open" mode, like the original Vi"
- "add editing of a hidden buffer (useful in scripts only)"
- "improve the support for MacOS 9 and earlier"
- "make Vim available as a .net object"
- "add better support for editing files in projects (with ID utils)"
- "create a vim-script maillist, for announcements about new and updated
  scripts"
- "add autocommand events for Insert mode, before/after inserting a
  character"
- "add vertical mode for operators (e.g., delete word in five lines)"
- "add flexible tab stops, can be used for tables"

Happy voting!


-- 
GUARD #1:  What, ridden on a horse?
ARTHUR:Yes!
GUARD #1:  You're using coconuts!
ARTHUR:What?
GUARD #1:  You've got two empty halves of coconut and you're bangin' 'em
   together.
  The Quest for the Holy Grail (Monty Python)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220815130009.299671C1094%40moolenaar.net.


Re: Build Vim without +vim9script

2022-08-11 Thread Bram Moolenaar


> Is it possible to build Vim without support for Vim 9 script?
> 
> I would like to build Vim without +vim9script for testing purposes.
> I have tried to pass --disable-vim9script to ./configure, but it does
> not recognize the option. And I can't find anything related to Vim
> 9 script in feature.h.

Simple answer: no.

-- 
You cannot propel yourself forward by patting yourself on the back.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220811191130.8302B1C4F14%40moolenaar.net.


Re: New version of vim unsolicitedly sourcing defaults.vim?

2022-08-10 Thread Bram Moolenaar


Tim Chase wrote:

> On Tue, Aug 09, 2022 at 10:06:37PM +0100, Bram Moolenaar wrote:
> > Vim does not include a system-wide vimrc file that would go in
> > /usr/local/etc/vim.  Does this file source defaults.vim?
> 
> Yes, this file sources defaults.vim
> 
> I was unsure of its provenance, but with your confirmation that
> it's not part of vim-proper's installation, it looks like a FreeBSD
> thing:
> 
> >  Then that's a problem of FreeBSD.
> 
> Yep, as Yegappan found, this bug is tracking the issue at hand:
> 
>   https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=251420
> 
> I've got a FreeBSD Bugzilla account and will follow up there.

It should be made clear to them that the basic idea behind defaults.vim
is to set nicer defaults for new users.  Existing users, who have a
~/.vimrc with their preferences, should not get defaults.vim
automatically.

Since /usr/local/etc/vi/vimrc appears to intend to set some system-wide
preferences, which might be overruled by defaults.vim if the user
doesn't have a .vimrc file, they have been struggling with this.  They
probably want to disable loading defaults.vim and set their own
preferences.  Bad luck for new users, they will have to figure out their
own settings.  And they will keep discussing forever what the defaults
for everybody on the system should be.

An alternative would be to check if ~/.vimrc exists, and only load
defaults.vim then.  Then it's closer to what Vim normally does (but then
the overrides may still confuse the user).

-- 
   He was not in the least bit scared to be mashed into a pulp
   Or to have his eyes gouged out and his elbows broken;
   To have his kneecaps split and his body burned away
   And his limbs all hacked and mangled, brave Sir Robin.
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220810100755.62D6F1C0EC3%40moolenaar.net.


Re: New version of vim unsolicitedly sourcing defaults.vim?

2022-08-09 Thread Bram Moolenaar


Tim Chase wrote:

> I upgraded packages on my FreeBSD box yesterday and noticed that
> vimrc behavior had changed.
> 
> Prior to the upgrade, if I had a ~/.vimrc it wouldn't source the
> defaults.vim file.
> 
> :help VIMINIT
> 
> >  The first that exists is used, the others are ignored.
> 
> and it proceeds to list .vimrc (which I have) and, later down,
> defaults.vim (which should be ignored because I have a .vimrc)
> 
> However, 'scrolloff' and 'mouse' are now annoyingly getting set
> (along with other defaults.vim tweaks):
> 
>   :verbose set scrolloff? mouse?
> mouse=nvi
>   Last set from /usr/local/share/vim/vim90/defaults.vim line 85
> scrolloff=5
>   Last set from /usr/local/share/vim/vim90/defaults.vim line 51
> 
> According to tracing startup:
> 
>   :scriptnames
>   1: /usr/local/etc/vim/vimrc
>   2: /usr/local/share/vim/vim90/defaults.vim
>   3: /usr/local/share/vim/vim90/filetype.vim
>   4: /usr/local/share/vim/vim90/ftplugin.vim
>   5: /usr/local/share/vim/vim90/indent.vim
>   6: /usr/local/share/vim/vim90/syntax/syntax.vim
>   7: /usr/local/share/vim/vim90/syntax/synload.vim
>   8: /usr/local/share/vim/vim90/syntax/syncolor.vim
>   9: /usr/local/share/vim/vim90/colors/lists/default.vim
>  10: /usr/local/share/vim/vim90/syntax/nosyntax.vim
>  11: ~/.vimrc
>  [snip]
> 
> it's the /usr/local/etc/vim/vimrc causing the issue.
> 
> Is this a FreeBSD package customization problem (and I should go
> grumble to the FreeBSD package maintainer(s)), or did the default
> system vimrc start ignoring the description in `:help VIMINIT`, and
> force defaults.vim on those of us who detest it (in which case,
> please revert this)?

Vim does not include a system-wide vimrc file that would go in
/usr/local/etc/vim.  Does this file source defaults.vim?  Then that's a
problem of FreeBSD.

-- 
Microsoft: "Windows NT 4.0 now has the same user-interface as Windows 95"
Windows 95: "Press CTRL-ALT-DEL to reboot"
Windows NT 4.0: "Press CTRL-ALT-DEL to login"

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220809210637.B29A01C05A0%40moolenaar.net.


Re: Setting termcap entries: avoid literal Esc?

2022-08-08 Thread Bram Moolenaar


> In my vimrc I have entries such as these:
> 
> set =^[f
> set =^[h
> 
> where ^[ is a literal Esc. Is it possible to perform such assignments
> without using a literal Esc? For other entries I am able to use the
> & form (say, _BE = "\033[?2004h"). I am asking specifically about
> entries like the above, which either don't have a corresponding option
> in Vim AFAIK () or which have an option with special characters
> (t_%i).
> 
> I am using Vim 9 script, if that matters.

Something like this doesn't work for options with a <> name:

& = "\f"

But this does:

exe "set =\f"


-- 
GALAHAD:   Camelot ...
LAUNCELOT: Camelot ...
GAWAIN:It's only a model.
     "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220808130628.C2A2C1C0EC3%40moolenaar.net.


Re: popup window filter, what is <80>` ?

2022-08-07 Thread Bram Moolenaar


Maxim Kim wrote:

> Hi, currently there is no built-in way to have a prompt in a popup window 
> so am trying to fake it with filtering.
> 
> While in the early stages, I found out that the filter func constantly gets 
> <80>` value.
> 
> What is this?
> How can I properly filter it out?
> 
> With the following code:
> 
> vim9script
> 
> export def TestPopup(contents: string)
> var prompt = ""
> var main_id = popup_create(contents, {
> pos: 'center',
> mapping: 0,
> filter: (id, key) => {
> if key == "\"
> popup_close(id, -1)
> else
> prompt ..= key
> endif
> return true
> },
> callback: (id, result) => {
> echom prompt
> }
> })
> enddef
> 
> TestPopup('hello')
> 
> If you wait a 3-4 seconds and close popup with ESC, you will see <80>`:
> [image: viim-filter.gif]

Don't see it in the GIF.

here probably is a third byte that you don't see.  0x80 0xfd is a
prefix for a special key.  There is a list in src/keymap.h, "enum
key_extra".

-- 
hundred-and-one symptoms of being an internet addict:
269. You receive an e-mail from the wife of a deceased president, offering
 to send you twenty million dollar, and you are not even surprised.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220807145320.BF5751C0EC3%40moolenaar.net.


Re: Import vim9 script as that and map that.func fails

2022-08-03 Thread Bram Moolenaar


> Would import vim9 script as that. It seems to work when I directly call 
> that.foobar.
> 
> But how to map the same call in a nnoremapping ?
> Thank you
> NV
> 
> 
> # Imported Functions {{{
> import './vimfiles/autoload/nvhelper.vim' as that
> nnoremap n n:call that.HLNext(80)
> nnoremap N N:call that.HLNext(80)

Use ":help import-legacy" and then go up a few lines.

-- 
The term "free software" is defined by Richard M. Stallman as
being software that isn't necessarily for free.  Confusing?
Let's call it "Stallman software" then!
-- Bram Moolenaar

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220803095134.83D441C096B%40moolenaar.net.


Re: Control keys not working

2022-07-30 Thread Bram Moolenaar


Salman Halim wrote:

> I'm using 32-bit GVim on Windows 10, 9.0 with patches 1-107, though I
> noticed this with just patches 1-27, also: when I hit control keys in
> insert mode, it just inserts the key as if control hadn't been pressed.
> 
> Simple example: 0, which is supposed to delete all indent from the
> line. I just get a '0D' onscreen.
> 
> I can accept that this might be caused by a plugin, but it wasn't happening
> in the 8.2 days, so thought I would mention it in case someone else had
> seen it, also.

There have been problems with specific keyboards.  What keyboard layout
are you using?

-- 
hundred-and-one symptoms of being an internet addict:
193. You ask your girlfriend to drive home so you can sit back with
 your PDA and download the information to your laptop

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220730094057.BEDDB1C0C34%40moolenaar.net.


Re: Highlight character under cursor in visual mode

2022-07-25 Thread Bram Moolenaar


> Why doesn't vim apply the Visual highlight to the character *at* the 
> cursor position in visual mode? Block cursors are nice and all, but 
> sometimes you're at a tty where you have an underline, and the lack of 
> highlighting is confusing.
> 
> Is there a way to get vim to include the character under the cursor for 
> visual highlighting?

Short answer: no.

Background: Various terminals behave differently about how the cursor is
displayed.  Also the cursor shape may depend on whether the terminal is
in focus or not.  To avoid that the cursor disappears (which is a big
problem) the Visual highlighting is not applied to the character under
the cursor.  That may look a little bit strange (small problem) but
you'll get used to it.

-- 
hundred-and-one symptoms of being an internet addict:
113. You are asked about a bus schedule, you wonder if it is 16 or 32 bits.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220725093325.A71541C066C%40moolenaar.net.


Re: vim9 _vimrc compatibility with vim8 plugin

2022-07-22 Thread Bram Moolenaar


> It's like when setting a global variable from _vim9rc, it *affects
> vim8 *script same global variable.

In Vim9 script variables are script-local by default, prefixing g: is
required to access global variables.

In legacy script variables are global by default, prefixing s: is
required to access script-local variables.


-- 
hundred-and-one symptoms of being an internet addict:
94. Now admit it... How many of you have made "modem noises" into
the phone just to see if it was possible? :-)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220722195446.D13B31C0550%40moolenaar.net.


Re: How to set mapleader in vim9 script

2022-07-22 Thread Bram Moolenaar


> Encountering error when I set either *let mapleader =','* or *mapleader = 
> ','* inside a vim9 script, how in vim9 script we can set mapleader ?
> 
> Help seems not to detail changes against vim9 script evol.

g:mapleader = ','

I'll update the help to also mention the Vim9 syntax.

-- 
>From "know your smileys":
 C=}>;*{)) Drunk, devilish chef with a toupee in an updraft,
   a mustache, and a double chin

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220722110549.BCDBD1C08FD%40moolenaar.net.


Re: Vim 9.0 generates 8.2 file

2022-07-18 Thread Bram Moolenaar


> On Windows 10 I downloaded latest Vim build 9.0.0055.
> I deleted file C:\Users\\.viminfo
> I opened vim do some changes in one of my files and closed down Vim.
> I opened C:\Users\\.viminfo and in the first line there is still 
> info:
> *# This viminfo file was generated by Vim 8.2.*
> 
> It is not a big deal, but I somehow expect to get *9.0* in comment.

Please check you actually execute the right Vim program.  You may have
several in your search path.  Use ":version" to check.  For me the
.viminfo file definitely says 9.0.

-- 
I AM THANKFUL...
...for the taxes that I pay because it means that I am employed.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220718165129.EE0311C08FD%40moolenaar.net.


Re: how to redirect pipe output to vim in case remote?

2022-07-07 Thread Bram Moolenaar


> Is it the same even if it is from a terminal run inside vim?

That is a separate terminal, running its own shell. That stdin is owned
by the shell, thus it doesn't make a difference.

-- 
hundred-and-one symptoms of being an internet addict:
79. All of your most erotic dreams have a scrollbar at the right side.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220707212129.973FE1C08DA%40moolenaar.net.


Re: how to redirect pipe output to vim in case remote?

2022-07-07 Thread Bram Moolenaar


> The following command works
> *ls | gvim - *
> 
> But
> *ls | gvim --servername GVIM1 --remote-tab - *
> 
> does not?
> 
> shouldnt it be similar in operation?

That doesn't work because the remote gvim does not have access to this
stdin.  You will have to save the text into a file first, then you can
tell the remote gvim to open that file.

-- 
hundred-and-one symptoms of being an internet addict:
76. Your ISP regards you as a business partner rather than as a customer.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220707184300.E80FD1C04CD%40moolenaar.net.


Re: How to limit amount of memory used by vim?

2022-07-06 Thread Bram Moolenaar


> using Vim 7.4 on Linux server I have opened large log file and I tried to 
> perform some log formatting using ":%s" command.
> 
> It looks like Vim froze (probably it didn't, it just worked hard), but like 
> after a minute Linux server got out of memory and Linux start killing the 
> biggest memory consumption processes including one very important server. 
> >From Linux logs I see vim consumed 50 GB of memory, that is what triggered 
> Linux to get out of memory.
> 
> Just wondering is there a way to set in Vim, how much memory is Vim allowed 
> to use? If Vim exceeds that amount the last action performing is just 
> canceled with error.

With a ":%s" command all lines are saved in memory for undo.  Vim may
at some point fail to allocate memory and then stop with an error
message.  However, because of the way Linux manages memory it will
happily give more memory to Vim than it actually has.  There is a system
setting to change that behavior.  I recall a lively discussion between
Linux and BSD users about this stragety (BSD works just fine, Linux can
freeze).

In Vim you can disable undo:

setlocal ul=-1


-- 
"I don’t know how to make a screenshot" - Richard Stallman, July 2002
(when asked to send a screenshot of his desktop for unix.se)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220706100034.4A4481C1342%40moolenaar.net.


Vim 9.0 is released!

2022-06-28 Thread Bram Moolenaar
im.org/download.php

A list of mirror sites can be found here:
https://www.vim.org/mirrors.php


Files available for download (if you don't use GitHub or the installer):

UNIX:
sources + runtime files, bzip2 compressed:
https://ftp.nluug.nl/pub/vim/unix/vim-9.0.tar.bz2

VARIOUS:
help files converted to HTML:
https://ftp.nluug.nl/pub/vim/doc/vim90html.zip

MS-WINDOWS separate files:
Runtime files:
https://ftp.nluug.nl/pub/vim/pc/vim90rt.zip
GUI binary for Windows NT/2000/XP/7/8/10:
https://ftp.nluug.nl/pub/vim/pc/gvim90.zip
GUI binary with OLE support:
https://ftp.nluug.nl/pub/vim/pc/gvim90ole.zip
Console version for Windows NT/2000/XP/7/8/10:
https://ftp.nluug.nl/pub/vim/pc/vim90w32.zip
Sources for PC (with CR-LF):
https://ftp.nluug.nl/pub/vim/pc/vim90src.zip

For debugging:
https://ftp.nluug.nl/pub/vim/pc/gvim90.pdb
https://ftp.nluug.nl/pub/vim/pc/gvim90ole.pdb
https://ftp.nluug.nl/pub/vim/pc/vim90w32.pdb

AMIGA:
Only runtime and sources are provided, no binary:
https://ftp.nluug.nl/pub/vim/amiga/vim90rt.tgz
https://ftp.nluug.nl/pub/vim/amiga/vim90src.tgz


Omitted in this version are:
- The 16-bit DOS, OS/2 and Amiga versions, these are obsolete.
- The 32-bit console version for MS-DOS/Windows 95/98


Mailing lists et al.


A good place to get help from others is Stackexchange:
https://vi.stackexchange.com/

For user questions you can turn to the Vim mailing list.  There are a
lot of tips, scripts and solutions.  You can ask your Vim questions, but
only if you subscribe.  See https://www.vim.org/maillist.php#vim

If you want to help Vim development, discuss new features or get the
latest patches, subscribe to the vim-dev mailing list.  See
https://www.vim.org/maillist.php#vim-dev

Subject specific lists:
Macintosh issues:  https://www.vim.org/maillist.php#vim-mac

Before you ask a question you should search the archives, someone may
already have given the answer.


Reporting bugs
--

Create an issue at GitHub or, if you know the solution, create a pull
request: https://github.com/vim/vim

Alternatively send your problem to .

All the time spent on answering mail and digging into problems is
subtracted from the time that is spent on improving Vim!  Always give a
reproducible example and try to find out which settings or other things
influence the appearance of the bug.  Start Vim without your plugins:
"vim --clean".  Try different machines if possible.  See ":help bugs" in
Vim.  Ideally write a test that reproduces the problem and will pass
once it is fixed.


Happy Vimming!


-- 
Anyone who is capable of getting themselves made President should on no
account be allowed to do the job.
-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220628145517.515BB1C055A%40moolenaar.net.


Re: Vim 7.1 under MS-DOS

2022-06-27 Thread Bram Moolenaar


Michael Goodman wrote:

> I am using vim 7.1 16-bit under DOS and it runs and everything seems good, 
> however I can't seem to write to any files at all. I can write with the 
> 'edit' DOS command but not vim. Maybe someone knows what additional steps 
> need to be taken for this? Thank you

It is a surprise that it works at all.  I tried keeping a DOS version
alive for quite a while, but it kept running out of memory quickly.
Eventually I gave up (and then could add more features to the tiny
version with the restrictions removed).

What messages do you see when you do ":w file"?
What is the :version output, what version do you use exactly?

-- 
"How is your new girlfriend?"
"90-60-90 man!"
"What, pale purple?"

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220627104618.965F81C480B%40moolenaar.net.


Re: Update Runtime/doc/channel.txt -- why LSP section disappeae

2022-06-26 Thread Bram Moolenaar


> Don't understand why an entire section which told about LSP has disappeared 
> in runtime/doc/channel.txt line 1557 after this 
> update 
> https://github.com/vim/vim/commit/8a3b805c6c9cae341d560df9c3567ebbe42a7404 
> ? 

As the PR mentions, this section was a duplicate.  The same text is
found near the end of the file.

-- 
The goal of science is to build better mousetraps.
The goal of nature is to build better mice.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220626155405.776051C4808%40moolenaar.net.


Re: Ctrl+F or B broken since 8.2 patch 5157 in gui windows

2022-06-25 Thread Bram Moolenaar


> See title. 

What is your setup?  Do you use French perhaps?

-- 
I think that you'll agree that engineers are very effective in their social
interactions.  It's the "normal" people who are nuts.
(Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220625105332.71DDD1C0867%40moolenaar.net.


Re: Can syntax clusters contain other clusters?

2022-06-18 Thread Bram Moolenaar


> The subject line says it all: I'm trying to use syntax clusters and wonder
> if clusters may contain other clusters, i.e. should this work?
> 
> syn cluster mydslAnyValue contains=@mydslValue,@mydslContainer
> syn cluster mydslAllValues contains=@mydslAnyValue,mydslConstant

Yes, there is an example just above ":help E848".

-- 
BODY:I'm not dead!
CART DRIVER: 'Ere.  He says he's not dead.
LARGE MAN:   Yes he is.
BODY:I'm not!
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220618155027.4C3411C12E9%40moolenaar.net.


Re: Cursors

2022-06-16 Thread Bram Moolenaar


Dominique wrote:

> Bram Moolenaar  wrote:
> 
> > > Why cursor shape in terminal neovim can change but in vim not? Maybe
> > > something different in here.
> >
> > It very much depends on the terminal.  Neovim assumes a very recent
> > terminal, it won't work everywhere.  It may mess up on some terminals.
> >
> > What I use myself:
> >
> > " Change the cursor color and shape depending on the mode.
> > if  =~ "xterm" && $SSH_CLIENT == ''
> > let _SI = "\]12;purple\x7" . "\[5 q"
> > try
> > let _SR = "\]12;darkred\x7" . "\[3 q"
> > catch
> > endtry
> > let _EI = "\]12;royalblue2\x7" . "\[2 q"
> > endif
> 
> I use something along those lines too.
> But why the try/catch?  I don't have it and did not notice issues.
> Doing :help termcap-cursor-shape  also shows how to set colored
> cursor, but that help entry does not have the try / catch either.
> Perhaps it should be added there if it solves something.

If I remember correctly, I wrote this around the time that t_SR was
added.  Using an older Vim version would throw an error.  It's not
generally useful, unless you might use an old Vim version occasionally.

[Agree with no good terminal found for Mac, but I don't have one now]


-- 
The chat program is in public domain.  This is not the GNU public license.
If it breaks then you get to keep both pieces.
-- Copyright notice for the chat program

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220616092040.8FD8F1C2341%40moolenaar.net.


Re: TERM (was Cursors)

2022-06-15 Thread Bram Moolenaar


> On 6/15/22 2:44 PM, Bram Moolenaar wrote:
> > Yes, that is indeed a problem.  Lots of terminal emulators keep popping 
> > up, many with the same or similar base, and adding one more feature. 
> >  They don't bother distributing a correct termcap/terminfo entry and 
> > just use something like "xterm" for $TERM.
> 
> I wonder how much of that is by conscious choice vs ignorance.

It is a conscious choice.  Someone making a new terminal emulator wants
it to get popular quickly, doesn't care about doing things that make it
harder to have it adopted.  "If it works for 99% that is good enough".
And then spend years fixing that last percent (or just ignoring it).

> > I have been thinking of a way to just ignore termcap/terminfo and 
> > let the terminal tell us what it's features are.  Xterm does this 
> > partially, but there can be artifacts (e.g. when Vim exits very 
> > quickly).  I haven't found the right solution yet.
> 
> I'm curious.  Though that is probably even further off topic.

With xterm Vim will request the actual escape sequences used.  This
matters, because even when the $TERM value is correct and the
terminfo/termcap entry is found, there are runtime options that can
change the behavior.  "8 bit controls" can completely mess things up.

Problem is that between requesting the entry and receiving it there is a
delay, which can go to a few hundred msec for a remote terminal.  Then
the response may end up in the shell instead of with Vim.  It's not a
final solution.

> > It works well compared to other solutions (e.g. Putty).  If you can't 
> > get it to connect double check the settings.  It works for me (when 
> > I get the domain or IP address and port right).
> 
> I suspect that my problem is related to the super tight security 
> settings that $CORP_IT has put in place since the last time I tried to 
> use it.

It's possible the protocol to connect disallows using a password.
I don't know how to do something else, such as a key/challenge exchange.

-- 
(letter from Mark to Mike, about the film's probable certificate)
  For an 'A' we would have to: Lose as many shits as possible; Take Jesus
  Christ out, if possible; Loose "I fart in your general direction"; Lose
  "the oral sex"; Lose "oh, fuck off"; Lose "We make castanets out of your
  testicles"
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220615214743.7BD021C2341%40moolenaar.net.


Re: Cursors

2022-06-15 Thread Bram Moolenaar


[...]

I'm using this on MS-Windows, where things are quite different...

> I feel like the purpose of the TERM environment variable is slipping 
> into obscurity and people are setting it to something they've always 
> seen, e.g. xterm, and not realizing that it actually has a specific 
> meaning.  Instead they are defaulting and having to re-invent the wheel.

Yes, that is indeed a problem.  Lots of terminal emulators keep popping
up, many with the same or similar base, and adding one more feature.
They don't bother distributing a correct termcap/terminfo entry and just
use something like "xterm" for $TERM.

I have been thinking of a way to just ignore termcap/terminfo and let
the terminal tell us what it's features are.  Xterm does this partially,
but there can be artifacts (e.g. when Vim exits very quickly).  I
haven't found the right solution yet.

> > I actually haven't tried recently, they keep improving it.
> 
> ACK
> 
> I just tried the Secure Shell for the first time in a long time and I 
> can't get it to connect to anything.  :-/  I'm not upset b/c I found it 
> so inferior and frustrating.  That being said, I'm an Xterm power user 
> and expect more than the average person from my terminal emulator.

It works well compared to other solutions (e.g. Putty).  If you can't
get it to connect double check the settings.  It works for me (when I
get the domain or IP address and port right).

The problem I sometimes run into is that mouse events stop working
without a clue why.

-- 
The MS-Windows registry is no more hostile than any other bunch of state
information... that is held in a binary format... a format that nobody
understands... and is replicated and cached in a complex and largely
undocumented way... and contains large amounts of duplicate and obfuscated
information...  (Ben Peterson)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220615204416.D8FD01C06DC%40moolenaar.net.


Re: Cursors

2022-06-15 Thread Bram Moolenaar


> On 6/15/22 9:58 AM, Bram Moolenaar wrote:
> > if  =~ "xterm" && $SSH_CLIENT == ''
> 
> Why do you check to see that SSH_CLIENT is unset / empty?
> 
> Wouldn't that preclude SSHing from a shell running in Xterm?
> 
> I'm just curious.

The terminal that I use to run ssh does not support it.
I am using the Secure Shell extension for Chrome.
I actually haven't tried recently, they keep improving it.

-- 
ERIC IDLE PLAYED: THE DEAD COLLECTOR, MR BINT (A VILLAGE NE'ER-DO -WELL VERY
  KEEN ON BURNING WITCHES), SIR ROBIN, THE GUARD WHO DOESN'T
  HICOUGH BUT TRIES TO GET THINGS STRAIGHT, CONCORDE (SIR
  LAUNCELOT'S TRUSTY STEED), ROGER THE SHRUBBER (A SHRUBBER),
  BROTHER MAYNARD
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220615175510.AB6C01C06DC%40moolenaar.net.


  1   2   3   4   5   6   7   8   9   10   >