-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathnotes.txt
163 lines (137 loc) · 4.81 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
https://www.npmjs.com/package/idb
--- notepad2
"editor.getCursor": (): number => {
return editor.editorView!.state.selection.main.from;
},
"editor.getSelection": (): { from: number; to: number } => {
return editor.editorView!.state.selection.main;
},
Text.lineAt(pos)
So to get cursor line / char:
let cursor = editorView.state.selection.main.from;
let line = editorView.state.doc.lineAt(cursor);
let lineNo = line.number;
let charNo = cursor - line.from;
Things present in notepad2 but not in notepad2web:
* Exit menu and toolbar icon
* Alt-F11 shortcut for toggle menu
* zoom in / out : using browser zooming instead
The reason for those are restrictions of the browser.
Some keyboard shortcuts cannot be intercepted.
Some functionality is not available in the browser.
Some functionality can't be implemented in Code Mirror.
Some functionality is too hard to implement in Code Mirror.
Specific things:
IDM_VIEW_HIGHLIGHTCURRENTLINE_SUBLINE - when line is wrapped, Scintilla has an option (turned by default) to only highlight the first line of wrapped line. CodeMirror doesn't have that
IDM_VIEW_HIGHLIGHTCURRENT_BLOCK - CodeMirror doesn't do that
---
export {
history,
historyKeymap,
indentWithTab,
standardKeymap,
} from "@codemirror/commands";
export {
autocompletion,
closeBrackets,
closeBracketsKeymap,
CompletionContext,
completionKeymap,
} from "@codemirror/autocomplete";
export type { Completion, CompletionResult } from "@codemirror/autocomplete";
export { styleTags, Tag, tagHighlighter, tags } from "@lezer/highlight";
export type {
BlockContext,
Element,
LeafBlock,
LeafBlockParser,
Line,
MarkdownConfig,
MarkdownExtension,
} from "@lezer/markdown";
import {
Emoji,
GFM,
MarkdownParser,
parseCode,
parser as baseParser,
Strikethrough,
Subscript,
Superscript,
Table,
TaskList,
} from "@lezer/markdown";
export type { NodeType, SyntaxNode, SyntaxNodeRef, Tree } from "@lezer/common";
export { searchKeymap } from "@codemirror/search";
export {
Decoration,
drawSelection,
dropCursor,
EditorView,
highlightSpecialChars,
keymap,
placeholder,
runScopeHandlers,
ViewPlugin,
ViewUpdate,
WidgetType,
} from "@codemirror/view";
export type { DecorationSet, KeyBinding } from "@codemirror/view";
import { markdown } from "@codemirror/lang-markdown";
import {
EditorSelection,
EditorState,
Range,
SelectionRange,
StateField,
Text,
Transaction,
} from "@codemirror/state";
import type { ChangeSpec, Extension, StateCommand } from "@codemirror/state";
import {
defaultHighlightStyle,
defineLanguageFacet,
foldedRanges,
foldInside,
foldNodeProp,
HighlightStyle,
indentNodeProp,
indentOnInput,
Language,
languageDataProp,
LanguageDescription,
LanguageSupport,
ParseContext,
StreamLanguage,
syntaxHighlighting,
syntaxTree,
} from "@codemirror/language";
import { yaml as yamlLanguage } from "@codemirror/legacy-modes";
export {
pgSQL as postgresqlLanguage,
standardSQL as sqlLanguage,
} from "https://esm.sh/@codemirror/[email protected]/mode/sql?external=@codemirror/language";
export { rust as rustLanguage } from "https://esm.sh/@codemirror/[email protected]/mode/rust?external=@codemirror/language";
export { css as cssLanguage } from "https://esm.sh/@codemirror/[email protected]/mode/css?external=@codemirror/language";
export { python as pythonLanguage } from "https://esm.sh/@codemirror/[email protected]/mode/python?external=@codemirror/language";
export { protobuf as protobufLanguage } from "https://esm.sh/@codemirror/[email protected]/mode/protobuf?external=@codemirror/language";
export { shell as shellLanguage } from "https://esm.sh/@codemirror/[email protected]/mode/shell?external=@codemirror/language";
export { swift as swiftLanguage } from "https://esm.sh/@codemirror/[email protected]/mode/swift?external=@codemirror/language";
export { toml as tomlLanguage } from "https://esm.sh/@codemirror/[email protected]/mode/toml?external=@codemirror/language";
export { xml as xmlLanguage } from "https://esm.sh/@codemirror/[email protected]/mode/xml?external=@codemirror/language";
export { json as jsonLanguage } from "https://esm.sh/@codemirror/[email protected]/mode/javascript?external=@codemirror/language";
export {
c as cLanguage,
cpp as cppLanguage,
csharp as csharpLanguage,
dart as dartLanguage,
java as javaLanguage,
kotlin as kotlinLanguage,
objectiveC as objectiveCLanguage,
objectiveCpp as objectiveCppLanguage,
scala as scalaLanguage,
} from "https://esm.sh/@codemirror/[email protected]/mode/clike?external=@codemirror/language";
export {
javascriptLanguage,
typescriptLanguage,
} from "https://esm.sh/@codemirror/[email protected]?external=@codemirror/language,@codemirror/autocomplete,@codemirror/view,@codemirror/state,@codemirror/lint,@lezer/common,@lezer/lr,@lezer/javascript,@codemirror/commands";