Saturday, June 1, 2024

Re: unexpected value from mode(1) command

On 05/26/2024 10:42 PM, M wrote:
> вс, 26 мая 2024 г., 19:25 Mike <mssr953@gmail.com>:
>
>> Hello.
>>
>> If, in normal mode, I type a colon followed by the command "echo
>> mode(1)", the value "n" is displayed in the command-line area indicating
>> normal mode. I would have expected something beginning with "c" which
>> would be consistent with what ":help cmdline-mode" states.
>>
>> Could someone explain why the observed behavior should have been expected?
>>
>> Thanks in advance for the education!
>>
>> --
>> --
>> 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+unsubscribe@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/vim_use/v2vnpp%24i0q%241%40ciao.gmane.io
>> .
>>
>
> Vim stays in Command-line mode as long as user _is editing_ the command
> line. After enter key has been pressed Vim gets back into the Normal mode,
> as explained at `:help mode-switching` topic.
>
> Kind regards,
>
>>
>
Thanks for the explanation and link, it certainly explains what I'm
seeing. It just seemed odd that an ex-command is being executed in
"normal" mode. But, now that I think about it, autocommands do invoke
ex-commands and we do expect them to be aware of the current buffer's
mode setting.

--
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/v3gfto%24qs4%241%40ciao.gmane.io.

No comments: