@lvce-editor/editor-worker 19.41.0 → 19.41.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4701,6 +4701,7 @@ const createEditor2 = (id, uri, x, y, width, height, platform, assetDir) => {
4701
4701
  fontFamily: '',
4702
4702
  fontSize: 0,
4703
4703
  fontWeight: 0,
4704
+ gutterWidth: 0,
4704
4705
  handleOffset: 0,
4705
4706
  handleOffsetX: 0,
4706
4707
  hasListener: false,
@@ -4964,6 +4965,7 @@ const createEditor = async ({
4964
4965
  fontFamily,
4965
4966
  fontSize,
4966
4967
  fontWeight,
4968
+ gutterWidth: 0,
4967
4969
  handleOffset: 0,
4968
4970
  handleOffsetX: 0,
4969
4971
  hasListener: false,
@@ -5700,6 +5702,7 @@ const at = async (editor, eventX, eventY) => {
5700
5702
  fontFamily,
5701
5703
  fontSize,
5702
5704
  fontWeight,
5705
+ gutterWidth = 0,
5703
5706
  isMonospaceFont,
5704
5707
  letterSpacing,
5705
5708
  lines,
@@ -5716,7 +5719,7 @@ const at = async (editor, eventX, eventY) => {
5716
5719
  };
5717
5720
  }
5718
5721
  const rowIndex = getDocumentRowForVisualRow(visualRowIndex, foldingRanges);
5719
- const relativeX = eventX - x + deltaX;
5722
+ const relativeX = eventX - x - gutterWidth + deltaX;
5720
5723
  const clampedRowIndex = clamp(rowIndex, 0, lines.length - 1);
5721
5724
  const line = lines[clampedRowIndex];
5722
5725
  const columnIndex = await getAccurateColumnIndex(line, fontWeight, fontSize, fontFamily, letterSpacing, isMonospaceFont, charWidth, tabSize, relativeX);
@@ -8846,8 +8849,15 @@ const handlePointerCaptureLost = editor => {
8846
8849
  };
8847
8850
  };
8848
8851
 
8849
- const handlePointerDown$1 = async (state, button, altKey, ctrlKey, x, y, detail) => {
8850
- return state;
8852
+ const handlePointerDown$1 = async (state, button, altKey, ctrlKey, x, y, detail, gutterWidth = state.gutterWidth ?? 0) => {
8853
+ const currentGutterWidth = state.gutterWidth ?? 0;
8854
+ if (currentGutterWidth === gutterWidth) {
8855
+ return state;
8856
+ }
8857
+ return {
8858
+ ...state,
8859
+ gutterWidth
8860
+ };
8851
8861
  };
8852
8862
 
8853
8863
  const moveRectangleSelection = (editor, position) => {
@@ -10503,6 +10513,10 @@ const selectionGrow = async editor => {
10503
10513
  return scheduleSelections(editor, newSelections);
10504
10514
  };
10505
10515
 
10516
+ const selectionShrink = editor => {
10517
+ return cursorUndo$1(editor);
10518
+ };
10519
+
10506
10520
  // TODO handle virtual space
10507
10521
 
10508
10522
  // TODO editors behave differently when selecting next occurrence, for example:
@@ -12791,6 +12805,10 @@ const getKeyBindings = () => {
12791
12805
  command: 'Editor.selectionGrow',
12792
12806
  key: Alt$1 | Shift | RightArrow,
12793
12807
  when: FocusEditor
12808
+ }, {
12809
+ command: 'Editor.selectionShrink',
12810
+ key: Alt$1 | Shift | LeftArrow,
12811
+ when: FocusEditor
12794
12812
  }, {
12795
12813
  command: 'Editor.showSignatureHelp',
12796
12814
  key: CtrlCmd | Shift | Space$1,
@@ -14792,7 +14810,7 @@ const renderEventListeners = () => {
14792
14810
  params: ['handleMouseDown', 'event.button', 'event.altKey', 'event.ctrlKey', ClientX, ClientY, 'event.detail']
14793
14811
  }, {
14794
14812
  name: HandlePointerDown,
14795
- params: ['handlePointerDown', 'event.button', 'event.altKey', 'event.ctrlKey', ClientX, ClientY, 'event.detail'],
14813
+ params: ['handlePointerDown', 'event.button', 'event.altKey', 'event.ctrlKey', ClientX, ClientY, 'event.detail', 'event.currentTarget.offsetLeft'],
14796
14814
  trackPointerEvents: [HandlePointerMove, HandlePointerUp]
14797
14815
  }, {
14798
14816
  name: HandlePointerMove,
@@ -15219,6 +15237,7 @@ const commandMap = {
15219
15237
  'Editor.dispose': disposeEditor,
15220
15238
  'Editor.executeViewletCommand': executeViewletCommand,
15221
15239
  'Editor.executeWidgetCommand': wrapCommand(executeWidgetCommand),
15240
+ 'Editor.expandSelection': wrapCommand(selectionGrow),
15222
15241
  'Editor.findAllReferences': wrapCommand(findAllReferences$1),
15223
15242
  'Editor.fold': wrapCommand(fold$1),
15224
15243
  'Editor.format': wrapCommand(format),
@@ -15325,6 +15344,7 @@ const commandMap = {
15325
15344
  'Editor.selectDown': wrapCommand(selectDown),
15326
15345
  'Editor.selectInsideString': wrapCommand(selectInsideString),
15327
15346
  'Editor.selectionGrow': wrapCommand(selectionGrow),
15347
+ 'Editor.selectionShrink': wrapCommand(selectionShrink),
15328
15348
  'Editor.selectLine': wrapCommand(selectLine),
15329
15349
  'Editor.selectNextOccurrence': wrapCommand(selectNextOccurrence),
15330
15350
  'Editor.selectPreviousOccurrence': wrapCommand(selectPreviousOccurrence),
@@ -15347,6 +15367,7 @@ const commandMap = {
15347
15367
  'Editor.showSourceActions': wrapCommand(showSourceActions),
15348
15368
  'Editor.showSourceActions2': wrapCommand(showSourceActions),
15349
15369
  'Editor.showSourceActions3': wrapCommand(showSourceActions),
15370
+ 'Editor.shrinkSelection': wrapCommand(selectionShrink),
15350
15371
  'Editor.sortLinesAscending': wrapCommand(sortLinesAscending),
15351
15372
  'Editor.tabCompletion': wrapCommand(tabCompletion),
15352
15373
  'Editor.terminate': terminate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "19.41.0",
3
+ "version": "19.41.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:lvce-editor/editor-worker.git"