aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ex_cmds.c4
-rw-r--r--src/nvim/globals.h2
-rw-r--r--src/nvim/hardcopy.c2
-rw-r--r--src/nvim/ops.c14
-rw-r--r--src/nvim/option.c3
-rw-r--r--src/nvim/testdir/Makefile3
-rw-r--r--src/nvim/testdir/test63.in6
-rw-r--r--src/nvim/testdir/test_utf8.in18
-rw-r--r--src/nvim/testdir/test_utf8.ok4
-rw-r--r--src/nvim/version.c121
-rw-r--r--src/nvim/version_defs.h71
11 files changed, 96 insertions, 152 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index c3408cc4db..78c8b61c37 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -1724,8 +1724,8 @@ static void do_viminfo(FILE *fp_in, FILE *fp_out, int flags)
}
if (fp_out != NULL) {
/* Write the info: */
- fprintf(fp_out, _("# This viminfo file was generated by Vim %s.\n"),
- VIM_VERSION_MEDIUM);
+ fprintf(fp_out, _("# This viminfo file was generated by Nvim %s.\n"),
+ NVIM_VERSION_MEDIUM);
fputs(_("# You may edit it if you're careful!\n\n"), fp_out);
fputs(_("# Value of 'encoding' when this file was written\n"), fp_out);
fprintf(fp_out, "*encoding=%s\n\n", p_enc);
diff --git a/src/nvim/globals.h b/src/nvim/globals.h
index 25c453fea8..3f968ff5a0 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -996,8 +996,6 @@ extern char *longVersion;
#ifdef HAVE_PATHDEF
extern char_u *default_vim_dir;
extern char_u *default_vimruntime_dir;
-extern char_u *all_cflags;
-extern char_u *all_lflags;
extern char_u *compiled_user;
extern char_u *compiled_sys;
#endif
diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c
index b964aa7353..c6354d6c5f 100644
--- a/src/nvim/hardcopy.c
+++ b/src/nvim/hardcopy.c
@@ -2457,7 +2457,7 @@ int mch_print_begin(prt_settings_T *psettings)
STRCPY(buffer, "Unknown");
}
prt_dsc_textline("For", buffer);
- prt_dsc_textline("Creator", VIM_VERSION_LONG);
+ prt_dsc_textline("Creator", NVIM_VERSION_LONG);
/* Note: to ensure Clean8bit I don't think we can use LC_TIME */
now = time(NULL);
p_time = ctime(&now);
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index ed2a82d55c..e74fcef8d9 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -512,6 +512,20 @@ static void block_insert(oparg_T *oap, char_u *s, int b_insert, struct block_def
}
}
+ if (has_mbyte && spaces > 0) {
+ // Avoid starting halfway a multi-byte character.
+ if (b_insert) {
+ int off = (*mb_head_off)(oldp, oldp + offset + spaces);
+ spaces -= off;
+ count -= off;
+ } else {
+ int off = (*mb_off_next)(oldp, oldp + offset);
+ offset += off;
+ spaces = 0;
+ count = 0;
+ }
+ }
+
newp = (char_u *) xmalloc((size_t)(STRLEN(oldp) + s_len + count + 1));
/* copy up to shifted part */
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 2255ec26ff..ca868120a0 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -1390,9 +1390,6 @@ static struct vimoption
{"shelltemp", "stmp", P_BOOL,
(char_u *)&p_stmp, PV_NONE,
{(char_u *)FALSE, (char_u *)TRUE} SCRIPTID_INIT},
- {"shelltype", "st", P_NUM|P_VI_DEF,
- (char_u *)NULL, PV_NONE,
- {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
{"shellxquote", "sxq", P_STRING|P_VI_DEF|P_SECURE,
(char_u *)&p_sxq, PV_NONE,
{
diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile
index 9f04f880b5..521fbc19cf 100644
--- a/src/nvim/testdir/Makefile
+++ b/src/nvim/testdir/Makefile
@@ -35,7 +35,8 @@ SCRIPTS := test_autoformat_join.out \
test_listlbr.out test_listlbr_utf8.out \
test_changelist.out \
test_breakindent.out \
- test_insertcount.out
+ test_insertcount.out \
+ test_utf8.out
SCRIPTS_GUI := test16.out
diff --git a/src/nvim/testdir/test63.in b/src/nvim/testdir/test63.in
index ff05afbf81..db347a0a87 100644
--- a/src/nvim/testdir/test63.in
+++ b/src/nvim/testdir/test63.in
@@ -7,9 +7,9 @@ STARTTEST
:" --- Check that "matcharg()" returns the correct group and pattern if a match
:" --- is defined.
:let @r = "*** Test 1: "
-:highlight MyGroup1 ctermbg=red
-:highlight MyGroup2 ctermbg=green
-:highlight MyGroup3 ctermbg=blue
+:highlight MyGroup1 ctermbg=red guibg=red
+:highlight MyGroup2 ctermbg=green guibg=green
+:highlight MyGroup3 ctermbg=blue guibg=blue
:match MyGroup1 /TODO/
:2match MyGroup2 /FIXME/
:3match MyGroup3 /XXX/
diff --git a/src/nvim/testdir/test_utf8.in b/src/nvim/testdir/test_utf8.in
new file mode 100644
index 0000000000..e8d23c4be8
--- /dev/null
+++ b/src/nvim/testdir/test_utf8.in
@@ -0,0 +1,18 @@
+Tests for Unicode manipulations
+
+STARTTEST
+:so small.vim
+:set encoding=utf-8
+:" Visual block Insert adjusts for multi-byte char
+:new
+:call setline(1, ["aaa", "あああ", "bbb"])
+:exe ":norm! gg0l\<C-V>jjIx\<Esc>"
+:let r = getline(1, '$')
+:
+:bwipeout!
+:$put=r
+:call garbagecollect(1)
+:/^start:/,$wq! test.out
+ENDTEST
+
+start:
diff --git a/src/nvim/testdir/test_utf8.ok b/src/nvim/testdir/test_utf8.ok
new file mode 100644
index 0000000000..c5bed54856
--- /dev/null
+++ b/src/nvim/testdir/test_utf8.ok
@@ -0,0 +1,4 @@
+start:
+axaa
+xあああ
+bxbb
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 6eea45ed39..b485d7fef7 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -1,14 +1,7 @@
/// @file version.c
///
-/// Vim originated from Stevie version 3.6 (Fish disk 217) by GRWalter (Fred)
-/// It has been changed beyond recognition since then.
-///
-/// Differences between version 6.x and 7.x can be found with ":help version7".
-/// Differences between version 5.x and 6.x can be found with ":help version6".
-/// Differences between version 4.x and 5.x can be found with ":help version5".
-/// Differences between version 3.0 and 4.x can be found with ":help version4".
-/// All the remarks about older versions have been removed, they are not very
-/// interesting.
+/// Nvim was forked from Vim 7.4.160.
+/// Vim originated from Stevie version 3.6 (Fish disk 217) by GRWalter (Fred).
#include <inttypes.h>
@@ -25,10 +18,8 @@
#include "nvim/version_defs.h"
char *Version = VIM_VERSION_SHORT;
-static char *mediumVersion = VIM_VERSION_MEDIUM;
-
-char *longVersion = VIM_VERSION_LONG_DATE __DATE__ " " __TIME__ ")";
-
+char *longVersion = NVIM_VERSION_LONG " (compiled " __DATE__ " " __TIME__ ")";
+char *version_commit = "Commit: " NVIM_VERSION_COMMIT;
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "version.c.generated.h"
@@ -233,7 +224,7 @@ static int included_patches[] = {
411,
410,
//409 NA
- //408,
+ 408,
407,
//406,
405,
@@ -244,7 +235,7 @@ static int included_patches[] = {
//400 NA
//399 NA
//398,
- //397,
+ 397,
//396,
//395,
//394,
@@ -266,7 +257,7 @@ static int included_patches[] = {
//378,
377,
376,
- //375,
+ 375,
374,
373,
372,
@@ -275,10 +266,10 @@ static int included_patches[] = {
369,
368,
367,
- //366,
+ //366 NA
365,
364,
- //363,
+ //363 NA
362,
361,
360,
@@ -752,60 +743,24 @@ static void list_features(void)
void list_version(void)
{
- int i;
- int first;
- char *s = "";
-
// When adding features here, don't forget to update the list of
// internal variables in eval.c!
MSG(longVersion);
-
- // Print the list of patch numbers if there is at least one.
- // Print a range when patches are consecutive: "1-10, 12, 15-40, 42-45"
- if (included_patches[0] != 0) {
- MSG_PUTS(_("\nIncluded patches: "));
- first = -1;
-
- // find last one
- for (i = 0; included_patches[i] != 0; ++i) {}
-
- while (--i >= 0) {
- if (first < 0) {
- first = included_patches[i];
- }
-
- if ((i == 0) || (included_patches[i - 1] != included_patches[i] + 1)) {
- MSG_PUTS(s);
- s = ", ";
- msg_outnum((long)first);
-
- if (first != included_patches[i]) {
- MSG_PUTS("-");
- msg_outnum((long)included_patches[i]);
- }
- first = -1;
- }
- }
- }
+ MSG(version_commit);
// Print the list of extra patch descriptions if there is at least one.
+ char *s = "";
if (extra_patches[0] != NULL) {
MSG_PUTS(_("\nExtra patches: "));
s = "";
- for (i = 0; extra_patches[i] != NULL; ++i) {
+ for (int i = 0; extra_patches[i] != NULL; ++i) {
MSG_PUTS(s);
s = ", ";
MSG_PUTS(extra_patches[i]);
}
}
-#ifdef MODIFIED_BY
- MSG_PUTS("\n");
- MSG_PUTS(_("Modified by "));
- MSG_PUTS(MODIFIED_BY);
-#endif // ifdef MODIFIED_BY
-
#ifdef HAVE_PATHDEF
if ((*compiled_user != NUL) || (*compiled_sys != NUL)) {
@@ -823,8 +778,6 @@ void list_version(void)
}
#endif // ifdef HAVE_PATHDEF
- MSG_PUTS(_("\nHuge version "));
- MSG_PUTS(_("without GUI."));
version_msg(_(" Features included (+) or not (-):\n"));
list_features();
@@ -872,11 +825,6 @@ void list_version(void)
version_msg((char *)default_vimruntime_dir);
version_msg("\"\n");
}
- version_msg(_("Compilation: "));
- version_msg((char *)all_cflags);
- version_msg("\n");
- version_msg(_("Linking: "));
- version_msg((char *)all_lflags);
#endif // ifdef HAVE_PATHDEF
#ifdef DEBUG
version_msg("\n");
@@ -929,13 +877,9 @@ void intro_message(int colon)
int sponsor;
char *p;
static char *(lines[]) = {
- N_("VIM - Vi IMproved"),
+ N_(NVIM_VERSION_LONG),
"",
- N_("version "),
N_("by Bram Moolenaar et al."),
-#ifdef MODIFIED_BY
- " ",
-#endif // ifdef MODIFIED_BY
N_("Vim is open source and freely distributable"),
"",
N_("Help poor children in Uganda!"),
@@ -943,7 +887,6 @@ void intro_message(int colon)
"",
N_("type :q<Enter> to exit "),
N_("type :help<Enter> or <F1> for on-line help"),
- N_("type :help version7<Enter> for version info"),
NULL,
"",
N_("Running in Vi compatible mode"),
@@ -1001,7 +944,7 @@ void intro_message(int colon)
}
if (*p != NUL) {
- do_intro_line(row, (char_u *)_(p), i == 2, 0);
+ do_intro_line(row, (char_u *)_(p), 0);
}
row++;
}
@@ -1013,45 +956,16 @@ void intro_message(int colon)
}
}
-static void do_intro_line(int row, char_u *mesg, int add_version, int attr)
+static void do_intro_line(int row, char_u *mesg, int attr)
{
- char_u vers[20];
int col;
char_u *p;
int l;
int clen;
-#ifdef MODIFIED_BY
-# define MODBY_LEN 150
- char_u modby[MODBY_LEN];
-
- if (*mesg == ' ') {
- l = STRLCPY(modby, _("Modified by "), MODBY_LEN);
- if (l < MODBY_LEN - 1) {
- STRLCPY(modby + l, MODIFIED_BY, MODBY_LEN - l);
- }
- mesg = modby;
- }
-#endif // ifdef MODIFIED_BY
-
// Center the message horizontally.
col = vim_strsize(mesg);
- if (add_version) {
- STRCPY(vers, mediumVersion);
-
- if (highest_patch()) {
- // Check for 9.9x or 9.9xx, alpha/beta version
- if (isalpha((int)vers[3])) {
- int len = (isalpha((int)vers[4])) ? 5 : 4;
- sprintf((char *)vers + len, ".%d%s", highest_patch(),
- mediumVersion + len);
- } else {
- sprintf((char *)vers + 3, ".%d", highest_patch());
- }
- }
- col += (int)STRLEN(vers);
- }
col = (Columns - col) / 2;
if (col < 0) {
@@ -1074,11 +988,6 @@ static void do_intro_line(int row, char_u *mesg, int add_version, int attr)
screen_puts_len(p, l, row, col, *p == '<' ? hl_attr(HLF_8) : attr);
col += clen;
}
-
- // Add the version number to the version line.
- if (add_version) {
- screen_puts(vers, row, col, 0);
- }
}
/// ":intro": clear screen, display intro screen and wait for return.
diff --git a/src/nvim/version_defs.h b/src/nvim/version_defs.h
index 65dbfc8581..d8e1b4ea82 100644
--- a/src/nvim/version_defs.h
+++ b/src/nvim/version_defs.h
@@ -1,47 +1,50 @@
#ifndef NVIM_VERSION_DEFS_H
#define NVIM_VERSION_DEFS_H
-/*
- * VIM - Vi IMproved by Bram Moolenaar
- *
- * Do ":help uganda" in Vim to read copying and usage conditions.
- * Do ":help credits" in Vim to see a list of people who contributed.
- */
+// VIM - Vi IMproved by Bram Moolenaar
+//
+// Do ":help uganda" in Vim to read copying and usage conditions.
+// Do ":help credits" in Vim to see a list of people who contributed.
-/*
- * Define the version number, name, etc.
- * The patchlevel is in included_patches[], in version.c.
- *
- * This doesn't use string concatenation, some compilers don't support it.
- */
+#define STR_(x) #x
+#define STR(x) STR_(x)
+//
+// Nvim version identifiers
+//
+#ifndef NVIM_VERSION_MAJOR
+#define NVIM_VERSION_MAJOR 0
+#endif
+#ifndef NVIM_VERSION_MINOR
+#define NVIM_VERSION_MINOR 0
+#endif
+#ifndef NVIM_VERSION_PATCH
+#define NVIM_VERSION_PATCH 0
+#endif
+#ifndef NVIM_VERSION_PRERELEASE
+#define NVIM_VERSION_PRERELEASE
+#endif
+#ifndef NVIM_VERSION_BUILD
+#define NVIM_VERSION_BUILD
+#endif
+#ifndef NVIM_VERSION_COMMIT
+#define NVIM_VERSION_COMMIT
+#endif
+// for the startup-screen
+#define NVIM_VERSION_MEDIUM STR(NVIM_VERSION_MAJOR) "." STR(NVIM_VERSION_MINOR)
+// for the ":version" command and "nvim -h"
+#define NVIM_VERSION_LONG "NVIM " NVIM_VERSION_MEDIUM "." STR(NVIM_VERSION_PATCH) NVIM_VERSION_PRERELEASE NVIM_VERSION_BUILD
+
+//
+// Vim version number, name, etc. Patchlevel is defined in version.c.
+//
#define VIM_VERSION_MAJOR 7
-#define VIM_VERSION_MAJOR_STR "7"
#define VIM_VERSION_MINOR 4
-#define VIM_VERSION_MINOR_STR "4"
#define VIM_VERSION_100 (VIM_VERSION_MAJOR * 100 + VIM_VERSION_MINOR)
-#define VIM_VERSION_BUILD 280
-#define VIM_VERSION_BUILD_BCD 0x118
-#define VIM_VERSION_BUILD_STR "280"
-#define VIM_VERSION_PATCHLEVEL 0
-#define VIM_VERSION_PATCHLEVEL_STR "0"
-/* Used by MacOS port should be one of: development, alpha, beta, final */
-#define VIM_VERSION_RELEASE development
-
-/*
- * VIM_VERSION_NODOT is used for the runtime directory name.
- * VIM_VERSION_SHORT is copied into the swap file (max. length is 6 chars).
- * VIM_VERSION_MEDIUM is used for the startup-screen.
- * VIM_VERSION_LONG is used for the ":version" command and "Vim -h".
- */
+// used for the runtime directory name
#define VIM_VERSION_NODOT "vim74"
+// swap file compatibility (max. length is 6 chars)
#define VIM_VERSION_SHORT "7.4"
-#define VIM_VERSION_MEDIUM "7.4"
-#define VIM_VERSION_LONG "VIM - Vi IMproved 7.4 (2014)"
-#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.4 (2014, compiled "
-
-/* Displayed on splash screen. */
-#define MODIFIED_BY "the Neovim contributors."
#endif // NVIM_VERSION_DEFS_H