-
Notifications
You must be signed in to change notification settings - Fork 6
Rewrite indentation code #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Open
Changes from all commits
Commits
Show all changes
90 commits
Select commit
Hold shift + click to select a range
7d6bdd7
Begin rewrite of indentation code
axvr 5706ea3
Double (or better) indent performance!
axvr 5f083ff
A bit of code clean up and minor optimisations
axvr f4e0689
Check for maps before vectors for further performance enhancement
axvr 2627e1c
Add fallback for when Vim was not compiled with `searchpairpos`
axvr 4a3cab7
Fix string detection when entering a newline while in insert mode
axvr d1ec02c
Minor performance improvement when file contains multi-line strings
axvr c3047be
Mimic multi-line string/regex indent behaviour of VS Code and Emacs
axvr eb0463e
When `clojure_align_multiline_strings` is `-1`, no indentation
axvr d69008f
Update indentation options sections of the README and vim help file
axvr d73e408
Improve some of the comments in the indentation code
axvr d177b3b
Move string indent picker to a separate function
axvr 51e6a43
Fix false positive multi-line string detection
axvr e573da7
EDN files are unlikely to contain many lists, so check them last
axvr 242dc9d
Yet more string detection fixes and slight code clean up
axvr 342f35f
Initial work on list indentation
axvr 51f5dcb
More indentation code clean up and readability improvements
axvr cc9cda7
Start of a small Clojure reader for indentation w/o syntax highlighting
axvr ee2acc2
Completed the mini Clojure reader as the core of the indentation system
axvr bdbc281
Reader indent algorithm perf has surpassed the prev syntax highlight one
axvr 8ee73c5
Small refactor to improve code clarity in indentation code
axvr a4beb52
Fix indentation bug during comment detection
axvr 3d8197e
Fix accidental detection of backslashes as tokens
axvr 101c9a4
Update indent comments and move `s:Conf` function to the top
axvr 35e0234
Add basic function parameter alignment indentation
axvr 787e1e8
Replace `clojure_align_subforms` with `clojure_indent_style`
axvr bfce724
Update and add a bunch of indentation tests
axvr a2ffcba
Fix indentation for multibyte characters
axvr 09720fe
Switch test runner to Kaocha for nicer output
axvr 2728db2
Only run GitHub Actions workflow once for PRs
axvr d51154a
Neovim does not have a `state()` function
axvr f3d889f
Initial work on building up macro indent rules
axvr bf4cf3d
Fix false-positive comment detection within strings
axvr caef0c5
Improve accuracy of multiline string detection for indentation
axvr 3dbc6dd
Fix indentation when file contains multibyte characters
axvr 5550111
Add more indent test cases
axvr b8aef1b
Neovim has added the `state()` function; use it if available
axvr b2c392d
Fix application of inline comments during indentation
axvr 4edeef0
Add tests to check that comments don't affect indentation
axvr 0388414
Fix indentation of `with-*` macros
axvr 41a45d4
Update comments and add `with-in-str` indent rule
axvr 68999ca
Improve accuracy of function operand indenting
axvr 8f38c11
Slight code refactor and added more comments
axvr 7e90f09
When `lispoptions` feature is available, we can enable the `lisp` option
axvr 0b388ae
Indent some macros a bit like functions
axvr 289352d
More indent test cases
axvr cefb7bc
Fix escape character detection logic
axvr 16026f7
Simplify character column resolution
axvr d87f254
Add some indent rules for more built in macros
axvr 6a3d2d3
Don't use fn arg alignment indent when a keyword is in function position
axvr 083f554
Merge 'origin/master' into indent-forms
axvr f271dca
Add extra indentation test cases for records and protocols
axvr b86a4c0
Begin refinements to configuration options
axvr 01edfec
Fix config option lookup
axvr 9b5e42c
Discovered a way to put comments within dict defs in Vim script
axvr a41fa1b
Improve indentation in "uniform" style and undo reader conditional work
axvr 3487e07
Update README to better cover the new indentation options
axvr 3c5258c
Replace the old multi-line string config option
axvr 3b4dad8
Remove the link to the #vim IRC as the link is now dead
axvr 117b082
Fix typos and re-add the insert-mode completion info to the README
axvr b26db95
Update the "About" section within the Vim help doc
axvr c4a25c5
Update indentation section of the Vim help doc
axvr 1742549
Improve indentation style examples in Vim help doc
axvr 9800368
Minor documentation and comment refinements
axvr 69a0b6f
In README, mention the replacements for each old indent config option
axvr 058b4a7
Add indentation tests covering keywords in function position
axvr 0a835d8
Update indent regular expressions to set the required 'magic' mode
axvr 0d865c5
Compress comments on indent code
axvr 052a498
Compress more comments on indent code
axvr 55543c4
Use `<kbd>` to show keyboard shortcuts in `README.md`
axvr 208ff9f
Improved accuracy of first function argument detection in indentation
axvr 968340e
Slightly improve keyboard shortcut formatting in `README.md`
axvr 082120a
Set mode in new regexprs
axvr 161ea5f
Make `ClojureIndent()` function public
axvr 78ecad5
Indent `with-` macros and functions like cljfmt default
axvr 6ce7017
Run indentation tests against Vim AND Neovim
axvr d2f39f9
Install latest Vim and Neovim in GitHub Actions
axvr 8e9ed28
Merge latest changes from 'origin/master'
axvr e5f86af
New indentation test runner
axvr 7659541
Improve new test runner output and detect script errors
axvr 1ea333a
Speed up indentation tests on Vim
axvr aae9ae8
Move `indenttime` script to `dev` folder as `time-indent`
axvr 1883215
Update GitHub Actions
axvr 5f995a1
Kaocha not needed anymore, so removing dependency
axvr f3358f3
Bump copyright year
axvr 13ca6fe
Remove unneeded config from `clj/profile.clj`
axvr 5b277db
Run indentation tests in Vim's silent Ex-improved mode
axvr d8dc8a7
Reduce indentation test runner noise and add colour output
axvr e50122e
GitHub Actions "annotations" feature doesn't work with colour output
axvr c4b8d48
Simplify indentation test runner output on GitHub Actions
axvr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
.github/workflows/indent.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Indent | ||
on: | ||
push: { branches: [ master ] } | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
vim-latest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Fetch source | ||
uses: actions/checkout@v4 | ||
- name: Install Vim | ||
uses: rhysd/action-setup-vim@v1 | ||
with: { version: stable } | ||
- name: Run indentation tests | ||
run: EDITOR=vim dev/do/test-indent | ||
|
||
neovim-latest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Fetch source | ||
uses: actions/checkout@v4 | ||
- name: Install Neovim | ||
uses: rhysd/action-setup-vim@v1 | ||
with: { neovim: true, version: stable } | ||
- name: Run indentation tests | ||
run: EDITOR=nvim dev/do/test-indent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
clj/resources/indent-test-cases/basic-sexp/in.clj
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
clj/resources/indent-test-cases/basic-sexp/out.clj
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
clj/resources/indent-test-cases/dispach-macro/in.clj
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
clj/resources/indent-test-cases/dispach-macro/out.clj
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
clj/resources/indent-test-cases/inherit-indentation/config.edn
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.