aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/eval.c2
-rw-r--r--src/nvim/options.lua4
-rw-r--r--src/nvim/window.c9
3 files changed, 8 insertions, 7 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 9a90e430a7..12226dac91 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -1299,7 +1299,7 @@ int eval_foldexpr(win_T *wp, int *cp)
// If the result is a string, check if there is a non-digit before
// the number.
char *s = tv.vval.v_string;
- if (!ascii_isdigit(*s) && *s != '-') {
+ if (*s != NUL && !ascii_isdigit(*s) && *s != '-') {
*cp = (uint8_t)(*s++);
}
retval = atol(s);
diff --git a/src/nvim/options.lua b/src/nvim/options.lua
index a0b9306908..e70fe8614f 100644
--- a/src/nvim/options.lua
+++ b/src/nvim/options.lua
@@ -4298,9 +4298,9 @@ return {
defaults = {
condition = 'BACKSLASH_IN_FILENAME',
if_false = '@,48-57,/,.,-,_,+,,,#,$,%,~,=',
- if_true = '@,48-57,/,\\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,=',
+ if_true = '@,48-57,/,\\,.,-,_,+,,,#,$,%,{,},[,],@-@,!,~,=',
doc = [[for Windows:
- "@,48-57,/,\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,="
+ "@,48-57,/,\,.,-,_,+,,,#,$,%,{,},[,],@-@,!,~,="
otherwise: "@,48-57,/,.,-,_,+,,,#,$,%,~,="]],
},
deny_duplicates = true,
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 41199306fa..16bb7f5df7 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -6943,11 +6943,13 @@ char *file_name_in_line(char *line, int col, int options, int count, char *rel_f
bool is_url = false;
// Search backward for first char of the file name.
- // Go one char back to ":" before "//" even when ':' is not in 'isfname'.
+ // Go one char back to ":" before "//", or to the drive letter before ":\" (even if ":"
+ // is not in 'isfname').
while (ptr > line) {
if ((len = (size_t)(utf_head_off(line, ptr - 1))) > 0) {
ptr -= len + 1;
} else if (vim_isfilec((uint8_t)ptr[-1])
+ || (len >= 2 && path_has_drive_letter(ptr - 2))
|| ((options & FNAME_HYP) && path_is_url(ptr - 1))) {
ptr--;
} else {
@@ -6957,14 +6959,13 @@ char *file_name_in_line(char *line, int col, int options, int count, char *rel_f
// Search forward for the last char of the file name.
// Also allow ":/" when ':' is not in 'isfname'.
- len = 0;
+ len = path_has_drive_letter(ptr) ? 2 : 0;
while (vim_isfilec((uint8_t)ptr[len]) || (ptr[len] == '\\' && ptr[len + 1] == ' ')
|| ((options & FNAME_HYP) && path_is_url(ptr + len))
|| (is_url && vim_strchr(":?&=", (uint8_t)ptr[len]) != NULL)) {
// After type:// we also include :, ?, & and = as valid characters, so that
// http://google.com:8080?q=this&that=ok works.
- if ((ptr[len] >= 'A' && ptr[len] <= 'Z')
- || (ptr[len] >= 'a' && ptr[len] <= 'z')) {
+ if ((ptr[len] >= 'A' && ptr[len] <= 'Z') || (ptr[len] >= 'a' && ptr[len] <= 'z')) {
if (in_type && path_is_url(ptr + len + 1)) {
is_url = true;
}