This commit is contained in:
@@ -274,7 +274,10 @@ export function App(): React.ReactElement {
|
|||||||
setHistory((h) => [path, ...h.filter((p) => p !== path)].slice(0, 100))
|
setHistory((h) => [path, ...h.filter((p) => p !== path)].slice(0, 100))
|
||||||
actions.ensureFile(path)
|
actions.ensureFile(path)
|
||||||
setActive(path)
|
setActive(path)
|
||||||
setTabMode((m) => ({ ...m, [path]: opts.diff && changed ? defaultMode : (m[path] || (changed ? defaultMode : 'code')) }))
|
// Git rows open the diff; explorer / recent-files open the updated view.
|
||||||
|
// Unchanged files only have the plain editable "code" view.
|
||||||
|
const openMode: Mode = changed ? (opts.diff ? 'diff' : 'updated') : 'code'
|
||||||
|
setTabMode((m) => ({ ...m, [path]: openMode }))
|
||||||
reveal(path)
|
reveal(path)
|
||||||
if (opts.line) {
|
if (opts.line) {
|
||||||
// show the current/updated file so line numbers map to search hits
|
// show the current/updated file so line numbers map to search hits
|
||||||
@@ -418,7 +421,7 @@ export function App(): React.ReactElement {
|
|||||||
<GitPanel branch={proj.branch} changes={proj.changes} staged={proj.staged} committed={NO_COMMITTED}
|
<GitPanel branch={proj.branch} changes={proj.changes} staged={proj.staged} committed={NO_COMMITTED}
|
||||||
commitMsg={commitMsg} setCommitMsg={setCommitMsg}
|
commitMsg={commitMsg} setCommitMsg={setCommitMsg}
|
||||||
onStage={stageGuarded} onUnstage={unstageGuarded} onStageAll={actions.stageAll} onUnstageAll={actions.unstageAll} onCommit={commit}
|
onStage={stageGuarded} onUnstage={unstageGuarded} onStageAll={actions.stageAll} onUnstageAll={actions.unstageAll} onCommit={commit}
|
||||||
onOpen={openFile} onContext={openMenu} activePath={active} />
|
onOpen={openFile} onContext={openMenu} activePath={active} showDir={gitW > 300} />
|
||||||
</div>
|
</div>
|
||||||
<Splitter onDelta={(dx) => { setAutoResize(false); setGitW((w) => clamp(w + dx, 160, 460)) }} />
|
<Splitter onDelta={(dx) => { setAutoResize(false); setGitW((w) => clamp(w + dx, 160, 460)) }} />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user