Picon

Vim creating a 4193 file, results in wrong readings by inotify

Trying to debug having some tests running twice using guard gem and rspec, I realized that the problem was
actually vim that creates a file called `4193`. I found a discussion in 2009*, but it has to do with windows.

Basically the problem was that while rspec is running, the listen gem found that infame file and then makes
it run again.

Using inotifywatch -m, I can see the file is being created:

foo/ CREATE 4913
foo/ OPEN 4913
foo/ ATTRIB 4913
foo/ CLOSE_WRITE,CLOSE 4913
foo/ DELETE 4913

I found two things I believe they might be interesting:

1. This happens after the first save, so I guess it has to do over existing files.
2. I found that running this with no vimrc, `vim -u NONE -U none`, doesn't show this problem. After a lot of
trial & error, I found that the problem has to do specifically with the `set nocompatible` option. Even
more, just running `set compatible` and then saving the document, doesn't create/delete the 4913 file.

Is this actually the expected behaviour or is it a strange bug?

I know the offending line is this one:
https://code.google.com/p/vim/source/browse/src/fileio.c#3693, but I still don't get it :c

* https://groups.google.com/d/topic/vim_dev/sppdpElxY44/discussion

-- 
--

-- 
(Continue reading)

mattn | 30 Sep 05:13 2014
Picon

Doesn't work fileencodings conversion for fifo

$ ls | vim -

About reading stdin, it' is PIPE. And vim handles fileencodings conversion. But

$ vim -u NONE --cmd "e ++enc=utf-8" --cmd "set fileencodings=cp932,utf-8" <(echo "foobar")

It is not PIPE. it's FIFO. So vim doesn't handle fileencodings. I'm thinking it's possible to handle
fileencodings like PIPE.

How do you think?

-- 
--

-- 
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 vim_dev+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christian Brabandt | 29 Sep 22:51 2014

[patch] several problems with drawing overlong lines

Hi,
I noticed some problems with Vim displaying lines, that are longer than 
the actual screen size.

For one, if the precedes listchar option is set, this will be drawn even 
when 'showbreak' is set and the list option is not. The easy fix is:

diff --git a/src/screen.c b/src/screen.c
--- a/src/screen.c
+++ b/src/screen.c
 <at>  <at>  -4892,7 +4892,7  <at>  <at>  win_line(wp, lnum, startrow, endrow, noc
         * character of the line and the user wants us to show us a
         * special character (via 'listchars' option "precedes:<char>".
         */
-       if (lcs_prec_todo != NUL
+       if (lcs_prec_todo != NUL && wp->w_p_list
                && (wp->w_p_wrap ? wp->w_skipcol > 0 : wp->w_leftcol > 0)
 #ifdef FEAT_DIFF
                && filler_todo <= 0

2) When 'nu' or 'rnu' is set (or a sign column is displayed or the 
foldcolumn is set) and 'sbr' value is displayed, then moving the cursor 
is off (e.g. there is a difference between what ga outputs and where the 
cursor is positioned) (This is very irritating if you are searching for 
a regex and wonder why the cursor stops at the current position although 
the RE doesn't match). I think, this patch fixes this as well (not sure, 
this is the right approach):

diff --git a/src/charset.c b/src/charset.c
--- a/src/charset.c
(Continue reading)

Bram Moolenaar | 29 Sep 20:33 2014
Picon
Picon

Patch 7.4.463


Patch 7.4.463
Problem:    Test 86 and 87 may hang on MS-Windows.
Solution:   Call inputrestore() after inputsave(). (Ken Takata)
Files:	    src/testdir/test86.in, src/testdir/test87.in

*** ../vim-7.4.462/src/testdir/test86.in	2014-03-12 15:26:36.428714415 +0100
--- src/testdir/test86.in	2014-09-29 18:03:03.539951504 +0200
***************
*** 1384,1389 ****
--- 1384,1390 ----
  :debug silent! py test_keyboard_interrupt()
  :redir END
  :0 debuggreedy
+ :call inputrestore()
  :silent $put =output
  :unlet output
  :py del test_keyboard_interrupt
*** ../vim-7.4.462/src/testdir/test87.in	2014-03-12 15:26:36.432714415 +0100
--- src/testdir/test87.in	2014-09-29 18:03:23.719951548 +0200
***************
*** 1361,1366 ****
--- 1361,1367 ----
  :debug silent! py3 test_keyboard_interrupt()
  :redir END
  :0 debuggreedy
+ :call inputrestore()
  :silent $put =output
  :unlet output
  :py3 del test_keyboard_interrupt
(Continue reading)

Bram Moolenaar | 29 Sep 17:16 2014
Picon
Picon

Patch 7.4.462


Patch 7.4.462
Problem:    Setting the local value of 'backupcopy' empty gives an error.
	    (Peter Mattern)
Solution:   When using an empty value set the flags to zero. (Hirohito
	    Higashi)
Files:	    src/option.c

*** ../vim-7.4.461/src/option.c	2014-09-23 15:45:04.870801055 +0200
--- src/option.c	2014-09-29 17:03:06.963943648 +0200
***************
*** 5742,5756 ****
  	    flags = &curbuf->b_bkc_flags;
  	}

! 	if (opt_strings_flags(bkc, p_bkc_values, flags, TRUE) != OK)
! 	    errmsg = e_invarg;
! 	if ((((int)*flags & BKC_AUTO) != 0)
! 		+ (((int)*flags & BKC_YES) != 0)
! 		+ (((int)*flags & BKC_NO) != 0) != 1)
  	{
! 	    /* Must have exactly one of "auto", "yes"  and "no". */
! 	    (void)opt_strings_flags(oldval, p_bkc_values, flags, TRUE);
! 	    errmsg = e_invarg;
  	}
      }

--- 5742,5762 ----
  	    flags = &curbuf->b_bkc_flags;
  	}
(Continue reading)

mattn | 29 Sep 02:30 2014
Picon

Title of command prompt is not displayed correctly when encoding=utf-8

After starting cmd.exe on japanese windows, the title string is 「コマンドプロンプト」.
Vim break it while executing commands. And I noticed that vim restoreing broken title string.

g_szOrigTitle is ANSI encoding. But vim call mch_settitle which is depend on current encoding.

diff -r e861ee614a3a src/os_mswin.c
--- a/src/os_mswin.c    Wed Sep 24 10:58:20 2014 +0900
+++ b/src/os_mswin.c    Fri Sep 26 15:17:59 2014 +0900
 <at>  <at>  -344,7 +344,7  <at>  <at> 
     int which)
 {
 #ifndef FEAT_GUI_MSWIN
-    mch_settitle((which & 1) ? g_szOrigTitle : NULL, NULL);
+    SetConsoleTitle(g_szOrigTitle);
 #endif
 }

diff -r e861ee614a3a src/os_win32.c
--- a/src/os_win32.c    Wed Sep 24 10:58:20 2014 +0900
+++ b/src/os_win32.c    Fri Sep 26 15:17:59 2014 +0900
 <at>  <at>  -4646,7 +4646,33  <at>  <at> 
     int        tmode = cur_tmode;
 #ifdef FEAT_TITLE
     char szShellTitle[512];
-
+# ifdef FEAT_MBYTE
+
+    /* Change the title to reflect that we are in a subshell. */
+    if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+    {
(Continue reading)

mattn | 29 Sep 02:25 2014
Picon

Printer name is broken on printer dialog.

When printer name contains multi-byte, the name is displayed as ???.

diff -r e861ee614a3a src/os_mswin.c
--- a/src/os_mswin.c    Wed Sep 24 10:58:20 2014 +0900
+++ b/src/os_mswin.c    Fri Sep 26 15:09:46 2014 +0900
 <at>  <at>  -1635,11 +1635,30  <at>  <at> 
    char_u  *printer_name = (char_u *)devname + devname->wDeviceOffset;
    char_u  *port_name = (char_u *)devname +devname->wOutputOffset;
    char_u  *text = _("to %s on %s");
+#ifdef FEAT_MBYTE
+   char_u  *printer_name_orig = printer_name, *port_name_orig = port_name;
+
+   if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+   {
+       char_u  *to_free = NULL;
+       int     maxlen;
+       acp_to_enc(printer_name, STRLEN(printer_name), &to_free, &maxlen);
+       if (to_free != NULL) printer_name = to_free;
+       acp_to_enc(port_name, STRLEN(port_name), &to_free, &maxlen);
+       if (to_free != NULL) port_name = to_free;
+   }
+#endif

    prt_name = alloc((unsigned)(STRLEN(printer_name) + STRLEN(port_name)
                                 + STRLEN(text)));
    if (prt_name != NULL)
        wsprintf(prt_name, text, printer_name, port_name);
+#ifdef FEAT_MBYTE
+   if (printer_name != printer_name_orig)
+       vim_free(printer_name);
(Continue reading)

Mikhail V | 27 Sep 22:12 2014
Picon

A feature request (kind of Issue report) - GUI setup, left margin, legitimity,

Greetings, 
I am totally new to the discussion groups, so i'm sorry in advance if there are already solutions to my
problem. And I was not able to attach screenshots, I don't know what is the problem, I press "attach a file"
and nothing happens. Tell me please how to do it, then it will be much easier to see what I mean.

I am not sure how to describe my contribution, it is rather a feature request which should solve a serious
Usability issue which I suffer from for a long time staring in the Vim window (since I write python programs
in it quite a lot) . I used all possible setup options and color setups to push the best out of the readability
in Vim, so now it looks as in attached screenshot (issue.png). 
So the thing is, afaik, there is no option to setup left margin of the text window, so it is impossible to
control the gap between linenumber column ant text area. And equally, when I hide numbers column, the text
literally sticks to the window border. Especially bad it looks in Windows version of Vim (I use Courier New
font), since the characters somehow stick to the left boundary of the em 
square. 
This issue was discussed on Stackoverflow in 2011, here is link:
http://stackoverflow.com/questions/7893390/how-to-change-the-left-margin-in-gvim
 but still afaik no solution (?), only some weak workarounds or plugins ... So obviously logical solution
would be  introducing an option, something like "leftmargin" which would just leave empty gap at line
beginnings and therefore solve this issue distinctly. See "solution.png" in attachement to see what I
want to get with it. 
It would be perfect if one could get also a dotted line between areas like in "solution2.png" but I know, it
probably contradicts with text-mode nature of vim.
Predicting the counter-critics, that it will look as if there are spaces at line beginnings - I am working
with Vim+Python only so in my case I always know where is the left border of my textfile, same as with block
text or other code, so I think there almost no examples where it can cause any problems. 

Hope I was clear enough in my intention. Thanks in advance for your comments and special thanks to
developers for such a great text editor!

Mikhail V
(Continue reading)

Bram Moolenaar | 27 Sep 11:19 2014
Picon
Picon

Patch 7.4.461


Patch 7.4.461
Problem:    MS-Windows: When collate is on the number of copies is too high.
Solution:   Only set the collated/uncollated count when collate is on.
	    (Yasuhiro Matsumoto)
Files:	    src/os_mswin.c

*** ../vim-7.4.460/src/os_mswin.c	2014-09-23 21:53:35.306849352 +0200
--- src/os_mswin.c	2014-09-27 11:14:27.287520497 +0200
***************
*** 1673,1688 ****
       */
      psettings->chars_per_line = prt_get_cpl();
      psettings->lines_per_page = prt_get_lpp();
!     psettings->n_collated_copies = (prt_dlg.Flags & PD_COLLATE)
! 							? prt_dlg.nCopies : 1;
!     psettings->n_uncollated_copies = (prt_dlg.Flags & PD_COLLATE)
! 							? 1 : prt_dlg.nCopies;

!     if (psettings->n_collated_copies == 0)
! 	psettings->n_collated_copies = 1;

!     if (psettings->n_uncollated_copies == 0)
  	psettings->n_uncollated_copies = 1;

      psettings->jobname = jobname;

--- 1673,1694 ----
       */
      psettings->chars_per_line = prt_get_cpl();
(Continue reading)

Yukihiro Nakadaira | 27 Sep 09:44 2014
Picon

typo in eval.txt

Argument of count() is mistaken.

diff -r 3d9d6241de2b runtime/doc/eval.txt
--- a/runtime/doc/eval.txt    Wed Sep 24 13:26:44 2014 +0200
+++ b/runtime/doc/eval.txt    Sat Sep 27 16:27:16 2014 +0900
<at> <at> -1751,7 +1751,7 <at> <at>
 copy( {expr})            any    make a shallow copy of {expr}
 cos( {expr})            Float    cosine of {expr}
 cosh( {expr})            Float    hyperbolic cosine of {expr}
-count( {list}, {expr} [, {start} [, {ic}]])
+count( {list}, {expr} [, {ic} [, {start}]])
                 Number     count how many {expr} are in {list}
 cscope_connection( [{num} , {dbpath} [, {prepend}]])
                 Number    checks existence of cscope connection

--
Yukihiro Nakadaira - yukihiro.nakadaira <at> gmail.com

--
--
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 vim_dev+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Peter Mattern | 26 Sep 20:25 2014
Picon

faulty session scripts in 7.4.459

As of 7.4.459 the script files as created by mksession or mkview contain 
an invalid line
           setlocal backupcopy=
which causes an E474 error when sourced.

Once a correct value such as auto was set manually, it doesn't get 
overwritten by running e, g, ':mksession!'.

Seen on Arch Linux (x86_64) using the distro's packages. Looking at the 
build system I couldn't find any possible culprit specific to the distro.
Problem couldn't be seen with 7.4.410, all configuration files remained 
unchanged during the update.

So doesn't this look like a bug or am I missing something?

-- 
--

-- 
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 vim_dev+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Gmane