Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Rename, reveal in tree view, and show in finder with split files can affect the wrong split #13617

Closed
1 task done
feakuru opened this issue Jan 14, 2017 · 5 comments · May be fixed by atom/tree-view#1205
Closed
1 task done

Comments

@feakuru
Copy link

feakuru commented Jan 14, 2017

Prerequisites

Description

When I open 2 files in horizontal split and try to rename (RMB on file tab -> "Rename") the right one, it shows the name of the left one and renames it, not the right one. Reveal in tree view and show in finder are similarly affected.

Steps to Reproduce

  1. Open two files
  2. Drag one of them to the right until editor highlights a right split for it
  3. Focus the file on the left.
  4. Right-click the file on the right and try to rename it.

Expected behavior: a pop-up appears with an input box for renaming the "right" file

Actual behavior: a pop-up appears with an input box for renaming the "left" file

Reproduces how often: was able to catch it once

Versions

Xubuntu 16.04
atom v6.5.0
apm 1.12.9
npm 3.10.5
node 4.4.5
python 2.7.12
git 2.7.4

Additional Information

none

@feakuru
Copy link
Author

feakuru commented Jan 14, 2017

update: i seem to have incorrectly understood the nature of the issue. the renaming of the wrong file happens if the wrong tab is active. however, i still believe that the behaviour discovered is faulty and am not closing the issue.

@50Wliu
Copy link
Contributor

50Wliu commented Jan 14, 2017

Thanks @feakuru, confirmed. I've updated your reproduction steps with the extra information in your update. Looks somewhat related to #13398.

@jeffreyscottfrench
Copy link

I'm also experiencing this (Atom 1.18.0 on MacOS 10.12.5) - contextual menu from right-click appears over the click point, not the active tab. Right click should activate the tab underneath the click, or not display options that can't be performed on an inactive tab (as it does when right-clicking elsewhere in the top of an open pane with tabs). Thanks!

@rsese
Copy link
Contributor

rsese commented Jan 18, 2018

Updating the issue title and body since the bug includes Reveal in Tree View and Show in Finder
x-ref: #16586

@rsese rsese changed the title Renaming split files sometimes renames the wrong split Rename, reveal in tree view, and show in finder with split files can affect the wrong split Jan 18, 2018
@damieng
Copy link
Contributor

damieng commented Jan 26, 2018

Part of the problem here is that these menu options do things like;

tree-view:reveal-active-file
tree-view:show-current-file-in-file-manager

And the active file is always the one with the cursor, not the one you clicked the menu on.

We have some other limitations here with the right-click menu such as if you're not in a file (e.g. in search results) then you won't see these context menu options no matter what you right click on. Basically the menu's contents are controlled by the current active file, not by the context menu target.

Options are

  • Make the right menu button for tabs be completely based on the target - this is most likely what people expect but is a larger piece of work and will involve new commands etc.
  • Make the current 'hide-half-the-menu-except-on-the-active-window-tab' which we use on other tabs in the split pane also apply to other split panes. Less useful but consistent with what we do today and is doable in the time we have.

@damieng damieng self-assigned this Jan 27, 2018
@damieng damieng removed their assignment Feb 9, 2018
@darangi darangi closed this as completed Mar 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants