<commit_before>// Copyright 2013 The lime Authors.
// Use of this source code is governed by a 2-clause
// BSD-style license that can be found in the LICENSE file.

package backend

import (
	"fmt"
	"github.com/atotto/clipboard"
	"github.com/limetext/lime/backend/keys"
	"github.com/limetext/lime/backend/log"
	"github.com/limetext/lime/backend/packages"
	. "github.com/limetext/lime/backend/util"
	"github.com/limetext/lime/backend/watch"
	. "github.com/limetext/text"
	"path"
	"runtime"
	"runtime/debug"
	"sync"
)

func init() {
	runtime.GOMAXPROCS(runtime.NumCPU())
	GetEditor()
}

type (
	Editor struct {
		HasSettings
		keys.HasKeyBindings
		*watch.Watcher
		windows          []*Window
		activeWindow     *Window
		logInput         bool
		cmdHandler       commandHandler
		console          *View
		frontend         Frontend
		keyInput         chan (keys.KeyPress)
		clipboardSetter  func(string) error
		clipboardGetter  func() (string, error)
		clipboard        string
		defaultSettings  *HasSettings
		platformSettings *HasSettings
		defaultBindings  *keys.HasKeyBindings
		platformBindings *keys.HasKeyBindings
		userBindings     *keys.HasKeyBindings
	}

	// The Frontend interface defines the API
	// for functionality that is frontend specific.
	Frontend interface {
		// Probe the frontend for the currently
		// visible region of the given view.
		VisibleRegion(v *View) Region

		// Make the frontend show the specified region of the
		// given view.
		Show(v *View, r Region)

		// Sets the status message shown in the status bar
		StatusMessage(string)

		// Displays an error message to the usser
		ErrorMessage(string)

		// Displays a message dialog to the user
		MessageDialog(string)

		// Displays an ok / cancel dialog to the user.
		// "okname" if provided will be used as the text
		// instead of "Ok" for the ok button.
		// Returns true when ok was pressed, and false when
		// cancel was pressed.
		OkCancelDialog(msg string, okname string) bool
	}

	DummyFrontend struct {
		m sync.Mutex
		// Default return value for OkCancelDialog
		defaultAction bool
	}
)

var (
	LIME_USER_PACKAGES_PATH = path.Join("..", "..", "packages", "User")
	LIME_PACKAGES_PATH      = path.Join("..", "..", "packages")
	LIME_DEFAULTS_PATH      = path.Join("..", "..", "packages", "Default")
)

func (h *DummyFrontend) SetDefaultAction(action bool) {<commit_msg>dummy font.pointSize should change whenever fondSize variable changed<commit_after>// Copyright 2013 The lime Authors.
// Use of this source code is governed by a 2-clause
// BSD-style license that can be found in the LICENSE file.

package backend

import (
	"fmt"
	"github.com/atotto/clipboard"
	"github.com/limetext/lime/backend/keys"
	"github.com/limetext/lime/backend/log"
	"github.com/limetext/lime/backend/packages"
	. "github.com/limetext/lime/backend/util"
	"github.com/limetext/lime/backend/watch"
	. "github.com/limetext/text"
	"path"
	"runtime"
	"runtime/debug"
	"sync"
)

func init() {
	runtime.GOMAXPROCS(runtime.NumCPU())
	GetEditor()
}

type (
	Editor struct {
		HasSettings
		keys.HasKeyBindings
		*watch.Watcher
		windows          []*Window
		activeWindow     *Window
		logInput         bool
		cmdHandler       commandHandler
		console          *View
		frontend         Frontend
		keyInput         chan (keys.KeyPress)
		clipboardSetter  func(string) error
		clipboardGetter  func() (string, error)
		clipboard        string
		defaultSettings  *HasSettings
		platformSettings *HasSettings
		defaultBindings  *keys.HasKeyBindings
		platformBindings *keys.HasKeyBindings
		userBindings     *keys.HasKeyBindings
	}

	// The Frontend interface defines the API
	// for functionality that is frontend specific.
	Frontend interface {
		// Probe the frontend for the currently
		// visible region of the given view.
		VisibleRegion(v *View) Region

		// Make the frontend show the specified region of the
		// given view.
		Show(v *View, r Region)

		// Sets the status message shown in the status bar
		StatusMessage(string)

		// Displays an error message to the user
		ErrorMessage(string)

		// Displays a message dialog to the user
		MessageDialog(string)

		// Displays an ok / cancel dialog to the user.
		// "okname" if provided will be used as the text
		// instead of "Ok" for the ok button.
		// Returns true when ok was pressed, and false when
		// cancel was pressed.
		OkCancelDialog(msg string, okname string) bool
	}

	DummyFrontend struct {
		m sync.Mutex
		// Default return value for OkCancelDialog
		defaultAction bool
	}
)

var (
	LIME_USER_PACKAGES_PATH = path.Join("..", "..", "packages", "User")
	LIME_PACKAGES_PATH      = path.Join("..", "..", "packages")
	LIME_DEFAULTS_PATH      = path.Join("..", "..", "packages", "Default")
)

func (h *DummyFrontend) SetDefaultAction(action bool) {
{'fraction_non_alphanumeric': 0.10048046793398788, 'fraction_numerical': 0.0020889910173386254, 'mean_word_length': 3.2259488084730803, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1408854', 'n_tokens_mistral': 1631, 'n_tokens_neox': 1508, 'n_words': 455}