mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 00:00:49 +00:00
Add command to insert non-breaking space
Triggered by Ctrl+Shift+Space on PC. On Mac, there is no trigger, we rely on the built-in OS shortcut. Bug: T53045 Change-Id: I9630804c833d755910589022b0ca78208337d804
This commit is contained in:
parent
bc5a2846d9
commit
1abb5a5786
|
@ -22,3 +22,25 @@ ve.ui.commandRegistry.register(
|
|||
}
|
||||
)
|
||||
);
|
||||
|
||||
ve.ui.commandRegistry.register(
|
||||
new ve.ui.Command( 'mwNonBreakingSpace', 'content', 'insert', {
|
||||
args: [
|
||||
[
|
||||
{ type: 'mwEntity', attributes: { character: '\u00a0' } },
|
||||
{ type: '/mwEntity' }
|
||||
],
|
||||
// annotate
|
||||
true,
|
||||
// collapseToEnd
|
||||
true
|
||||
],
|
||||
supportedSelections: [ 'linear' ]
|
||||
} )
|
||||
);
|
||||
ve.ui.triggerRegistry.register(
|
||||
'mwNonBreakingSpace', {
|
||||
mac: [],
|
||||
pc: new ve.ui.Trigger( 'ctrl+shift+space' )
|
||||
}
|
||||
);
|
||||
|
|
|
@ -246,3 +246,16 @@ ve.ui.wikitextCommandRegistry.register(
|
|||
}
|
||||
)
|
||||
);
|
||||
|
||||
ve.ui.wikitextCommandRegistry.register(
|
||||
new ve.ui.Command( 'mwNonBreakingSpace', 'content', 'insert', {
|
||||
args: [
|
||||
' ',
|
||||
// annotate
|
||||
true,
|
||||
// collapseToEnd
|
||||
true
|
||||
],
|
||||
supportedSelections: [ 'linear' ]
|
||||
} )
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue