joshuadanpeterson / typewriter.nvim

A Neovim plugin that emulates a typewriter, keeping the cursor centered on the screen for a focused writing experience.
MIT License
23 stars 0 forks source link

fix: improve center_block_and_cursor function to correctly center code blocks for PHP files #12

Closed joshuadanpeterson closed 1 month ago

joshuadanpeterson commented 1 month ago

Description:

This pull request addresses the issue reported in #9, where the :TWCenter command centers the current line instead of the entire code block, particularly in PHP files.

Summary of Changes:

Commits:

  1. feat(commands): Correctly center code block even when near bottom of the file.
  2. fix: Improve center_block_and_cursor function for better PHP block handling.
  3. fix: Improve center_block_and_cursor function for better PHP block handling.
  4. fix: Improve get_expand_root logic for better PHP block handling.
  5. feat(center_block_config): Add declaration_list to node list.
  6. refactor(center_block_and_cursor): Add new nodes.
  7. feat(center_block_config): Add new node.
  8. style(commands): Remove debug print statements.
  9. docs: Update CHANGELOG.md for v0.4.24 and remove duplicate entries.
  10. refactor(commands): Remove 'stop traversal' statement.
  11. merge: Merge branch 'dev' of https://github.com/joshuadanpeterson/typewriter.nvim

Files Changed:

Contributors:

Related Issues:

Testing:

This pull request improves the reliability and functionality of the :TWCenter command in Neovim, particularly for PHP files, ensuring that the correct code block is centered as intended.