mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-09-28 06:42:58 +00:00
lint more
This commit is contained in:
@@ -73,14 +73,11 @@ const insertTab = (view)=>{
|
|||||||
return forEachSelection(view, (state, range)=>{
|
return forEachSelection(view, (state, range)=>{
|
||||||
const { from, to } = range;
|
const { from, to } = range;
|
||||||
return {
|
return {
|
||||||
changes : {
|
changes : { from, to, insert: ' ' },
|
||||||
from,
|
range : EditorSelection.cursor(from + 2)
|
||||||
to,
|
|
||||||
insert : ' ' // Insert two spaces, not a tab char!
|
|
||||||
},
|
|
||||||
range : EditorSelection.cursor(from + 2)
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
// Insert two spaces, not a tab char!
|
||||||
};
|
};
|
||||||
|
|
||||||
const wrapSelection = (prefix, suffix)=>(view)=>forEachSelection(view, (state, range)=>{
|
const wrapSelection = (prefix, suffix)=>(view)=>forEachSelection(view, (state, range)=>{
|
||||||
@@ -101,16 +98,8 @@ const wrapSelection = (prefix, suffix)=>(view)=>forEachSelection(view, (state, r
|
|||||||
if(hasWrapper) {
|
if(hasWrapper) {
|
||||||
return {
|
return {
|
||||||
changes : [
|
changes : [
|
||||||
{
|
{ from: to - suffix.length, to, insert: '' },
|
||||||
from : to - suffix.length,
|
{ from, to: from + prefix.length, insert: '' }
|
||||||
to,
|
|
||||||
insert : ''
|
|
||||||
},
|
|
||||||
{
|
|
||||||
from,
|
|
||||||
to : from + prefix.length,
|
|
||||||
insert : ''
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
range : EditorSelection.range(from, to - prefix.length - suffix.length)
|
range : EditorSelection.range(from, to - prefix.length - suffix.length)
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user