Skip to content
Permalink
Browse files

patch 8.1.1270: cannot see current match position

Problem:    Cannot see current match position.
Solution:   Show "3/44" when using the "n" command and "S" is not in
            'shortmess'. (Christian Brabandt, closes #4317)
  • Loading branch information...
brammool committed May 4, 2019
1 parent ed5ab2a commit 9dfa3139198b38b28673e251a3756430065914e9
Showing with 353 additions and 53 deletions.
  1. +5 −3 runtime/doc/options.txt
  2. +19 −0 runtime/doc/pattern.txt
  3. +2 −2 src/option.c
  4. +23 −21 src/option.h
  5. +192 −27 src/search.c
  6. +2 −0 src/testdir/Make_all.mak
  7. +108 −0 src/testdir/test_search_stat.vim
  8. +2 −0 src/version.c
@@ -1789,7 +1789,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'scrolloff' + 0 no scroll offset
'shelltemp' - {unchanged} {set vim default only on resetting 'cp'}
'shiftround' + off indent not rounded to shiftwidth
'shortmess' & "" no shortening of messages
'shortmess' & "S" no shortening of messages

This comment has been minimized.

Copy link
@chdiza

chdiza May 4, 2019

"no shortening of messages" doesn't seem to be a correct description of what "S" does, given the other hunks of this diff below.

This comment has been minimized.

Copy link
@chdiza

chdiza May 4, 2019

Never mind, I get it now.

'showcmd' & off command characters not shown
'showmode' & off current mode not shown
'sidescrolloff' + 0 cursor moves to edge of screen in scroll
@@ -6563,8 +6563,8 @@ A jump table for the options with a short description can be found at |Q_op|.
function to get the effective shiftwidth value.

*'shortmess'* *'shm'*
'shortmess' 'shm' string (Vim default "filnxtToO", Vi default: "",
POSIX default: "A")
'shortmess' 'shm' string (Vim default "filnxtToOS", Vi default: "S",
POSIX default: "AS")
global
This option helps to avoid all the |hit-enter| prompts caused by file
messages, for example with CTRL-G, and to avoid some other messages.
@@ -6604,6 +6604,8 @@ A jump table for the options with a short description can be found at |Q_op|.
q use "recording" instead of "recording @a"
F don't give the file info when editing a file, like `:silent`
was used for the command
S do not show search count message when searching, e.g.
"[1/5]"

This gives you the opportunity to avoid that a change between buffers
requires you to hit <Enter>, but still gives as useful a message as
@@ -152,6 +152,17 @@ use <Esc> to abandon the search.
All matches for the last used search pattern will be highlighted if you set
the 'hlsearch' option. This can be suspended with the |:nohlsearch| command.

When 'shortmess' does not include the "S" flag, Vim will automatically show an
index, on which the cursor is. This can look like this: >

[1/5] Cursor is on first of 5 matches.
[1/>99] Cursor is on first of more than 99 matches.
[>99/>99] Cursor is after 99 match of more than 99 matches.
[?/??] Unknown how many matches exists, generating the
statistics was aborted because of search timeout.

Note: the count does not take offset into account.

When no match is found you get the error: *E486* Pattern not found
Note that for the |:global| command this behaves like a normal message, for Vi
compatibility. For the |:s| command the "e" flag can be used to avoid the
@@ -299,6 +310,14 @@ when executing a pattern takes a long time and when checking for messages on
channels a callback is invoked that also uses a pattern or an autocommand is
triggered. In most cases this should be fine, but if a pattern is in use when
it's used again it fails. Usually this means there is something wrong with
the pattern.

*E956*
In very rare cases a regular expression is used recursively. This can happen
when executing a pattern takes a long time and when checking for messages on
channels a callback is invoked that also uses a pattern or an autocommand is
triggered. In most cases this should be fine, but if a pattern is in use when
it's used again it fails. Usually this means there is something wrong with
the pattern.

==============================================================================
@@ -2449,7 +2449,7 @@ static struct vimoption options[] =
{(char_u *)8L, (char_u *)0L} SCTX_INIT},
{"shortmess", "shm", P_STRING|P_VIM|P_FLAGLIST,
(char_u *)&p_shm, PV_NONE,
{(char_u *)"", (char_u *)"filnxtToO"}
{(char_u *)"S", (char_u *)"filnxtToOS"}
SCTX_INIT},
{"shortname", "sn", P_BOOL|P_VI_DEF,
(char_u *)&p_sn, PV_SN,
@@ -3311,7 +3311,7 @@ set_init_1(int clean_arg)
if (mch_getenv((char_u *)"VIM_POSIX") != NULL)
{
set_string_default("cpo", (char_u *)CPO_ALL);
set_string_default("shm", (char_u *)"A");
set_string_default("shm", (char_u *)SHM_POSIX);
}

/*
@@ -183,27 +183,29 @@
#define COCU_ALL "nvic" /* flags for 'concealcursor' */

/* characters for p_shm option: */
#define SHM_RO 'r' /* readonly */
#define SHM_MOD 'm' /* modified */
#define SHM_FILE 'f' /* (file 1 of 2) */
#define SHM_LAST 'i' /* last line incomplete */
#define SHM_TEXT 'x' /* tx instead of textmode */
#define SHM_LINES 'l' /* "L" instead of "lines" */
#define SHM_NEW 'n' /* "[New]" instead of "[New file]" */
#define SHM_WRI 'w' /* "[w]" instead of "written" */
#define SHM_A "rmfixlnw" /* represented by 'a' flag */
#define SHM_WRITE 'W' /* don't use "written" at all */
#define SHM_TRUNC 't' /* truncate file messages */
#define SHM_TRUNCALL 'T' /* truncate all messages */
#define SHM_OVER 'o' /* overwrite file messages */
#define SHM_OVERALL 'O' /* overwrite more messages */
#define SHM_SEARCH 's' /* no search hit bottom messages */
#define SHM_ATTENTION 'A' /* no ATTENTION messages */
#define SHM_INTRO 'I' /* intro messages */
#define SHM_COMPLETIONMENU 'c' /* completion menu messages */
#define SHM_RECORDING 'q' /* short recording message */
#define SHM_FILEINFO 'F' /* no file info messages */
#define SHM_ALL "rmfixlnwaWtToOsAIcqF" /* all possible flags for 'shm' */
#define SHM_RO 'r' // readonly
#define SHM_MOD 'm' // modified
#define SHM_FILE 'f' // (file 1 of 2)
#define SHM_LAST 'i' // last line incomplete
#define SHM_TEXT 'x' // tx instead of textmode
#define SHM_LINES 'l' // "L" instead of "lines"
#define SHM_NEW 'n' // "[New]" instead of "[New file]"
#define SHM_WRI 'w' // "[w]" instead of "written"
#define SHM_A "rmfixlnw" // represented by 'a' flag
#define SHM_WRITE 'W' // don't use "written" at all
#define SHM_TRUNC 't' // truncate file messages
#define SHM_TRUNCALL 'T' // truncate all messages
#define SHM_OVER 'o' // overwrite file messages
#define SHM_OVERALL 'O' // overwrite more messages
#define SHM_SEARCH 's' // no search hit bottom messages
#define SHM_ATTENTION 'A' // no ATTENTION messages
#define SHM_INTRO 'I' // intro messages
#define SHM_COMPLETIONMENU 'c' // completion menu messages
#define SHM_RECORDING 'q' // short recording message
#define SHM_FILEINFO 'F' // no file info messages
#define SHM_SEARCHCOUNT 'S' // search stats: '[1/10]'
#define SHM_POSIX "AS" // POSIX value
#define SHM_ALL "rmfixlnwaWtToOsAIcqFS" // all possible flags for 'shm'

/* characters for p_go: */
#define GO_TERMINAL '!' /* use terminal for system commands */

0 comments on commit 9dfa313

Please sign in to comment.
You can’t perform that action at this time.