Skip to content

Commit afa8333

Browse files
committed
Update doc and readme for auto pair complete feature
1 parent a43c413 commit afa8333

3 files changed

Lines changed: 49 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@ and CodeView has AutoComplete and you can customize it with different keywords a
3535
- Support Auto indentation with customization.
3636
- Support highlighting matching tokens.
3737
- Support replace first and replace all matching tokens.
38+
- Support auto pair complete.
3839

3940
- Documentations:
4041
- [Full Documentation](https://amrdeveloper.github.io/CodeView/)
4142
- [Install Documentation](docs/install.md)
4243
- [Add to XML Documentation](docs/add-to-xml.md)
4344
- [Highlight Documentation](docs/highlight.md)
4445
- [Auto Complete Documentation](docs/auto-complete.md)
46+
- [Pair Complete Documentation](docs/pair-complete.md)
4547
- [Snippets Documentation](docs/snippets.md)
4648
- [Auto Indenting Documentation](docs/auto-indenting.md)
4749
- [Find and Replace Documentation](docs/find-and-replace.md)

docs/pair-complete.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Pair Complete
2+
3+
Starting From version 1.3.0 CodeView now has support for auto pair complete,
4+
this feature can help you to implement some features easily such as quote or double quote complete,
5+
or closing braces complete.
6+
7+
This features is disabled by default to enable or disable it
8+
9+
```
10+
codeView.enablePairComplete(enableFeature);
11+
```
12+
13+
To use this feature you need to create a Map that contains the pairs keys and values for example
14+
15+
```
16+
Map<Character, Character> pairCompleteMap = new HashMap<>();
17+
pairCompleteMap.put('{', '}');
18+
pairCompleteMap.put('[', ']');
19+
pairCompleteMap.put('(', ')');
20+
pairCompleteMap.put('<', '>');
21+
pairCompleteMap.put('"', '"');
22+
```
23+
24+
To add your full pairs map
25+
26+
```
27+
codeView.setPairCompleteMap(pairCompleteMap);
28+
```
29+
30+
To add a single pair
31+
32+
```
33+
codeView.addPairCompleteItem('[', ']');
34+
```
35+
36+
To remove a single pair
37+
38+
```
39+
codeView.removePairCompleteItem('[');
40+
```
41+
42+
To remove all the pairs
43+
44+
```
45+
codeView.clearPairCompleteMap();
46+
```

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ nav:
4343
- Add to XML: add-to-xml.md
4444
- Highlight: highlight.md
4545
- Auto Complete: auto-complete.md
46+
- Pair Complete: pair-complete.md
4647
- Snippets: snippets.md
4748
- Auto Indenting: auto-indenting.md
4849
- Find and Replace: find-and-replace.md

0 commit comments

Comments
 (0)