Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Add "Don't give the file editing message" flag in shortmess option. #4446

Closed
wants to merge 1 commit into from

Conversation

Shougo
Copy link
Contributor

@Shougo Shougo commented Mar 13, 2016

It adds F flag in shortmess option.
It is "Don't give the file editing message" flag.
Because, it is useless if you use statusline feature.

Note: I will create the patch for Vim after it is merged.

fileinfo(FALSE, FALSE, eap->forceit);

if (!shortmess(SHM_FILEINFO)) {
/* print full file name if :cd used */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\\ comment

@Shougo
Copy link
Contributor Author

Shougo commented Mar 13, 2016

Thank you. Fixed.

@wsdjeg
Copy link
Contributor

wsdjeg commented Mar 13, 2016

does it mean ,when I start vim like ,vim README.md,then I see a message like "README.md" 37L, 822C
this flag is to hide this?

@Shougo
Copy link
Contributor Author

Shougo commented Mar 13, 2016

does it mean ,when I start vim like ,vim README.md,then I see a message like "README.md" 37L, 822C
this flag is to hide this?

Yes.

@wsdjeg
Copy link
Contributor

wsdjeg commented Mar 13, 2016

I think I have search for how to hide file info when open a new file more than 20 times? thanks for this PR.

@Shougo
Copy link
Contributor Author

Shougo commented Mar 13, 2016

I think I have search for how to hide file info when open a new file more than 20 times?

I have did it. But it is nothing. So I have implemented.

@fmoralesc
Copy link
Contributor

Is it possible to make tests for this, or does the message get lost in a redraw? I think this would be the only thing missing from this PR.

@Shougo
Copy link
Contributor Author

Shougo commented Mar 13, 2016

Is it possible to make tests for this, or does the message get lost in a redraw? I think this would be the only thing missing from this PR.

I don't know about the UI tests.

@fmoralesc
Copy link
Contributor

I'm not an expert, but this seems enough:

local helpers = require('test.functional.helpers')
local Screen = require('test.functional.ui.screen')
local clear, feed, execute = helpers.clear, helpers.feed, helpers.execute

describe("'shortmess'", function()
  local screen

  before_each(function()
    clear()
    screen = Screen.new(25, 5)
    screen:attach()
    execute('set shortmess&')
  end)

  after_each(function()
    screen:detach()
  end)

  describe("=F", function()
    it(':hides messages about the files read', function()
      execute('e test')
      screen:expect([[
        ^                         |
        ~                        |
        ~                        |
        ~                        |
        "test" is a directory    |
      ]])
      execute('set shortmess=F')
      execute('e test')
      screen:expect([[
        ^                         |
        ~                        |
        ~                        |
        ~                        |
        :e test                  |
      ]])
    end)
  end)
end)

I created this in test/functional/ui/shortmess_spec.lua, but I'm not sure if it that is the place for it to go.

@Shougo
Copy link
Contributor Author

Shougo commented Mar 13, 2016

Thank you!

@Shougo
Copy link
Contributor Author

Shougo commented Mar 13, 2016

I have added the tests by @fmoralesc

@justinmk
Copy link
Member

I suggest sending this to Vim first, so that we don't have to do double-work if Bram changes something. At least confirm that F is the flag he wants to use.

@Shougo
Copy link
Contributor Author

Shougo commented Mar 14, 2016

OK. I will do it.

@Shougo
Copy link
Contributor Author

Shougo commented Mar 14, 2016

I have sent it to vim_dev.

vim/vim#686

@Shougo
Copy link
Contributor Author

Shougo commented Mar 15, 2016

The patch is merged in Vim 7.4.1570.
I have fixed the code.

@fmoralesc
Copy link
Contributor

Looking good, and the vim compat detail is solved. 👍

@fmoralesc
Copy link
Contributor

@Shougo Just a couple fixes needed for appeasing clint.py. Other than that, this seems ready.

@Shougo
Copy link
Contributor Author

Shougo commented Mar 16, 2016

I have fixed the code style.

@fmoralesc
Copy link
Contributor

Excellent. Can you squash so we can merge it cleanly?

Add the UI tests by @fmoralesc
Fix the changes for Vim 7.4.1570
@Shougo
Copy link
Contributor Author

Shougo commented Mar 16, 2016

I have squashed.

flags | READ_NEW);
msg_silent = old_msg_silent;

// Help buffer is filtered.
if (curbuf->b_help)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clint.py is complaining about the lack of braces in this conditional. :(

clear()
screen = Screen.new(25, 5)
screen:attach()
execute('set shortmess&')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clear() guarantees defaults for all options.

@justinmk
Copy link
Member

Merged

@justinmk justinmk closed this Mar 17, 2016
@justinmk justinmk removed the RFC label Mar 17, 2016
justinmk pushed a commit that referenced this pull request Mar 17, 2016
Add "Don't give the file editing message" flag in shortmess option.

Add the UI tests by @fmoralesc
Fix the changes for Vim 7.4.1570
justinmk added a commit that referenced this pull request Mar 17, 2016
@Shougo Shougo deleted the silent branch March 19, 2016 02:17
@Shougo
Copy link
Contributor Author

Shougo commented Mar 19, 2016

Thank you!

felipecrv pushed a commit to felipecrv/neovim that referenced this pull request Mar 29, 2016
Add "Don't give the file editing message" flag in shortmess option.

Add the UI tests by @fmoralesc
Fix the changes for Vim 7.4.1570
justinmk added a commit that referenced this pull request Apr 8, 2016
Features:
  f2ae5a9 Add TextYankPost and TextDeletePost autocmds
  44b2cef bufhl: new mechanism for plugins to add highlights to a buffer
  39c3842 Make set{qf,loc}list() take {title}
  77a7ca4 'shortmess': Add "F" flag. #4446
  99d4c8c keymap: Support <D-...> (super/command key).

Fixes:
  14c9b30 terminal.c: temporary fix for incorrect paste handling

Notable changes:
  50e129f defaults: Enable syntax and filetype plugins.
  4e39eee upgrade libvterm (improves terminal reflow)
snoe pushed a commit to snoe/neovim that referenced this pull request Apr 10, 2016
Features:
  f2ae5a9 Add TextYankPost and TextDeletePost autocmds
  44b2cef bufhl: new mechanism for plugins to add highlights to a buffer
  39c3842 Make set{qf,loc}list() take {title}
  77a7ca4 'shortmess': Add "F" flag. neovim#4446
  99d4c8c keymap: Support <D-...> (super/command key).

Fixes:
  14c9b30 terminal.c: temporary fix for incorrect paste handling

Notable changes:
  50e129f defaults: Enable syntax and filetype plugins.
  4e39eee upgrade libvterm (improves terminal reflow)
mgraczyk pushed a commit to mgraczyk/neovim that referenced this pull request Apr 13, 2016
Features:
  f2ae5a9 Add TextYankPost and TextDeletePost autocmds
  44b2cef bufhl: new mechanism for plugins to add highlights to a buffer
  39c3842 Make set{qf,loc}list() take {title}
  77a7ca4 'shortmess': Add "F" flag. neovim#4446
  99d4c8c keymap: Support <D-...> (super/command key).

Fixes:
  14c9b30 terminal.c: temporary fix for incorrect paste handling

Notable changes:
  50e129f defaults: Enable syntax and filetype plugins.
  4e39eee upgrade libvterm (improves terminal reflow)
AdnoC pushed a commit to AdnoC/neovim that referenced this pull request Apr 29, 2016
Add "Don't give the file editing message" flag in shortmess option.

Add the UI tests by @fmoralesc
Fix the changes for Vim 7.4.1570
AdnoC pushed a commit to AdnoC/neovim that referenced this pull request Apr 29, 2016
Features:
  f2ae5a9 Add TextYankPost and TextDeletePost autocmds
  44b2cef bufhl: new mechanism for plugins to add highlights to a buffer
  39c3842 Make set{qf,loc}list() take {title}
  77a7ca4 'shortmess': Add "F" flag. neovim#4446
  99d4c8c keymap: Support <D-...> (super/command key).

Fixes:
  14c9b30 terminal.c: temporary fix for incorrect paste handling

Notable changes:
  50e129f defaults: Enable syntax and filetype plugins.
  4e39eee upgrade libvterm (improves terminal reflow)
teto pushed a commit to teto/neovim that referenced this pull request Aug 16, 2016
Add "Don't give the file editing message" flag in shortmess option.

Add the UI tests by @fmoralesc
Fix the changes for Vim 7.4.1570
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants