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

Close sidebar and bottom panel with :only command #4304

Merged
merged 3 commits into from Dec 23, 2019

Conversation

kizza
Copy link
Contributor

@kizza kizza commented Nov 28, 2019

What this PR does / why we need it:

  • Currently :only in this plugin simply reduces the number of editors (splits) to one
  • In vim, :only closes all open views except the one with focus (eg. it closes NERDTree, fzf and all other native/plugin windows)
  • The sidebar and bottom panels already have builtin support for toggling their visibility (just like vim).
  • I believe better alignment to the native vim experience is to close everything except the single pane with focus

Current behaviour
Two splits, navigation panel and bottom panel => become identical but with a single split

Before After :only
before after

Proposed behaviour
Two splits, navigation panel and bottom panel => become a single editor view

Before After :only
before after

Which issue(s) this PR fixes
I couldn't find any via a search on "only"

Special notes for your reviewer:

  • The functionality is achieved easily via builtin vscode functionality
  • I could not find a "native" method to assert against the visibility of the sidebar panel
  • I didn't want to presume the state left from potential previous tests changing this
  • I ended up calculating its visibility by diffing the number of visible lines due to the presence/absence of the panel

Keiran and others added 2 commits November 28, 2019 14:52
- Currently :only in vscode simply reduces the number of editors (splits) to one
- In vim, :only closes all open views except the one with focus
  (eg. it closes NERDTree, fzf and all other native/plugin windows)
- The sidebar and bottom panels are already have builtin support for
  toggling their visibility
- I believe better alignment to the vim experience is to close
  everything except the single pane with focus
@TravisBuddy
Copy link

Travis tests have failed

Hey @kizza,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

Node.js: 8

View build log

if [[ $(git diff-index HEAD -- *.js *.ts *.md) ]]; then git diff; echo "Prettier Failed. Run `gulp forceprettier` and commit changes to resolve."; exit 1; fi
The command "if [[ $(git diff-index HEAD -- *.js *.ts *.md) ]]; then git diff; echo "Prettier Failed. Run `gulp forceprettier` and commit changes to resolve."; exit 1; fi" exited with 0.
$ npm run build

> vim@1.12.2 build /home/travis/build/VSCodeVim/Vim
> gulp build

[03:17:13] Using gulpfile ~/build/VSCodeVim/Vim/gulpfile.js
[03:17:13] Starting 'build'...
[03:17:13] Starting 'prettier'...
[03:17:14] Finished 'prettier' after 565 ms
[03:17:14] Starting 'tsc'...
[03:17:14] Starting 'tslint'...
[03:17:21] Finished 'tslint' after 6.59 s
test/cmd_line/only.test.ts(6,10): error TS2305: Module '"../../../../VSCodeVim/Vim/test/testUtils"' has no exported member 'assertEqual'.
TypeScript: 1 semantic error
TypeScript: emit failed
[03:17:26] The following tasks did not complete: build, <parallel>, tsc
[03:17:26] Did you forget to signal async completion?
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vim@1.12.2 build: `gulp build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the vim@1.12.2 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/travis/.npm/_logs/2019-12-23T03_17_26_070Z-debug.log
The command "npm run build" exited with 1.
$ npm test

> vim@1.12.2 test /home/travis/build/VSCodeVim/Vim
> node ./node_modules/vscode/bin/test

### VS Code Extension Test Run ###

Current working directory: /home/travis/build/VSCodeVim/Vim
Downloading VS Code 1.41.1 into .vscode-test/vscode-1.41.1.
Downloading VS Code from: https://update.code.visualstudio.com/1.41.1/linux-x64/stable
Downloaded VS Code 1.41.1
Running extension tests: /home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/code /home/travis/build/VSCodeVim/Vim/test --extensionDevelopmentPath=/home/travis/build/VSCodeVim/Vim --extensionTestsPath=/home/travis/build/VSCodeVim/Vim/test --locale=en
[main 2019-12-23T03:17:30.111Z] update#setState idle

bash: cannot set terminal process group (-1): Inappropriate ioctl for device

bash: no job control in this shell

nvm is not compatible with the "npm_config_prefix" environment variable: currently set to "/home/travis/.nvm/versions/node/v8.17.0"

Run `unset npm_config_prefix` to unset it.

Error: Error: Cannot find module '/home/travis/build/VSCodeVim/Vim/test'
Require stack:
- /home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/resources/app/out/vs/loader.js
- /home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/resources/app/out/bootstrap-amd.js
- /home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/resources/app/out/bootstrap-fork.js
	at d._doHandleExtensionTests (/home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:699:65)

Error: Cannot find module '/home/travis/build/VSCodeVim/Vim/test'
Require stack:
- /home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/resources/app/out/vs/loader.js
- /home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/resources/app/out/bootstrap-amd.js
- /home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/resources/app/out/bootstrap-fork.js: Error: Error: Cannot find module '/home/travis/build/VSCodeVim/Vim/test'
Require stack:
- /home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/resources/app/out/vs/loader.js
- /home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/resources/app/out/bootstrap-amd.js
- /home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/resources/app/out/bootstrap-fork.js
	at d._doHandleExtensionTests (/home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:699:65)

Tests exited with code: 1
npm ERR! Test failed.  See above for more details.
The command "npm test" exited with 1.
store build cache
changes detected (content changed, file is created, or file is deleted):\n/home/travis/.npm/_logs/2019-12-23T03_17_26_070Z-debug.log\n
changes detected, packing new archive
uploading PR.4304/cache--linux-xenial-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855--node-8.tgz
cache uploaded


Done. Your build exited with 1.
npm run build
> vim@1.12.2 build /home/travis/build/VSCodeVim/Vim
> gulp build

[03:17:13] Using gulpfile ~/build/VSCodeVim/Vim/gulpfile.js
[03:17:13] Starting 'build'...
[03:17:13] Starting 'prettier'...
[03:17:14] Finished 'prettier' after 565 ms
[03:17:14] Starting 'tsc'...
[03:17:14] Starting 'tslint'...
[03:17:21] Finished 'tslint' after 6.59 s
test/cmd_line/only.test.ts(6,10): error TS2305: Module '"../../../../VSCodeVim/Vim/test/testUtils"' has no exported member 'assertEqual'.
TypeScript: 1 semantic error
TypeScript: emit failed
[03:17:26] The following tasks did not complete: build, <parallel>, tsc
[03:17:26] Did you forget to signal async completion?
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vim@1.12.2 build: `gulp build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the vim@1.12.2 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/travis/.npm/_logs/2019-12-23T03_17_26_070Z-debug.log
npm test
> vim@1.12.2 test /home/travis/build/VSCodeVim/Vim
> node ./node_modules/vscode/bin/test

### VS Code Extension Test Run ###

Current working directory: /home/travis/build/VSCodeVim/Vim
Downloading VS Code 1.41.1 into .vscode-test/vscode-1.41.1.
Downloading VS Code from: https://update.code.visualstudio.com/1.41.1/linux-x64/stable
Downloaded VS Code 1.41.1
Running extension tests: /home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/code /home/travis/build/VSCodeVim/Vim/test --extensionDevelopmentPath=/home/travis/build/VSCodeVim/Vim --extensionTestsPath=/home/travis/build/VSCodeVim/Vim/test --locale=en
[main 2019-12-23T03:17:30.111Z] update#setState idle

bash: cannot set terminal process group (-1): Inappropriate ioctl for device

bash: no job control in this shell

nvm is not compatible with the "npm_config_prefix" environment variable: currently set to "/home/travis/.nvm/versions/node/v8.17.0"

Run `unset npm_config_prefix` to unset it.

Error: Error: Cannot find module '/home/travis/build/VSCodeVim/Vim/test'
Require stack:
- /home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/resources/app/out/vs/loader.js
- /home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/resources/app/out/bootstrap-amd.js
- /home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/resources/app/out/bootstrap-fork.js
	at d._doHandleExtensionTests (/home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:699:65)

Error: Cannot find module '/home/travis/build/VSCodeVim/Vim/test'
Require stack:
- /home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/resources/app/out/vs/loader.js
- /home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/resources/app/out/bootstrap-amd.js
- /home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/resources/app/out/bootstrap-fork.js: Error: Error: Cannot find module '/home/travis/build/VSCodeVim/Vim/test'
Require stack:
- /home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/resources/app/out/vs/loader.js
- /home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/resources/app/out/bootstrap-amd.js
- /home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/resources/app/out/bootstrap-fork.js
	at d._doHandleExtensionTests (/home/travis/build/VSCodeVim/Vim/.vscode-test/vscode-1.41.1/VSCode-linux-x64/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:699:65)

Tests exited with code: 1
npm ERR! Test failed.  See above for more details.
TravisBuddy Request Identifier: caa93220-2532-11ea-a370-437b06048fa6

@J-Fields J-Fields force-pushed the close-sidebar-and-panel-with-only branch from 3e6f220 to 5e9b134 Compare December 23, 2019 03:21
@J-Fields
Copy link
Member

Thanks!

@J-Fields J-Fields merged commit a0f472e into VSCodeVim:master Dec 23, 2019
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

3 participants