Skip to content

Clean up naming conventions project-wide - #75

Merged
nathansobo merged 16 commits into
mainfrom
naming-cleanup
May 28, 2021
Merged

Clean up naming conventions project-wide#75
nathansobo merged 16 commits into
mainfrom
naming-cleanup

Conversation

@maxbrunsfeld

Copy link
Copy Markdown
Collaborator

Closes #49
Closes #72

This PR makes three naming changes:

  • Module filenames - For all rust modules that have their own directories (such as the buffer module), move the module's root file outside of the module directory, and rename it to match the module. For example, this renames buffer/mod.rs to buffer.rs. This makes the file easier fine using the fuzzy finder.
  • BufferView module - This renames BufferView -> Editor. Previously, that type was our only view whose name ended with View. The word Editor is also just nicer to say and to type.
  • Context parameter names - Throughout the codebase, gpui context parameters (with types like AppContext, MutableAppContext, and ModelContext<T>) were named a mixture of app and ctx. This renames them all to cx.

@nathansobo
nathansobo merged commit ff2ab4b into main May 28, 2021
@nathansobo
nathansobo deleted the naming-cleanup branch May 28, 2021 22:42
SomeoneToIgnore added a commit that referenced this pull request Jul 14, 2023
Closes https://github.com/zed-industries/community/issues/75
Closes https://github.com/zed-industries/community/issues/1749

The PR 

* changes keybindings for `Editor && mode == auto_height` context:
before, `alt-enter` and `alt-shift-enter` added new lines in such
editors, including the one from buffer search.

New bindings are the same as in `Editor && mode == full` context.

* adds `search::SelectAllMatches` action and binds it to `Alt + Enter`
by default, to select all matches of a buffer search

The behavior mimics VSCode: we do not move the screen even if all
selections are out of the visible range (Cmd+G will navigate there) and
allow reselecting the results from both pane and search field, as long
as the search is not dismissed.

Release Notes:

- Added `search::SelectAllMatches` (`Alt + Enter` default) action to
place carets and select all buffer search results
([#75](https://github.com/zed-industries/community/issues/75),
[#1749](https://github.com/zed-industries/community/issues/1749)).
Anthony-Eid pushed a commit to Anthony-Eid/zed that referenced this pull request Dec 18, 2024
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
Closes https://github.com/zed-industries/community/issues/75
Closes https://github.com/zed-industries/community/issues/1749

The PR 

* changes keybindings for `Editor && mode == auto_height` context:
before, `alt-enter` and `alt-shift-enter` added new lines in such
editors, including the one from buffer search.

New bindings are the same as in `Editor && mode == full` context.

* adds `search::SelectAllMatches` action and binds it to `Alt + Enter`
by default, to select all matches of a buffer search

The behavior mimics VSCode: we do not move the screen even if all
selections are out of the visible range (Cmd+G will navigate there) and
allow reselecting the results from both pane and search field, as long
as the search is not dismissed.

Release Notes:

- Added `search::SelectAllMatches` (`Alt + Enter` default) action to
place carets and select all buffer search results
([zed-industries#75](https://github.com/zed-industries/community/issues/75),
[zed-industries#1749](https://github.com/zed-industries/community/issues/1749)).
ShalashaskaOcelot pushed a commit to ShalashaskaOcelot/zed that referenced this pull request Aug 13, 2026
Test results from 2026-08-11. Bugs zed-industries#7, zed-industries#66, zed-industries#67, zed-industries#68, zed-industries#70 and zed-industries#72 confirmed
fixed and removed; zed-industries#64 failed and stays open with the finding recorded; zed-industries#73's
repro is confirmed on Windows. Three fixes here.

zed-industries#69 (column titles wrapping their last character) was NOT fixed by the previous
attempt, and that attempt was aimed at the wrong layer. Measuring headers
semibold was a real discrepancy and stays, but the cause is that the table
renders at a different font SIZE from the one it measures with: ui's
font_buffer sets only the font family, so the size stayed ambient while
TableView::new measured against buffer_font_size. Every glyph then rendered a
fraction wider than measured, and the error accumulates with string length —
invisible on a 15-character title, just past the padding slack on a
16-character one, which is exactly the reported Column_number_9-fits,
Column_number_10-wraps threshold. The rendered size is now pinned to the
measured one.

zed-industries#74: a notebook whose file was deleted while Zed was closed didn't restore at
all, taking any unsaved changes with it. Nothing to do with deletion handling —
open_buffer deliberately returns an empty buffer for a path with no entry, so
the notebook parses, but try_open then demanded a worktree entry id and a
deleted file has none. That id was already optional on NotebookItem (it is only
a fallback for entry_id, which re-resolves from the path), so nothing needed it
to be present.

zed-industries#75: a restored untitled notebook showed no dirty marker until the next
keystroke. Same trap phase 69 fixed for file-backed notebooks and missed here:
rebuilding a notebook from stored JSON makes those cells their own baseline, so
it reads as clean. Contents are only stored when there ARE unsaved changes, so a
restored untitled notebook is unsaved by definition and now says so.

Also filed zed-industries#76: restoring unsaved changes over a file edited elsewhere gives no
notification. The conflict flag may well be set correctly and simply invisible
until save time, which is the first thing to check — the two possible causes
need different fixes, so nothing is attempted yet.

Backlogged from zed-industries#72's confirmation: a restart should read Restarting → Idle,
not Restarting → Starting → Idle.

Verified: clippy clean, 57 repl tests pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JkvYRuX9r6PmLXpxNie2R7
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.

Normalize module structure Rename all context parameters from ctx to cx

2 participants