File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 ref =" itemRef"
44 class =" item"
55 :class =" {
6- 'is-selected': !isFocused && isSelected,
6+ 'is-selected': isSelected,
77 'is-focused': isFocused,
88 'is-highlighted': isHighlighted || isHighlightedMultiple,
99 'is-compact': snippetStore.compactMode
@@ -101,16 +101,16 @@ onClickOutside(itemRef, () => {
101101
102102const onClickSnippet = (e : MouseEvent ) => {
103103 if (e .shiftKey ) {
104- if (snippetStore .selectedIndex < props .index ) {
105- snippetStore .selectedMultiple = snippetStore .snippets .slice (
106- snippetStore .selectedIndex ,
107- props .index + 1
108- )
109- } else {
110- snippetStore .selectedMultiple = snippetStore .snippets .slice (
104+ if (snippetStore .selectedIndex > props .index ) {
105+ snippetStore .selectedMultiple = snippetStore .snippetsByFilter .slice (
111106 props .index ,
112107 snippetStore .selectedIndex + 1
113108 )
109+ } else {
110+ snippetStore .selectedMultiple = snippetStore .snippetsByFilter .slice (
111+ snippetStore .selectedIndex ,
112+ props .index + 1
113+ )
114114 }
115115 snippetStore .selected = undefined
116116 isFocused .value = false
@@ -341,11 +341,11 @@ onUnmounted(() => {
341341 }
342342 & .is-focused {
343343 & ::before {
344- background-color : var (--color-primary );
344+ background-color : var (--color-primary ) !important ;
345345 }
346346 .name ,
347347 .footer {
348- color : #fff ;
348+ color : #fff !important ;
349349 }
350350 }
351351 & .is-selected {
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export const useSnippetStore = defineStore('snippets', {
3636 } ) ,
3737
3838 getters : {
39- snippetsByFilter : state => {
39+ snippetsByFilter : ( state ) : SnippetWithFolder [ ] => {
4040 const folderStore = useFolderStore ( )
4141
4242 if ( folderStore . selectedAlias ) {
@@ -53,8 +53,11 @@ export const useSnippetStore = defineStore('snippets', {
5353 } ,
5454 selectedId : state => state . selected ?. id ,
5555 selectedIds : state => state . selectedMultiple . map ( i => i . id ) ,
56- selectedIndex : state =>
57- state . snippets . findIndex ( i => i . id === state . selected ?. id ) ,
56+ selectedIndex ( ) {
57+ // @ts -expect-error
58+ // FIXME: Разобраться с типами
59+ return this . snippetsByFilter . findIndex ( i => i . id === this . selected ?. id )
60+ } ,
5861 currentContent : state =>
5962 state . selected ?. content ?. [ state . fragment ] ?. value || undefined ,
6063 currentLanguage : state =>
You can’t perform that action at this time.
0 commit comments