macvim-dev / macvim-dev/macvim

mvim: '+' argument doesn't work with '--remote' and friends

Open
#1,445 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vim Script
Stars
7.9k
Forks
691
PR merge metrics
No merged PRs in 30d

Description

Steps to reproduce
  1. Open a terminal.
  2. Type
    mvim + --remote <filename>
    
    or
    mvim +2 --remote <filename>
    

, where <filename> is an existing file with more than one line.
4. Observe that the cursor is at the top of the file, not the end as directed by + (nor the line specified by +n).

Expected behaviour

Per mvim --help:

+ Start at end of file
+<lnum> Start at line

Upon opening, the cursor should have been positioned on the last line of the file (or the line directed by the +<lnum> form).

Version of Vim and architecture

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Sep 12 2023 09:31:27) macOS version - x86_64. Included patches: 1-1897

Environment

Operating system: MacOS 13.2.1 (22D68)
Terminal: iTerm2 Build 3.4.20
Value of $TERM: xterm-color
Shell: zsh 5.8.1 (x86_64-apple-darwin22.0)

How MacVim was installed

MacPorts

Logs and stack traces

No response

Vim configuration where issue is reproducable

https://gist.github.com/tomory/65de091000d9f89732f33be98d39848e

Issue has been tested with given configuration
  • by running MacVim.app from GUI macOS interface
  • by running vim/gvim/etc installed by MacVim
  • by running other versions of vim (e.g. /usr/bin/vim)
Issue has been tested with no configuration
  • by running mvim --clean (or gvim, supplied by MacVim distribution)
  • by running vim --clean (in terminal, supplied by MacVim distribution)
  • by running vim --clean (in terminal, other suppliers, e.g. /usr/bin/vim)
Other conditions
  • The both Homebrew packages "vim" and "macvim" are installed

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior with mvim --clean using +, +2, and --remote as described, then trace the mvim command-line handling for these arguments. Done means the cursor opens at the end of the file for + and at the requested line for +n, including when --remote is used.

Written by the indexing model from the issue text.

Assessment

Tech stack
vim
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.