mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 11:16:05 +08:00 
			
		
		
		
	fix(code): indentation working in read-only mode
This commit is contained in:
		
							parent
							
								
									3e5e19b8a5
								
							
						
					
					
						commit
						a20a51fa75
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		|  | @ -1,5 +1,5 @@ | |||
| import { indentLess, indentMore } from "@codemirror/commands"; | ||||
| import { EditorSelection, type ChangeSpec } from "@codemirror/state"; | ||||
| import { EditorSelection, EditorState, type ChangeSpec } from "@codemirror/state"; | ||||
| import type { KeyBinding } from "@codemirror/view"; | ||||
| 
 | ||||
| /** | ||||
|  | @ -14,6 +14,10 @@ const smartIndentWithTab: KeyBinding[] = [ | |||
|     { | ||||
|         key: "Tab", | ||||
|         run({ state, dispatch }) { | ||||
|             if (state.facet(EditorState.readOnly)) { | ||||
|                 return false; | ||||
|             } | ||||
| 
 | ||||
|             const { selection } = state; | ||||
|             const changes = []; | ||||
|             const newSelections = []; | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue