On So, 28 Sep 2014, Christian Brabandt wrote:
> Hi Mikhail!
>
> On Sa, 27 Sep 2014, Mikhail V wrote:
>
> > Hallo Christian,
> > thanks for reply. So I wrote in first paragraph about not being able to
> > attach screenshots. I have placed them now on my student homepage , so you
> > can check out.
> > http://public.beuth-hochschule.de/~s53452/index.htm
> >
> > So yes there are few workarounds and I don't say its really that great
> > global mankind problem, but it starts to be annoying after long hours of
> > work and tacking the lines visually. I didn't know about the dummy column
> > trick, I'll check it out. And dummmy window? Wouldn't it cause windows
> > switching incosistence or switching to it at mouseclicks? But sounds
> > interesting though.
>
> I see, you want that the normal text starts 1 additional column after
> the line numbering. I don't think this is possible (not even with the
> workarounds mentioned so far). Sorry.
Here is a simple patch, that adds the 'numbershift' option by which you
can specify how much to shift the main text right of the number column
(only works when either 'number' or 'relativenumber' is set).
Best,
Christian
--
Die Kritik an anderen hat noch keinem die eigene Leistung erspart.
-- Noël Coward
--
--
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -5231,6 +5231,13 @@ A jump table for the options with a shor
|nobody | 3 nobody | 0 nobody |3 nobody
|there | 4 there | 1 there | 1 there
+ 'numbershift' 'nus'
+'numbershift' 'nus' number (default: 0)
+ {not in Vi}
+ Additional amount of space that will be inserted after the number
+ columns has been drawn. Will make the text shift by that many
+ chars.
+
*'numberwidth'* *'nuw'*
'numberwidth' 'nuw' number (Vim default: 4 Vi default: 8)
local to window
diff --git a/src/misc1.c b/src/misc1.c
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -504,7 +504,7 @@ get_breakindent_win(wp, line)
const int eff_wwidth = W_WIDTH(wp)
- ((wp->w_p_nu || wp->w_p_rnu)
&& (vim_strchr(p_cpo, CPO_NUMCOL) == NULL)
- ? number_width(wp) + 1 : 0);
+ ? number_width(wp) + 1 + p_nus : 0);
/* used cached indent, unless pointer or 'tabstop' changed */
if (prev_line != line || prev_ts != wp->w_buffer->b_p_ts
diff --git a/src/move.c b/src/move.c
--- a/src/move.c
+++ b/src/move.c
@@ -912,7 +912,7 @@ validate_cursor_col()
win_col_off(wp)
win_T *wp;
{
- return (((wp->w_p_nu || wp->w_p_rnu) ? number_width(wp) + 1 : 0)
+ return (((wp->w_p_nu || wp->w_p_rnu) ? number_width(wp) + 1 + p_nus : 0)
#ifdef FEAT_CMDWIN
+ (cmdwin_type == 0 || wp != curwin ? 0 : 1)
#endif
@@ -946,7 +946,7 @@ win_col_off2(wp)
win_T *wp;
{
if ((wp->w_p_nu || wp->w_p_rnu) && vim_strchr(p_cpo, CPO_NUMCOL) != NULL)
- return number_width(wp) + 1;
+ return number_width(wp) + 1 + p_nus;
return 0;
}
diff --git a/src/option.c b/src/option.c
--- a/src/option.c
+++ b/src/option.c
@@ -1918,6 +1918,9 @@ static struct vimoption
{"number", "nu", P_BOOL|P_VI_DEF|P_RWIN,
(char_u *)VAR_WIN, PV_NU,
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
+ {"numbershift", "nus", P_NUM|P_VIM|P_RWIN,
+ (char_u *)&p_nus, PV_NONE,
+ {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
{"numberwidth", "nuw", P_NUM|P_RWIN|P_VIM,
#ifdef FEAT_LINEBREAK
(char_u *)VAR_WIN, PV_NUW,
diff --git a/src/option.h b/src/option.h
--- a/src/option.h
+++ b/src/option.h
@@ -635,6 +635,7 @@ EXTERN int p_more; /* 'more' */
#ifdef FEAT_MZSCHEME
EXTERN long p_mzq; /* 'mzquantum */
#endif
+EXTERN long p_nus; /* 'numbershift' */
#if defined(MSDOS) || defined(MSWIN) || defined(OS2)
EXTERN int p_odev; /* 'opendevice' */
#endif
diff --git a/src/screen.c b/src/screen.c
--- a/src/screen.c
+++ b/src/screen.c
@@ -1097,7 +1097,7 @@ win_update(wp)
#ifdef FEAT_LINEBREAK
/* Force redraw when width of 'number' or 'relativenumber' column
* changes. */
- i = (wp->w_p_nu || wp->w_p_rnu) ? number_width(wp) : 0;
+ i = (wp->w_p_nu || wp->w_p_rnu) ? number_width(wp) + p_nus : 0;
if (wp->w_nrwidth != i)
{
type = NOT_VALID;
@@ -2490,7 +2490,7 @@ fold_line(wp, fold_count, foldinfo, lnum
else
#endif
copy_text_attr(off + col, buf, len, hl_attr(HLF_FL));
- col += len;
+ col += len + p_nus;
}
}
@@ -2965,10 +2965,11 @@ win_line(wp, lnum, startrow, endrow, noc
# define WL_SIGN WL_FOLD /* column for signs */
#endif
#define WL_NR WL_SIGN + 1 /* line number */
+#define WL_NR_SKIP WL_NR + 1
#ifdef FEAT_LINEBREAK
-# define WL_BRI WL_NR + 1 /* 'breakindent' */
+# define WL_BRI WL_NR_SKIP + 1 /* 'breakindent' */
#else
-# define WL_BRI WL_NR
+# define WL_BRI WL_NR_SKIP
#endif
#if defined(FEAT_LINEBREAK) || defined(FEAT_DIFF)
# define WL_SBR WL_BRI + 1 /* 'showbreak' or 'diff' */
@@ -3678,6 +3679,15 @@ win_line(wp, lnum, startrow, endrow, noc
}
}
+ if (draw_state == WL_NR_SKIP - 1 && n_extra == 0 && p_nus > 0 && (wp->w_p_nu || wp->w_p_rnu))
+ {
+ draw_state = WL_NR_SKIP;
+ c_extra = ' ';
+ p_extra = NULL;
+ n_extra = p_nus;
+ char_attr = 0;
+ }
+
#ifdef FEAT_LINEBREAK
if (wp->w_p_brisbr && draw_state == WL_BRI - 1
&& n_extra == 0 && *p_sbr != NUL)
@@ -4897,7 +4907,7 @@ win_line(wp, lnum, startrow, endrow, noc
#ifdef FEAT_DIFF
&& filler_todo <= 0
#endif
- && draw_state > WL_NR
+ && draw_state > WL_NR_SKIP
&& c != NUL)
{
c = lcs_prec;
@@ -5407,7 +5417,7 @@ win_line(wp, lnum, startrow, endrow, noc
/* Only advance the "vcol" when after the 'number' or 'relativenumber'
* column. */
- if (draw_state > WL_NR
+ if (draw_state > WL_NR_SKIP
#ifdef FEAT_DIFF
&& filler_todo <= 0
#endif