Skip to content

Commit

Permalink
Merge pull request #14 from joshuadanpeterson/dev
Browse files Browse the repository at this point in the history
 Update Significant Node Types for Centering in Typewriter.nvim
  • Loading branch information
joshuadanpeterson authored Jul 21, 2024
2 parents f1a5861 + a5dcfa3 commit f218d1c
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 42 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
# Changelog

## [v0.5.0](https://github.com/joshuadanpeterson/typewriter.nvim/tree/v0.5.0) (2024-07-20)
- Merge branch 'dev' of https://github.com/joshuadanpeterson/typewriter.nvim into dev
- feat: Update significant node types for centering
- refactor(test): Remove test.txt
- docs: update CHANGELOG.md for v0.4.26 and remove duplicate entries

[Full Changelog](https://github.com/joshuadanpeterson/typewriter.nvim/compare/v0.4.26...v0.5.0)

## [v0.4.26](https://github.com/joshuadanpeterson/typewriter.nvim/tree/v0.4.26) (2024-07-19)
- refactor(CHANGELOG): Update CHANGELOG
- docs: update CHANGELOG.md for v0.4.25 and remove duplicate entries

[Full Changelog](https://github.com/joshuadanpeterson/typewriter.nvim/compare/v0.4.25...v0.4.26)
[Full Changelog](https://github.com/joshuadanpeterson/typewriter.nvim/compare/v0.5.0...v0.4.26)

## [v0.4.25](https://github.com/joshuadanpeterson/typewriter.nvim/tree/v0.4.25) (2024-07-19)

Expand Down
99 changes: 59 additions & 40 deletions lua/typewriter/utils/center_block_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,60 +29,79 @@ local M = {}
--- -- To disable centering for a specific node type:
--- center_block_config.expand["function"] = false
M.expand = {
["comment"] = true,
-- Common significant blocks across many languages
["function"] = true,
["body"] = true,
["method"] = true,
["table"] = true,
["if_statement"] = true,
["class"] = true,
["block"] = true,
["module"] = true,
["namespace"] = true,
["program"] = true,
["source"] = true,
["for_loop"] = true,
["while_loop"] = true,
["conditional"] = true,
["switch_statement"] = true,
["case_statement"] = true,
["try_statement"] = true,
["catch_clause"] = true,
["finally_clause"] = true,
["switch_statement"] = true,
["case_statement"] = true,
["else_clause"] = true,
["do_statement"] = true,
["repeat_statement"] = true,
["function_call"] = true,
["function_definition"] = true,
["function_declaration"] = true,
["class"] = true,
["class_declaration"] = true,
["method_declaration"] = true,
["arrow_function"] = true,
["function_expression"] = true,
["generator_function"] = true,
["async_function"] = true,
["object"] = true,
["array"] = true,
["property"] = true,
["field"] = true,
["parameter"] = true,
["constructor"] = true,
["decorator"] = true,
["import_statement"] = true,
["export_statement"] = true,
["try_expression"] = true,
["local_declaration"] = true,
-- ["declaration_list"] = true,
["function_call"] = true,

-- Language-specific significant blocks
-- PHP
["namespace"] = true,

-- Lua
-- (covered by common significant blocks)

-- Go
["package"] = true,

-- Rust
["match_statement"] = true,
["enum_declaration"] = true,
["interface_declaration"] = true,
["type_alias"] = true,
["variable_declaration"] = true,
["lexical_declaration"] = true,
["assignment"] = true,
["expression_statement"] = true,
["return_statement"] = true,
["throw_statement"] = true,
["await_expression"] = true,
["declaration_list"] = true,
["compound_statement"] = true,
["method_declaration"] = true,
["class_declaration"] = true,
["impl_block"] = true,
["struct"] = true,
["enum"] = true,
["trait"] = true,
["mod"] = true,

-- JavaScript
["function_expression"] = true,

-- Python
["except_clause"] = true,
["def"] = true,

-- HTML
["tag"] = true,
["script"] = true,
["style"] = true,

-- CSS
["rule"] = true,
["media"] = true,
["keyframes"] = true,

-- Bash
-- (covered by common significant blocks)

-- SQL
["select_statement"] = true,
["insert_statement"] = true,
["update_statement"] = true,
["delete_statement"] = true,
["create_statement"] = true,
["alter_statement"] = true,
["drop_statement"] = true,
["begin_statement"] = true,
["commit_statement"] = true,
["rollback_statement"] = true,
}

--- Get the expansion status for a given node type
Expand Down
1 change: 0 additions & 1 deletion test.txt

This file was deleted.

0 comments on commit f218d1c

Please sign in to comment.